Part II · trunk A · integer programming · spine
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
Valid inequalities, the separation problem, Chvátal–Gomory rounding, and Gomory cuts read off a tableau. Convergence, and stalling.
Knapsack covers, exact separation by DP, lifting. The other families: cliques, flow covers, MIR.
Cut loops, efficacy, pool management, local cuts, and what the architecture buys.
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
Rounding a combination of constraints: all of integer programming's valid inequalities, eventually.
08 · general
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)$.
Given $x^*$ and a family of valid inequalities: find a member violated by $x^*$, or prove there is none.
The cutting-plane method:
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
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.
$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.
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
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
Light: the original LP region. Dark: after both cuts. Rings: LP optima cut off; filled: the final LP optimum, integral.
| round | LP optimum | bound | cut added |
|---|---|---|---|
| 0 | $(1, \tfrac32)$ | 1.5 | $x_2 \le 1$ |
| 1 | $(\tfrac23, 1)$ | 1 | $x_2 \le x_1$ |
| 2 | $(1, 1)$ | 1 | none: integral |
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
Lab then, pure Gomory on 20 random 3-variable IPs, up to 80 rounds:
| seed | LP | IP | final | cuts | coef digits |
|---|---|---|---|---|---|
| 3 | 40.54 | 35 | 35.00 | 8 | 2 |
| 7 | 21.48 | 19 | 19.00 | 36 | 3 |
| 16 | 25.82 | 23 | 24.50 | 80 | 13 |
19 of 20 reach the optimum. One stalls, and its coefficients reach 13 digits.
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
Families derived from one constraint's structure, where separation is cheap.
08 · structural
One knapsack constraint $\sum_j w_j x_j \le c$, with $x \in \{0,1\}^n$ and $w \ge 0$.
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.
$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
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$.
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
$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$$$(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.
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.
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
| family | from | separation |
|---|---|---|
| Gomory mixed-integer | tableau rows | read off the final LP basis |
| mixed-integer rounding (MIR) | aggregations of constraints (Marchand & Wolsey 2001) | heuristic aggregation, then a rounding formula |
| knapsack cover | single knapsack constraints | greedy or DP, with lifting |
| flow cover | fixed-charge flow constraints, $x \le u y$ | heuristic, with lifting |
| clique, odd cycle | the conflict graph of binaries | greedy clique search; shortest paths for odd cycles |
| implied bound | bounds and implications | table lookup, e.g. $x \le u y$ recovered |
| zero-half | CG 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
Cuts and branching together, and the engineering that makes that work.
08 · architecture
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:
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.
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
Lab then, 20-item knapsacks with 2 constraints. Root gap closed:
| seed | your covers | SCIP root | SCIP nodes: cuts off / on |
|---|---|---|---|
| 0 | 9% | 78% | 45 / 34 |
| 2 | 8% | 46% | 386 / 322 |
| 3 | 27% | 57% | 88 / 66 |
| 5 | 14% | 45% | 209 / 184 |
SCIP with presolve off in both columns, so the difference is cuts.
08 · lab
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
Wolsey, ch. 8–9.
Conforti, Cornuéjols & Zambelli, ch. 5–7.
Cornuéjols (2008), Math. Programming B 112, the survey (optional).
09 separation ⇔ optimization, for exponentially many cuts · 10 column generation, the same idea with columns · 27 modelling for a real solver.