TExcelTAD
Home › Optimization › Cutting Planes

Cutting Planes

Branch and bound works best when the LP relaxation is tight. Cutting planes tighten it: they are linear inequalities that every integer-feasible point satisfies but the current fractional LP solution violates. Adding them cuts off the fractional point without losing any integer solution. Combined with branching, this is branch and cut, the method inside every modern MIP solver.

The ideal formulation

The integer hull is the convex hull of the integer feasible points. If you could describe it with linear inequalities, the LP over it would have integer vertices and solve the integer program directly. Cutting planes approximate the integer hull from outside, only near the optimum.

Chvátal-Gomory cuts

Take any valid inequality ∑jajxj≤b\sum_ja_jx_j \le b for non-negative integer x\mathbf{x} (for example a non-negative combination of constraints). Rounding down the coefficients keeps it valid, ∑j⌊aj⌋xj≤b\sum_j\lfloor a_j \rfloor x_j \le b, and since the left side is now an integer, the right side can be rounded too:

∑j⌊aj⌋xj≤⌊b⌋\sum_j\lfloor a_j \rfloor x_j \le \lfloor b \rfloor

Example: from 2x+2y≤32x + 2y \le 3, divide by 2 to get x+y≤1.5x + y \le 1.5, then x+y≤1x + y \le 1 is valid for integers and cuts off the fractional point (0.75,0.75)(0.75, 0.75).

Gomory cuts from the simplex tableau

Ralph Gomory (1958) showed how to read a cut directly from an optimal simplex tableau: a row with fractional right-hand side xi+∑jaˉjxj=bˉx_i + \sum_j\bar{a}_jx_j = \bar{b} gives the cut ∑jf(aˉj)xj≥f(bˉ)\sum_j f(\bar{a}_j)x_j \ge f(\bar{b}), where f(v)=v−⌊v⌋f(v) = v - \lfloor v \rfloor is the fractional part. Repeating "solve LP, add cut" converges in theory; in practice cuts are added a few rounds at a time inside branch and bound.

python · try it yourself
import numpy as np
from scipy.optimize import linprog

# maximize x + y s.t. 2x + 2y <= 3, x, y >= 0 integer
c = np.array([-1.0, -1.0])
A = [[2.0, 2.0]]; b = [3.0]
r = linprog(c, A_ub=A, b_ub=b, bounds=[(0, None)] * 2, method="highs")
print("LP relaxation:", np.round(r.x, 4), " value", -r.fun)
# Chvatal-Gomory cut from (1/2) * first row: x + y <= floor(1.5) = 1
A2 = A + [[1.0, 1.0]]; b2 = b + [1.0]
r2 = linprog(c, A_ub=A2, b_ub=b2, bounds=[(0, None)] * 2, method="highs")
print("after the cut:", np.round(r2.x, 4), " value", -r2.fun)
LP relaxation: [1.5 0. ]  value 1.5
after the cut: [1. 0.]  value 1.0

One cut closed the whole gap: the relaxation's value dropped from 1.5 to the integer optimum 1.

Cover inequalities for knapsacks

For a knapsack constraint ∑jwjxj≤W\sum_jw_jx_j \le W with binary xjx_j, a cover is a set CC of items whose total weight exceeds WW. Not all of them fit, so

∑j∈Cxj≤∣C∣−1\sum_{j \in C}x_j \le \lvert C \rvert - 1
python · try it yourself
import numpy as np
from scipy.optimize import linprog

