Skip to main content

My Model resulting KeyError: 0 please help

Awaiting user input

Comments

4 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.
  • Mario Ruthmair
    • Gurobi Staff

    Hi Christian,

    I guess there are some index issues when accessing your data in these constraints. Probably, you should check whether you can access D[m-1][j-1] for all m and j. Are you sure this works if m and j are the first available values?

    Best regards,
    Mario

    0
  • Christian Yavin Ibrahim
    • Gurobi-versary
    • First Comment
    • First Question

    I'm not quite sure if m and j are the first available values. maybe you can check the mathematical model below for that constraints

    0
  • Mario Ruthmair
    • Gurobi Staff

    I meant that you should check if the indices and corresponding data exist in your data structures, e.g., by accessing and/or printing them before using them in the constraints.

    0

Post is closed for comments.