Big-M Constraints: Linking Binary to Continuous Variables

How to use a Big-M coefficient to make a binary indicator variable switch a continuous decision variable on or off in an integer program. Covers the basic linking constraint x ≤ My, choosing the tightest valid M, forcing a minimum activity level when the indicator is on, and combining lower and upper linking constraints.

Step 1 of 157%

Tutorial

The Big-M Linking Constraint

In integer programming, a binary indicator y{0,1}y \in \{0,1\} often controls whether a continuous variable x0x \ge 0 is allowed to take a positive value at all. We want

  • y=0x=0,y = 0 \,\Longrightarrow\, x = 0,
  • y=1xy = 1 \,\Longrightarrow\, x may take any value up to its natural upper bound.

A single linear inequality accomplishes this. If MM is a constant at least as large as the largest possible value of x,x, then the Big-M linking constraint

xMyx \le M y

does the job:

  • When y=0:y = 0{:} the constraint becomes x0.x \le 0. Combined with x0,x \ge 0, this forces x=0.x = 0.
  • When y=1:y = 1{:} the constraint becomes xM,x \le M, which is exactly the natural upper bound on x.x.

For example, if a factory can produce at most 200200 units when running, set M=200M = 200 and write x200y.x \le 200 y. With y=0y = 0 the factory produces nothing; with y=1y = 1 it may produce anywhere from 00 to 200200 units.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle