Indicator constraints with arbitrary right-hand-side (Python)Answered
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?
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))
The alternative form is what I was looking for, thanks :)0
Please sign in to leave a comment.