Indicator constraints with arbitrary right-hand-side (Python)
Answeredmodel.addGenConstrIndicator(...)
As far as I can see (though that does not mean much of course), there is no reason why the right-hand-side has to be a float. Neither Math nor Python should pose a problem here and it would make life easier for us users, because we could just write down constraints in the order in which we wrote them down on paper. May I therefore suggest adding this feature?
Best regards,
Tobi
0
-
Official comment
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
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 -
The alternative form is what I was looking for, thanks :)
0
Post is closed for comments.
Comments
3 comments