conditional constraint in optimization

2019-09-04 08:26发布

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,

1条回答
放荡不羁爱自由
2楼-- · 2019-09-04 08:58

I would approach this as follows. First use a variable splitting approach by introducing two non-negative variables aplus, amin:

0 <= aplus <= d*M
0 <= amin <= (1-d)*M
a = aplus-amin
d in {0,1}

Now we can do:

0.001*(1-b) <= aplus + amin <= M*(1-b)

In many cases we can simplify this but that requires knowledge of the rest of the model.

查看更多
登录 后发表回答