If-Then Constraint:如果X< 4然后T = 4 -X

时间:2014-10-29 04:07:25

标签: integer mathematical-optimization

所有通用的If-then约束似乎都没有让我对此有所了解。 我想与Lindo形成一个混合整数程序,它可以最小化成本,因为一系列:当X< 4然后T = 4 - X& Y = 1.否则,当x> 1时4,然后T = 0,Y = 0.感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

为了模拟这个表达式,我们需要知道4 - X的界限。让我们假设

LB <= 4 - X <= UB

其中LB <= 0UB >=0|LB| + |UB| > 0(即LBUB都不为零),否则问题很简单。

然后我们考虑以下系统(T是连续的,Y是二进制的):

T >= 4 - X                  (I)
T <= 4 - X - LB * (1 - Y)   (II)
T <= UB * Y                 (III)
T >= 0                      (IV)   

正确性证明

X < 4 <=> 4 - X > 0 so (I) => T > 0 and then (III) => Y = 1, 
and (I) + (II) => T = 4 - X. (III, IV) are redundant in this case.

X > 4 <=> 4 - X < 0. If we allow Y = 1 then T = 4 - X < 0, which is not
allowed by (IV). Hence, Y = 0 and (III, IV) => T = 0. (I, II) are redundant in
this case.

X == 4 ==> T = 0 and Y either 0 or 1.

我希望这有帮助!