Is there a way to formulated the conditions below in the form of linear constraint(s)?
If $S_1 ≤ 1$ and $S_2 ≤ 1 ⇒ X = 0$
If $S_1 ≥ 2$ or $S_2 ≥ 2 ⇒ X ≤ 1$
$S_1, S_2 \in \left \{ 0, 1, 2 \right \}$
$X \in \left \{0, 1 \right \}$
Is there a way to formulated the conditions below in the form of linear constraint(s)?
If $S_1 ≤ 1$ and $S_2 ≤ 1 ⇒ X = 0$
If $S_1 ≥ 2$ or $S_2 ≥ 2 ⇒ X ≤ 1$
$S_1, S_2 \in \left \{ 0, 1, 2 \right \}$
$X \in \left \{0, 1 \right \}$
Copyright © 2021 JogjaFile Inc.
First make an auxiliary binary variable $z_i$ indicating that $s_i\leq 1$, for example
$$\frac12 (2-s_i)\leq z_i\leq 2-s_i,\quad z_i\in\{0,1\}.$$
It has the property that $s_i\leq 1$ iff $z_i=1$.
Then
$$x\leq 2-z_1-z_2.$$
In general you can always write a logical formula involving linear conditions as a linear MIP by repeating step by step the model for a single indicator constraint $A^Tx\leq b \implies z=1$. See for example https://docs.mosek.com/modeling-cookbook/mio.html Sometimes the general formulation can be simplified by observing some model-specific trick, and the big-M can be made specific by using the bounds from the model. But the general procedure always applies.