Skip to main content

Help implementing a weird model notation

Answered

Comments

2 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.
  • Simranjit Kaur
    • Gurobi Staff

    Hi Lorenz,

    The logical operator \(\wedge\) represents conjunction, i.e., the and condition. So, the expression \(\sum_{i,t:i.GG=1\wedge i.O=b}\) means summing over i,t such that i.CG=1 and i.O=b. There are no checks for the index t in this condition.

    The constraint \[\sum_{i,t:i.GG=1\wedge i.O=b}x_{jit} \geq 5 \quad \forall j,b \] can be modelled as

    m.addConstrs((gp.quicksum(x[j,i,t] for i in I for t in T if GG[i] == 1 and O[i] == b) >= 5 for j in J for b in B), name="test")

    Best regards,
    Simran

    0

Post is closed for comments.