Part II · trunk A · integer programming · spine

08

Cutting planes and branch-and-cut

Inequalities that every integer solution satisfies and the LP optimum doesn't: how to derive them, how to find them, and why solvers throw most of them away.

needs 07~2 h slides + 3 h lablab: uv run co lab 08

08 · overview

The route

1 · general cuts

Valid inequalities, the separation problem, Chvátal–Gomory rounding, and Gomory cuts read off a tableau. Convergence, and stalling.

2 · structural cuts

Knapsack covers, exact separation by DP, lifting. The other families: cliques, flow covers, MIR.

3 · branch-and-cut

Cut loops, efficacy, pool management, local cuts, and what the architecture buys.

getting around

Words with a dotted underline are glossary terms: click one for its definition. G lists every term in the unit, N shows the notes. Optional extra: interactive figures, linked from the slides they support by a small ▸ chip; skip them freely.

section 1

General cuts

Rounding a combination of constraints: all of integer programming's valid inequalities, eventually.

08 · general

Valid inequalities and separation

definitions

For $S$ = the integer feasible set: $a^\top x \le \beta$ is valid if every $x \in S$ satisfies it.

A cut for an LP point $x^*$ is a valid inequality with $a^\top x^* > \beta$.

The strongest valid inequalities are the facets of $\mathrm{conv}(S)$.

the separation problem

Given $x^*$ and a family of valid inequalities: find a member violated by $x^*$, or prove there is none.

The cutting-plane method:

  1. Solve the LP: $x^*$.
  2. If $x^*$ is integral, it is optimal.
  3. Separate. If a cut is found, add it and re-solve with the dual simplex (unit 03). Otherwise branch (unit 07).

On a two-variable example, three slides on, two rounds of this loop take the LP from $(1, 1.5)$ to the integer optimum $(1, 1)$.

A family whose separation problem is hard is useless in practice, however strong its members. Separation is the central question for every family.

08 · general

Chvátal–Gomory rounding

For $Ax \le b$, $x \ge 0$ integer, and any multipliers $u \ge 0$:

$$\begin{aligned} u^\top A\, x &\le u^\top b \\ \Longrightarrow\quad \lfloor u^\top A \rfloor x &\le u^\top b \quad (x \ge 0) \\ \Longrightarrow\quad \lfloor u^\top A \rfloor x &\le \lfloor u^\top b \rfloor \quad (x \text{ integer}) \end{aligned}$$

Step 1 uses $x \ge 0$ (rounding coefficients down only lowers the left side). Step 2 uses integrality: the left side is an integer.

example

$2x_1 + 2x_2 \le 3$ with $u = \tfrac12$: $x_1 + x_2 \le \tfrac32$, which rounds to $x_1 + x_2 \le 1$. The point $(\tfrac34, \tfrac34)$ is cut off, and no integer point is: $(0,0), (1,0), (0,1)$ all satisfy it.

Chvátal 1973, Schrijver 1980

Adding all CG cuts gives the CG closure. Repeating finitely many times reaches $\mathrm{conv}(S)$ for any bounded pure integer program. So every valid inequality has a finite CG derivation.

The number of rounds needed is the CG rank. It can be large: the matching polytope's odd-set inequalities have rank 1, but some inequalities for TSP have rank that grows with $n$.

08 · general

Gomory's cut, read off the tableau

A tableau row $\;x_i + \sum_{j \in N} \bar a_{ij} z_j = \bar b_i\;$ with $\bar b_i$ fractional. With the fractional part $f(v) = v - \lfloor v \rfloor$, the Gomory fractional cut is

$$\sum_{j \in N} f(\bar a_{ij})\, z_j \;\ge\; f(\bar b_i)$$

It is valid for all integer solutions, and violated by the current vertex, where every nonbasic $z_j = 0$ and so the left side is $0 < f(\bar b_i)$.

It is the CG cut with multipliers taken from row $i$ of $A_B^{-1}$, rearranged.

Worked: $\max x_2$, $3x_1 + 2x_2 \le 6$, $-3x_1 + 2x_2 \le 0$. LP optimum $(1, \tfrac32)$. Final tableau row for $x_2$:

$$x_2 + \tfrac14 s_1 + \tfrac14 s_2 = \tfrac32$$

Cut: $\tfrac14 s_1 + \tfrac14 s_2 \ge \tfrac12$. Substitute $s_1 = 6 - 3x_1 - 2x_2$ and $s_2 = 3x_1 - 2x_2$:

$$\tfrac14(6 - 4x_2) \ge \tfrac12 \iff x_2 \le 1$$

One more round adds $x_2 \le x_1$, and the LP reaches the integer optimum $(1, 1)$. Lab step 1's test is this example; the next slide draws it.

