Does anybody know how to write conditional constraint in mixed integer programming for this case:
if a == 0 then b = 1
else b = 0
-M <= a <= M
b={0,1}
Note that M can be any continuous number. Thanks.
Regards,
Does anybody know how to write conditional constraint in mixed integer programming for this case:
if a == 0 then b = 1
else b = 0
-M <= a <= M
b={0,1}
Note that M can be any continuous number. Thanks.
Regards,
I would approach this as follows. First use a variable splitting approach by introducing two non-negative variables
aplus, amin
:Now we can do:
In many cases we can simplify this but that requires knowledge of the rest of the model.