Retrieve dual optimizers?
AnsweredHi,
When I solve QP, is there a function to get the dual optimizers for the problem, that is, the optimal x for
at slide 3 here http://www.seas.ucla.edu/~vandenbe/ee236b/lectures/duality.pdf? Note this is different from the optimizers of the primal problem as they are unconstrained.
From my understanding, this may not be how the solver usually works, so it is fine if there is no API function to get them. Solving another optimization problem online may take extra time, so I will just go through the trouble and compute them by hand.
Thank you!
-
Hi Xuan,
You can set the parameter QCPDual to 1. This will make Gurobi compute the dual multipliers for continuous convex QCPs by solving the corresponding KKT problem. This would be the \(\lambda\) and \(\nu\) from slide 2 in the PDF file you linked.
If your model is non-convex and/or has discrete variables, then no duals will be computed. In this case, you could fix some variables participating in nonconvex terms and/or fix all discrete variables to get a convex QCP.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment