If Else Statement in Linear Program, making it Mixed Integer Program

53 Views Asked by At

How to write the following if-else condition in Linear Programming or in Mixed Integer Program?

If a <= b then c = a

else ( a > b) then c = b

a, b, c are all variables. Is it possible to rewrite this without doing it nonlinear?

a,b,c >0

1

There are 1 best solutions below

1
On BEST ANSWER

You want to enforce $c=\min(a,b)$. If $c$ naturally (because of the objective or otherwise) satisfies $c\ge\min(a,b)$, it suffices to enforce $c\le\min(a,b)$: \begin{align} c&\le a \\ c&\le b \end{align}

Otherwise, see https://or.stackexchange.com/questions/1160/how-to-linearize-min-function-as-a-constraint