08 · general · example

Both Gomory cuts, drawn

round 0: (1, 1.5) round 1: (⅔, 1) round 2: (1, 1) x₂ ≤ 1 x₂ ≤ x₁ 12

Light: the original LP region. Dark: after both cuts. Rings: LP optima cut off; filled: the final LP optimum, integral.

roundLP optimumboundcut added
0$(1, \tfrac32)$1.5$x_2 \le 1$
1$(\tfrac23, 1)$1$x_2 \le x_1$
2$(1, 1)$1none: integral
each cut, as a CG cut

Cut 1: add the two constraints with $u = (\tfrac14, \tfrac14)$: $\;x_2 \le \tfrac32$, rounded to $x_2 \le 1$.

Cut 2: round 1's tableau row for $x_1$ gives $\tfrac23 s_2 + \tfrac23 s_3 \ge \tfrac23$, i.e. $s_2 + s_3 \ge 1$; with $s_2 = 3x_1 - 2x_2$ and $s_3 = 1 - x_2$ that is $x_2 \le x_1$.

The first cut moved the bound from 1.5 to 1; the second did not move it at all, and only changed which optimal point the LP returns. Rounds that change little are the start of stalling.

08 · general

Convergence in theory, stalling in practice

Lab then, pure Gomory on 20 random 3-variable IPs, up to 80 rounds:

seedLPIPfinalcutscoef digits
340.543535.0082
721.481919.00363
1625.822324.508013

19 of 20 reach the optimum. One stalls, and its coefficients reach 13 digits.

why solvers ration them
  • Each round cuts less deeply: the bound improvements shrink geometrically.
  • Coefficients and cut density grow: the LP gets slower and numerically worse.
  • In floating point, the cuts become invalid, since tableau entries carry rounding error.

In theory, with a careful choice of tableau row the loop always finishes (Gomory 1963). The practical fix for stalling is to stop early and branch.

section 2

Structural cuts

Families derived from one constraint's structure, where separation is cheap.

08 · structural

Knapsack cover inequalities

One knapsack constraint $\sum_j w_j x_j \le c$, with $x \in \{0,1\}^n$ and $w \ge 0$.

cover

A set $C$ with $\sum_{j \in C} w_j > c$: not all of $C$ fits, so the cover inequality

$$\sum_{j \in C} x_j \le |C| - 1.$$

It is minimal if removing any item makes it fit.

separation is a knapsack problem

$x^*$ violates the cover inequality for $C$ iff $\sum_{j \in C} (1 - x^*_j) < 1$. So find

$$\min \sum_{j \in C} (1 - x_j^*) \quad\text{s.t.}\quad \sum_{j \in C} w_j > c.$$

NP-hard in general, but pseudo-polynomial by DP over integer weights (unit 16). That is lab step 3.

Solvers usually separate heuristically, sorting by $(1-x_j^*)/w_j$, and exactly only on small constraints.

08 · structural · example

Separating a cover, on one constraint

Constraint: $5x_0 + 5x_1 + 5x_2 + 5x_3 + 8x_4 \le 12$. LP point $x^* = (1,\ 0.7,\ 0.7,\ 0,\ 0)$, weight $5 + 3.5 + 3.5 = 12$: feasible for the LP.

cover $C$weight$\sum_{C}(1 - x^*_j)$violated?
$\{0, 1, 2\}$15$0 + 0.3 + 0.3 = \mathbf{0.6}$yes
$\{0, 4\}$13$0 + 1 = 1$no (tight)
$\{1, 4\}$13$0.3 + 1 = 1.3$no
$\{0, 1, 3\}$15$0 + 0.3 + 1 = 1.3$no

Cost below 1 means violated. The cheapest cover is $\{0,1,2\}$, and indeed $x^*_0 + x^*_1 + x^*_2 = 2.4 > 2$.

why "cost below 1" is the test

The inequality $\sum_C x_j \le |C| - 1$ rewrites as $\sum_C (1 - x_j) \ge 1$. So it is violated exactly when that sum is below 1: each item "pays" how far it is from 1.

Items at $x^*_j = 1$ are free, items at 0 cost a full unit. That is why covers are built from the items the LP has nearly packed.

The reference separate_cover (a DP over weights, lab step 3) returns $(0, 1, 2)$. The next slide strengthens the resulting cut by lifting.

08 · structural

Lifting: strengthening a cut variable by variable

$5x_0 + 5x_1 + 5x_2 + 5x_3 + 8x_4 \le 12$, cover $C = \{0,1,2\}$: $\;x_0 + x_1 + x_2 \le 2$.

Lifting. Lift $x_3$ (weight 5): with $x_3 = 1$, capacity 7 remains, and at most one item of $C$ fits. So $\alpha_3 = 2 - 1 = 1$.

