0

I have a constraint that makes the optimization problem nonlinear. The constraint of interest is:

If (a-b)>=0
    then c=(a-b)
else
    c=0

where $a$, $b$ and $c$ are variables. How to linearize this constraint to convert the problem to linear form?

1 Answers1

0

In other words, you want $c=\max(a-b,0)$. If $c$ appears in the objective as minimization, you can relax to $c\ge\max(a-b,0)$, which is enforced by linear constraints $c\ge a-b$ and $c \ge 0$.

RobPratt
  • 45,619
  • Max function will make it non-linear only. What we want is a linearized form of the function in LINGO. We don't know how to use binary variables as both a and b are variables. – Ankita Panchariya Nov 25 '19 at 11:37
  • My answer suggests replacing the $\max$ constraint with two linear constraints. – RobPratt Nov 25 '19 at 13:58