conditional constraint in optimization

夙愿已清 提交于 2019-12-12 00:04:22

问题


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:


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.



来源:https://stackoverflow.com/questions/37764680/conditional-constraint-in-optimization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!