Lift $x_4$ (weight 8): with $x_4 = 1$, capacity 4 remains, and nothing fits. So $\alpha_4 = 2 - 0 = 2$.

$$x_0 + x_1 + x_2 + x_3 + 2x_4 \le 2$$
checked at points

$(0,0,0,0,1)$: weight 8 fits, left side $2 \le 2$, tight. $\;(1,0,0,1,0)$: weight 10, left side 2, tight. The earlier $x^* = (1, 0.7, 0.7, 0, 0)$: left side 2.4, still cut off.

Raise $x_4$'s coefficient to 3 and $(0,0,0,0,1)$ gives $3 > 2$: invalid. So 2 is the most it can take.

sequential up-lifting

For the next $j \notin C$: $\;\alpha_j = r - \max\{\sum_{\text{lifted}} \alpha_i x_i : \sum w_i x_i \le c - w_j\}$.

The largest coefficient that keeps the inequality valid, given the ones already lifted.

facets

For a minimal cover, sequential lifting yields a facet of the knapsack polytope (Balas 1975; Wolsey 1975). A different lifting order can give a different facet.

08 · structural

The families solvers actually run

familyfromseparation
Gomory mixed-integertableau rowsread off the final LP basis
mixed-integer rounding (MIR)aggregations of constraints (Marchand & Wolsey 2001)heuristic aggregation, then a rounding formula
knapsack coversingle knapsack constraintsgreedy or DP, with lifting
flow coverfixed-charge flow constraints, $x \le u y$heuristic, with lifting
clique, odd cyclethe conflict graph of binariesgreedy clique search; shortest paths for odd cycles
implied boundbounds and implicationstable lookup, e.g. $x \le u y$ recovered
zero-halfCG cuts with $u \in \{0, \tfrac12\}$a parity problem on the constraint matrix

Unit 05's weak facility-location models were rescued by implied bound cuts and flow covers, which is why presolve-plus-cuts made them look fine.

section 3

Branch-and-cut

Cuts and branching together, and the engineering that makes that work.

08 · architecture

Cut loops and cut management

At the root (the root cut loop of branch-and-cut): several rounds of solve, separate every family, select, add, and re-solve, until the bound stops moving enough.

Selection scores candidates by:

  • efficacy: the Euclidean distance the cut moves $x^*$, $(a^\top x^* - \beta)/\|a\|$. Gomory's cut 1: 0.5, cut 2: 0.24;
  • parallelism: skip cuts nearly parallel to one already chosen;
  • numerics: skip huge coefficient ranges.
the pool

Cuts that have been slack for several rounds (aging) are removed from the LP but kept in a pool, and re-added if violated again. The lab's age_pool is the core of it.

most cuts are discarded

Solvers generate far more cuts than they keep. Each kept cut is a dense constraint the LP must carry at every node of the tree, so a cut must earn its place.

08 · architecture

What your cuts were worth, and SCIP's

Lab then, 20-item knapsacks with 2 constraints. Root gap closed:

seedyour coversSCIP rootSCIP nodes: cuts off / on
09%78%45 / 34
28%46%386 / 322
327%57%88 / 66
514%45%209 / 184

SCIP with presolve off in both columns, so the difference is cuts.

reading it
  • Covers alone close a modest share. SCIP closes 2–9× more by combining families: GMI and MIR act on sums of constraints, which covers of one constraint can't see.
  • Nodes fell by 12–25% here. Cuts matter most on models whose LP is far from the hull, and these knapsacks are already fairly tight.

08 · lab

Lab 08 — what you build

about 3 hours · uv run co lab 08
  1. A Gomory cut from an exact tableau row, rewritten in the original variables.
  2. The pure Gomory loop, which converges on most instances and stalls on one.
  3. Exact cover separation by dynamic programming.
  4. Sequential lifting, valid and maximal.
  5. Pool aging and the root cut loop on multi-dimensional knapsacks.
uv run co test 08
uv run co then 08     # Gomory stall and coefficient growth · gap closed vs SCIP · nodes with cuts off/on

08 · checkpoint

Done when

checkpoint
  • All five lab steps are ✓.
  • From a fractional simplex tableau you can write down a valid Gomory cut by hand, and prove it separates the current vertex while excluding no integer point.
  • You can explain why your cover cuts close less of the gap than SCIP's, naming two cut families SCIP runs that you didn't.

Reading

Wolsey, ch. 8–9.
Conforti, Cornuéjols & Zambelli, ch. 5–7.
Cornuéjols (2008), Math. Programming B 112, the survey (optional).

Next

09 separation ⇔ optimization, for exponentially many cuts · 10 column generation, the same idea with columns · 27 modelling for a real solver.