v = np.array([12.0, 11.0, 10.0, 9.0]); w = np.array([6.0, 5.0, 5.0, 4.0]); W = 10.0
r = linprog(-v, A_ub=[w], b_ub=[W], bounds=[(0, 1)] * 4, method="highs")
print("LP:", np.round(r.x, 3), " bound", round(-r.fun, 3))
# items {0, 1} weigh 11 > 10: a cover -> x0 + x1 <= 1 ; items {1, 2, 3} weigh 14 > 10 -> x1 + x2 + x3 <= 2
A = [w, [1, 1, 0, 0], [0, 1, 1, 1]]; b = [W, 1, 2]
r2 = linprog(-v, A_ub=A, b_ub=b, bounds=[(0, 1)] * 4, method="highs")
print("with cover cuts:", np.round(r2.x, 3), " bound", round(-r2.fun, 3))
best = max(float(v @ s) for s in np.array(np.meshgrid(*[[0, 1]] * 4)).T.reshape(-1, 4) if w @ s <= W)
print("integer optimum:", best)
LP: [0.  1.  0.2 1. ]  bound 22.0
with cover cuts: [0.167 0.833 0.167 1.   ]  bound 21.833
integer optimum: 21.0

The cuts tighten the bound toward the integer optimum, which means far fewer branch-and-bound nodes.

Families of cuts in solvers

Cut family Derived from
Gomory mixed-integer simplex tableau rows
cover, lifted cover knapsack rows
flow cover fixed-charge network structure
clique conflicts between binaries
MIR (mixed-integer rounding) aggregated rows
problem-specific (subtour elimination for TSP) the model's combinatorics, added lazily

In software

  • Solvers generate these cuts automatically; parameters such as Gurobi's Cuts or SCIP's separator settings control how aggressively.
  • Lazy constraints let you add problem-specific cuts on demand, as in TSP solvers that add a subtour-elimination constraint whenever the current solution contains a short cycle.

Exercises

Exercise 1: A Chvátal-Gomory cut

From 3x+4y≤9.53x + 4y \le 9.5 with integer x,y≥0x, y \ge 0, derive a cut by dividing by 3.

Answer

x+y≤3x + y \le 3.

Solution

Divide: x+43y≤3.16‾x + \frac{4}{3}y \le 3.1\overline{6}. Round coefficients down: x+y≤3.16‾x + y \le 3.1\overline{6} is still valid since y≥0y \ge 0, and the integer left side allows x+y≤3x + y \le 3.

Exercise 2: Find a cover

Weights (7,5,4,3)(7, 5, 4, 3), capacity 10. Give two minimal covers.

Answer

{1,2}\{1, 2\} (weight 12) and {2,3,4}\{2, 3, 4\} (weight 12), numbering items from 1.

Solution

A minimal cover exceeds 10 but every proper subset fits: 7+5=127 + 5 = 12 with 7 and 5 each fitting; 5+4+3=125 + 4 + 3 = 12 with every pair fitting. Also {1,3}\{1, 3\} (7+4=117 + 4 = 11) and {1,4}\{1, 4\} (7+3=107 + 3 = 10 is not more than 10, so not a cover).

Exercise 3: Is the cut valid? (code)

Check by enumeration that x+y≤1x + y \le 1 holds for every non-negative integer point with 2x+2y≤32x + 2y \le 3.

Answer

Yes, every feasible integer point satisfies it.

Solution
python · try it yourself
pts = [(x, y) for x in range(3) for y in range(3) if 2 * x + 2 * y <= 3]
print(pts, all(x + y <= 1 for x, y in pts))
[(0, 0), (0, 1), (1, 0)] True

Test yourself

A cutting plane must…

  1. be satisfied by all integer feasible points and violated by the current LP solution
  2. remove some integer solutions
  3. be an equality
  4. make the LP infeasible

For binary xjx_j, if items in CC weigh more than the capacity together, a valid cut is…

  1. ∑j∈Cxj≤∣C∣−1\sum_{j \in C}x_j \le \lvert C \rvert - 1
  2. ∑j∈Cxj≥1\sum_{j \in C}x_j \ge 1
  3. xj=0x_j = 0 for all j∈Cj \in C
  4. ∑jxj≤1\sum_jx_j \le 1

Branch and cut means…

  1. adding cutting planes inside branch and bound
  2. cutting the problem in half
  3. removing variables
  4. a heuristic without guarantees