メインコンテンツへスキップ

Not getting the dual solution of my optimization problem

回答済み

コメント

1件のコメント

  • Riley Clement
    Gurobi Staff 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

サインインしてコメントを残してください。