For my class in OR I have to linearize the following constraint:
IF ($x_1$ = 0 AND $x_2$ = 0) THEN $x_3$ = 0.
My first idea was to make use of some binary variables ($y_1$, $y_2$ and $y_3$) and some sufficiently large integers ($M_1$ and $M_2$):
$x_1$ $\leq$ $M_1(1-y_1)$
$-x_1$ $\leq$ $M_1(1-y_1)$
$x_2$ $\leq$ $M_2(1-y_2)$
$-x_2$ $\leq$ $M_2(1-y_2)$
$x_3$ $\leq$ $M_3(2-y_2-y_3)$
$-x_3$ $\leq$ $M_3(2-y_2-y_3)$
However, using this constraints it can still be so that $x_1$ and $x_2$ are both 0 and $x_3$ is not zero.
Could someone please explain to me which part I'm missing?
We need to encode unbounded variables and absolute values using inequalities. We will do this using the extended real numbers together with the definition used in measure theory that $0 \times \pm \infty = 0$. Using this system we have for all real numbers $t$ that $\pm \infty \times t = \pm \infty \times \mathrm{sgn}(t)$. We take as our system the following:
For all $i \in \{1,2\}$, $$x_i^{+}, x_i^{-} \geq 0$$ $$y_i^{+}, y_i^{-} \in \{0,1\}$$ $$x_i = x_i^{+} - x_i^{-}$$ $$y_i^{+} + y_i^{-} \leq 1$$ $$\infty \times x_i = \infty \times (y_i^{+} - y_i^{-})$$ $$\infty \times x_i^{+} = \infty \times y_i^{+}$$ $$\infty \times x_i^{-} = \infty \times y_i^{-}$$ Together with, $$- \infty \times (y_1^{+} + y_1^{-} + y_2^{+} + y_2^{-}) \leq x_3 \leq \infty \times (y_1^{+} + y_1^{-} + y_2^{+} + y_2^{-})$$