Tuesday, February 21, 2017

Multiplication of binary with continuous variable between zero and one

A small tidbit.

The standard linearization for the multiplication of two binary variables z=xyz=xy with x,y{0,1}x,y{0,1} is:

zxzyzx+y1z{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}zmax{0,yup}yloxzyupxyyup(1x)zyylo(1x)

When we plug in ylo=0 and yup=1, we end up with the same thing:

zxzyzx+y1z[0,1]

We can easily verify the correctness by checking what happens when x=0 or x=1:

x=0{z0zy(NB)zy1(NB)z[0,1]z=0x=1{z1(NB)zyzyz[0,1]z=y

where NB means non-binding by which I mean we can ignore this constraint.

References
  1. 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