The standard linearization for the multiplication of two binary variables z=x⋅yz=x⋅y with x,y∈{0,1}x,y∈{0,1} is:
z≤xz≤yz≥x+y−1z∈{0,1} |
What about if y is continuous between zero and one, y∈[0,1] (while x remains a binary variable)? In that case we can use the formulation in (1) where we consider a continuous variable y∈[ylo,yup]:
min{0,ylo}≤z≤max{0,yup}ylo⋅x≤z≤yup⋅xy−yup⋅(1−x)≤z≤y−ylo⋅(1−x) |
When we plug in ylo=0 and yup=1, we end up with the same thing:
z≤xz≤yz≥x+y−1z∈[0,1] |
We can easily verify the correctness by checking what happens when x=0 or x=1:
x=0⟹{z≤0z≤y(NB)z≥y−1(NB)z∈[0,1]⟹z=0x=1⟹{z≤1(NB)z≤yz≥yz∈[0,1]⟹z=y |
where NB means non-binding by which I mean we can ignore this constraint.
References
- Multiplication of a continuous and a binary variable, http://yetanothermathprogrammingconsultant.blogspot.com/2008/05/multiplication-of-continuous-and-binary.html
No comments:
Post a Comment