How to linearize a max function in a constraint?

92 Views Asked by At

I have linear program that has constraint as follows:

$ \max(x,y) \geq 0 $

where $x$ and $y$ are variables. How to linearize this inequality? How to write this constraints in google or tools?

1

There are 1 best solutions below

0
On BEST ANSWER

You want to enforce the disjunction $x \ge 0 \lor y \ge 0$. Introduce binary variable $z$, and enforce \begin{align} z=0 &\implies x \ge 0 \\ z=1 &\implies y \ge 0 \end{align} If your solver does not support indicator constraints, you can linearize via big-M: \begin{align} -x &\le M z \\ -y &\le M(1-z) \end{align}