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!
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
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
Post is closed for comments.
Comments
2 comments