Error 10020 when changing MIPFocus from 0 to 1
OngoingI am solving a convex mixed-integer quadratically constrained program (MIQCP) using Gurobi 14.0.0.
When I solve the model with NonConvex=1 and the default MIPFocus=0, Gurobi successfully finds a feasible solution. However, when I solve the exact same model with NonConvex=1 and MIPFocus=1, Gurobi terminates with error code 10020: “Q matrix in QP model is not positive semi-definite (PSD).”
I have also encountered a similar issue under different circumstances. After obtaining a feasible solution to a problem with NonConvex=1, I added affine constraints to the model and attempted to reoptimize it. However, Gurobi terminated with the same error code 10020.
I have experienced these issues in both Gurobi 13.0.0 and 14.0.0.
What could be causing this behavior, and how can I diagnose the underlying issue?
-
Hi Ahmet,
I suspect the model might be borderline convex and numerical issues are interfering with the convexity check.
First thing I would do is check whether your model statistics are in line with recommendations:
https://support.gurobi.com/hc/en-us/articles/41980341859473-What-does-Model-contains-large-matrix-coefficient-range-objective-coefficients-rhs-bounds-meanMore importantly, I would check the coefficients for the presolved model. You can do this in python using Model.presolve() then Model.printStats().
I would also inspect the coefficients of your model. Are they clean, or are there small errors present? I have a talk where we inspect model files which might help: https://youtu.be/BfU5ffZ1qrQ?si=yNpwPz8YH1gs8snc&t=710
You may also find that changing the Seed parameter sometimes results in convexity being detected and sometimes doesn't. If this occurs then it's also evidence that the model is borderline convex. Note that if the NonConvex parameter is left at its default then Gurobi will proceed with the solve under the assumption that the model may not be convex, but in practice it will often solve just as quickly. You could test this theory by leaving NonConvex at its default value, then using different values of Seed, and comparing solve times for solves where the model is detected as convex with those where it is not (assuming there is a mix of such solves in the results).
If the model stats look healthy, and the coefficients look clean, then maybe there is a bug or something that could be improved in Gurobi. Let me know if you think this is the case and we can explore further.
- Riley
0 -
Dear Dr. Clement,
Thank you for your response and suggestions.
I have already experimented with prescaling and tested the same instance using different values of the NumericFocus parameter. Unfortunately, these adjustments produced similar results in most cases.
One important observation came from testing different PSDTol values. All values below 1 resulted in the same error code, while values of 1 or higher did not. This suggests that Gurobi may sometimes fail to recognize constraints of the form x^2+y^2 ≤ z^2 as convex, even when z ≥ 0 is explicitly imposed.
I should also note that setting NonConvex=1, MIPFocus=1, and NoRelHeurTime=0 did not produce the error, and Gurobi successfully found an optimal solution.
The error also seems to depend unexpectedly on the branching path, so trying different Seed values might help. However, relying on a particular Seed value would be difficult to justify in an academic paper.
Best regards,
Ahmet Emir Şener0
Please sign in to leave a comment.
Comments
2 comments