0
$\begingroup$

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?

$\endgroup$
0
$\begingroup$

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$.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Ankita Panchariya Nov 25 '19 at 11:37
  • $\begingroup$ My answer suggests replacing the $\max$ constraint with two linear constraints. $\endgroup$ – Rob Pratt Nov 25 '19 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.