How can I find out which method or algorithm was used to solve my model? When I use GRB.IntParam.Method- to output the method, I get -1 for the automatic method.

I have a quadratic objective function with quadratic constraints and PWL constructs, so I had to set the model to "Non-Convex". So I would also like to know if I consequently have a QP, QCP, MIQP, or MIQCP.

  • $\begingroup$ In Gurobi website, it says: In the current release, the default Automatic (-1) setting will typically choose non-deterministic concurrent (Method=3) for an LP, barrier (Method=2) for a QP or QCP, and dual (Method=1) for the MIP root node. $\endgroup$ – Oguz Toragay May 1 at 17:12
  • $\begingroup$ Yes, I have seen that too. I have now selected all methods manually and in fact method 1, the dual simplex algorithm is the one that is also selected automatically. Can I assume that my model is then a MIQP model due to the fact that I have a quadratic objective function and it is Non-Convex? If so, then why do all the methods work? $\endgroup$ – Handballer73 May 1 at 18:39

You can use IsQP, IsQCP to see the type of your model as follow:

Let's sat your model called $m$:

qp = m.IsQP
qcp = m.IsQCP

The output will be a binary value which indicates that your model is QP if $qp =1$ or your model is a QCP if $qcp = 1$. You should also use the following code to set the model as non-convex:

m.setParam('NonConvex', 2)

Note that all these codes are good for Python API of Gurobi. Based on Gurobi website: "With setting 2, non-convex quadratic problems are solved by means of translating them into bilinear form and applying spatial branching."

  • $\begingroup$ Great thanks for the answer. I used Java code but got the result that it is a QCP. I had already set the parameter "Non-Convex" to 2. But if I understand correctly, by setting this parameter, is it a MIQCP model or is it really just a QCP model? $\endgroup$ – Handballer73 May 2 at 14:10
  • $\begingroup$ In other words, since the description for the "Method" parameter states that only the barrier algorithm is available for QCP, but the dual simplex is used automatically, it must be an MIQCP model? $\endgroup$ – Handballer73 May 3 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.