Linearize a variable in a range


Occasionally, I encountered a linearization problem where a variable takes one value in a certain region and another value elsewhere, i.e.,

  • If $ m_1 \leq x \leq m_2 $, then $ y = x $; otherwise, $ y = 0 $.

The linearization of this problem is as follows:

  • Introduce a binary variable ( z ) and a sufficiently large constant ( M ).

[ \begin{aligned} x&\geq m_1-zM
x&\leq m_2+zM
y-x&\geq -zM
y-x&\leq zM
y&\leq (1-z)M
y&\geq -(1-z)M \end{aligned} ]




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Operations to preserve convexity----restricted to a line
  • Branch and bound, branch and cut, branch and price
  • Pursuing the paper " Capacitated inventory problems with fixed order costs-some optimal policy structure"
  • Lagrangian dual of the mixed integer programming model
  • Linearize a variable have value in one range and 0 otherwise