Skip to main content

Indicator constraints with arbitrary right-hand-side (Python)

Answered

Comments

2 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Tobi,

    Could you please elaborate more on what exactly the feature should be? A pseudo-code example or similar would be helpful.

    If you think about replacing the rhs argument to be, e.g., a TempConstr, then you might want to use the alternative or overloaded form

    # alternative form
    model.addGenConstrIndicator(x7, True, x1 + 2*x2 + x4 == 1.0 + x5)
    # overloaded form
    model.addConstr((x7 == 1) >> (x1 + 2*x2 + x4 == 1.0 + x5))

    Best regards, 
    Jaromił

    0
  • Tobias Völk
    Gurobi-versary
    First Comment
    Curious

    The alternative form is what I was looking for, thanks :)

    0

Please sign in to leave a comment.