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?
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?
Copyright © 2021 JogjaFile Inc.
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}