How to linearize following constraint to be used in a MILP model?

386 Views Asked by At

Regarding a project I am currently working on I need to linearize following conditon such that it can be used in a linear optimization model. The condition is:

If $X \geq B$ then $Y=X-B$ ; else $Y=0$.

In this condition both $Y$ and $X$ are decision variables whereas $B$ is a constant.

Thanks in advance for any insights.

1

There are 1 best solutions below

4
On BEST ANSWER

Introduce two binary variables $\delta_1$ and $\delta_2$ constrained to sum to $1$. Then model that $\delta_1$ implies $(X\geq B, Y+B-X=0 = 0)$ and $\delta_2$ implies $(X\leq B, Y = 0)$

The implications are modelled using standard big-M models

$$ X \geq B -M(1-\delta_1), -M(1-\delta_1) \leq Y+B-X \leq M(1-\delta_1)\\ X \leq B + M(1-\delta_2), -M(1-\delta_1) \leq Y \leq M(1-\delta_1)\\ $$