Skip to main content

Get the reduced cost

Answered

Comments

11 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.
  • Jaromił Najman
    • Gurobi Staff

    You might be looking for the article What are Attributes? In particular, you are probably looking for the RC variable attribute.

    0
  • Cong Jin
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hello, the RC attribute in i query to gurobi may be what I need, but I haven't found the sample code of RC attribute. Could you show me a related example? Thank you very much.

    0
  • Matthias Miltenberger
    • Gurobi Staff

    Please check out this section of our documentation: Attribute Examples - Optimizer Reference Manual - Gurobi Optimization

    0
  • Cong Jin
    • Gurobi-versary
    • Conversationalist
    • First Question

    I'm very sorry that I didn't find the relevant example. Could you help me show an example of RC attribute?

    0
  • Jaromił Najman
    • Gurobi Staff

    The RC attribute is a variable attribute, i.e., it works the same way as, e.g., the LB attribute.

    for v in model.getVars():
        print(v.RC)
    0
  • Cong Jin
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hello, I put the above code into my code, but there is a bug. What is the reason?

    0
  • Jaromił Najman
    • Gurobi Staff

    The screenshot you provided is unfortunately not enough to understand the issue. Please provide a minimal reproducible example.

    0
  • Cong Jin
    • Gurobi-versary
    • Conversationalist
    • First Question

    How can I get the RC value mentioned in the figure below, where X and H are variables?

    0
  • Jaromił Najman
    • Gurobi Staff

    Please refer to my comment in your other post.

    0
  • Cong Jin
    • Gurobi-versary
    • Conversationalist
    • First Question

    Thank you very much for your help.

    0

Post is closed for comments.