Computing dual for QCP in Gurobi Python
AnsweredHello,
I am using gurobi python to solve QCP. I am trying to extract the dual and its say "attribute unavailable". I set the parameter "QCPDual=1". I received this warning
"failed to compute QCP dual solution due to inaccurate barrier solution
Try decreasing BarQCPConvTol for more accuracy"
I decreased the tolerance and still no solution. I saw that lot of people faced this issue before but none of them got a solution. I am able to retrieve the dual variables using cvxpy+mosek solver but that significantly slow.
Would really appreciate any advice on how to resolve this in Gurobi
-
Hi Anjula,
Yes, this is a common issue for the QCP models with challenging numerics. Scaling your model manually, if possible, to ensure the model numerics look reasonable is the best approach to address this issue. Model numerics are reasonable if the matrix coefficient range does not span beyond 6 orders of magnitude, the good solutions have objective values in the order of 1e4 or less, the variable bounds and RHS values are in the order of 1e4 or less. These are general guidelines that you have probably already seen in our Guidelines for Numerical Issues.
Some parameters that you can experiment with are:
- Make sure that FeasibilityTol and OptimalityTol parameters are set to be at least one order of magnitude lower than the smallest coefficient value in your model.
- Experiment with numerically relevant parameters such as NumericFocus, ScaleFlag, and ObjScale.
- Experiment with turning Aggregate off. It can improve the numerics of the presolved model.
- Experiment with some of the barrier parameters. I would recommend checking out Gurobi Barrier Algorithm Performance Tuning video to get a better idea. The first idea would be to decrease the number of dense columns (see slide 38).
Hope this helps.
Best regards,
Maliheh
1 -
Hi Maliheh
Thank you so much for your advice.
I tried all the methods you suggested. But none of them helped me. It only made the convergence worse. I tried tuning the different parameters as suggested.
0 -
Hi Anjula,
Yes, using these parameters typically comes at the cost of increasing the runtime, although there is no guarantee that the extra care given to numerics would result in a clean barrier solution.
Best regards,
Maliheh
0
Please sign in to leave a comment.
Comments
3 comments