Linearize a variable have value in one range and 0 otherwise

Occasionally, I encountered a linearization problem: a variable takes one value within a certain range and 0 outside that range. For example,

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:

  • Pursuing the paper " Capacitated inventory problems with fixed order costs-some optimal policy structure"
  • Branch and bound, branch and cut, branch and price
  • Operations to preserve convexity----restricted to a line
  • Lagrangian dual of the mixed integer programming model
  • Proof for the continuity of a min function