Skip to main content

problem in modeling "keyerror = 0"

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • 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?.
  • Jaromił Najman
    • Gurobi Staff

    Your variables are defined over 2 lists \(\texttt{RAW}\) and \(\texttt{COMP}\). Thus, you have to access variables \(\texttt{use_r}\) via

    m.setObjective(quicksum(COST_r[r] * use_r[r,c] for r in RAW for c in COMP), GRB.MINIMIZE)

    Best regards,
    Jaromił

    0

Post is closed for comments.