Suppose we have a binary variable $x$ and a negative continuous variable $y$. How can we linearize the product $u=xy$?
Asked
Active
Viewed 92 times
2
-
3You can define $z=-y$ and use the usual technique described for example here. – Kuifje Oct 29 '23 at 16:32
2 Answers
1
replace the constraint with the followings where $M$ is a large number:
$u \le(1-x)M +y$
$u \ge(1-x)M +y$
$u \le xM$
$u \ge -xM$
Oguz Toragay
- 8,652
- 2
- 13
- 41
-
thanks a lot, I think the third and fourth constraints are not correct for example for x=1 & y=-5 we can't get u=-5. – m.amin Oct 30 '23 at 07:26
-
1