Linearization of if-then when having both binary and non-negative

32 Views Asked by At

How to linearize the if-then statements when the condition is a binary and the result is equality between two non-negative?

Three variables:

$\gamma_{i}^{t,s} \in \{0,1\}$ and $x_{i}^{t} \in \mathbb{R}$ and $y_{i}^{t} \in \mathbb{R}$

The If-Then

  • $ \gamma_{i}^t \implies x_{i}^{t} = y_{i}^{t} $
  • $ \gamma_{i}^t \iff x_{i}^{t} = y_{i}^{t} $
1

There are 1 best solutions below

0
On BEST ANSWER

Assume $L_x \le x \le U_x$ and $L_y \le y \le U_y$. Then you can enforce the indicator constraint $$\gamma = 1 \implies x = y$$ via linear big-M constraints $$(L_x-U_y)(1-\gamma) \le x - y \le (U_x-L_y)(1-\gamma).$$

To enforce the equivalence $$\gamma = 1 \iff x = y,$$ introduce small constant tolerance $\epsilon > 0$, binary variables $\alpha$ and $\beta$, and linear constraints \begin{align} \alpha + \gamma + \beta &= 1 \\ (L_x-U_y)\alpha + 0\gamma + \epsilon\beta \le x - y &\le -\epsilon\alpha + 0\gamma + (U_x-L_y)\beta \end{align}