Skip to main content

Why I can't get the shadow price (dual value) from Gurobipy while the model is feasible?

Awaiting user input

Comments

4 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Tianyang Zhao
    Gurobi-versary
    First Question
    First Comment

    I've fixed this problem but come up with a new one now. I post it in the nest post.

    0
  • Ying Lu
    Gurobi-versary
    First Comment

    Could you tell me how did you fixed this problem?

    0
  • Alison Cozad
    Gurobi Staff Gurobi Staff

    Tianyang, I am happy to hear you were able to resolve your issue.  

     

    Ying,

    It sounds like you may be having the same issue.  Here are a couple of things that may help you:

    • Pi values are only available for convex, continuous problems.  If you are solving a MIP, Gurobi does not provide dual values for an integer program because shadow prices are not well-defined for these types of problems.  However, if you would like to understand the sensitivity of your problem to bound/constraint limits, please check out How do I retrieve the (dual) Pi values for a MIP problem?
    • If you are solving a QCP, there are a couple of extra steps to get your duals.  To get the duals of linear constraints, set the QCPDual parameter is set to 1.  To get the duals for quadratic constraints, you will want to use QCPi attribute rather than the Pi attribute.

    If this doesn't help, can you tell me a bit more about your model and how you are trying to access Pi values?

    0

Post is closed for comments.