Skip to main content

Not getting the dual solution of my optimization problem

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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.
  • Riley Clement
    • Gurobi Staff

    Hi Airin,

    If the model is a LP or QP you should be able to retrieve the dual solution with the Pi or QCPi attribute, depending on the constraint.  If you do have a QP then you need to set the QCPDual parameter.  Note that dual solutions are not available for models with nonlinear constraints, or models with integer variables.  There is a workaround for the latter, but the values can often be misleading.

    There are several options for how to query the attribute.  See the links for your API on the Attribute Examples page for details.

    I have checked the results explanation and it shows both the primal and dual value of the objective function. I have ensured to add dual suffix, and set the DualReductions equal to 0 but still facing the same problem.

    Note that none of these should be relevant to retrieving dual solutions.  I would leave DualReductions at its default value.

    - Riley

     

     

    0

Post is closed for comments.