Part II · trunk A · integer programming · branch
The structural reason assignment, transportation and flow problems need no branching, and the smallest structure that ends it.
needs 03illuminates 14, 15~1½ h slides + 2 h lab
06 · overview
TU matrices, Hoffman–Kruskal, and why Cramer's rule is the whole proof in one direction.
Interval, network and bipartite incidence matrices. Ghouila-Houri. What preserves TU.
Odd cycles, half-integrality, Edmonds' matching polytope, and the families beyond TU.
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
An algebraic condition on $A$ that makes every vertex integral.
06 · theorem
$A$ is totally unimodular (TU) if every square submatrix has determinant in $\{-1, 0, 1\}$.
In particular every entry is $-1$, $0$ or $1$.
For integral $A$: $\{x \ge 0 : Ax \le b\}$ is an integral polyhedron for every integral $b$ if and only if $A$ is TU.
A vertex is the solution of a square system $Bx = b'$. Cramer's rule writes each coordinate as an integer divided by $\det B$. TU makes that determinant $\pm 1$, so nothing fractional can appear.
full proof in the notes (N)
"Only if" is harder: from a submatrix with determinant $\pm 2$ or more, construct an integral $b$ whose polyhedron has a fractional vertex.
06 · theorem · example
Shift A covers slots 1–3, shift B slots 2–3, shift C slots 3–4. Rows are slots, columns shifts:
$$A = \begin{pmatrix}1&0&0\\1&1&0\\1&1&1\\0&0&1\end{pmatrix}$$| size | submatrices | determinants |
|---|---|---|
| 1×1 | 12 | seven 1s, five 0s |
| 2×2 | 18 | ten 1s, eight 0s |
| 3×3 | 4 | three 1s, one 0 |
All 34 in $\{-1,0,1\}$: TU. Any staffing LP over it has integral vertices.
Rows are vertices, columns the edges $01, 12, 02$:
$$T = \begin{pmatrix}1&0&1\\1&1&0\\0&1&1\end{pmatrix}$$Its nine entries and nine 2×2 minors are fine, but the whole matrix has $\det T = 2$. One bad submatrix is enough: not TU.
Costs $\begin{pmatrix}1&3\\2&5\end{pmatrix}$, no integrality asked. Its 4×4 matrix is a bipartite incidence matrix, all 69 minors in $\{-1,0,1\}$. HiGHS returns $x = \begin{pmatrix}0&1\\1&0\end{pmatrix}$, cost $3 + 2 = 5$: already an assignment.
06 · theorem
| problem | matrix | so |
|---|---|---|
| assignment, transportation | bipartite incidence | the LP relaxation is integral; the Hungarian algorithm is a primal–dual LP method (unit 15) |
| max-flow, min-cost flow | directed incidence (network) | integer capacities give an integer optimal flow (unit 14) |
| shortest path as an LP | directed incidence | the LP optimum is a path, not a fractional mix |
| interval scheduling | consecutive ones | maximum-weight independent interval sets solve as LPs |
| bipartite vertex cover | bipartite incidence (transpose) | König: max matching = min vertex cover |
In every row, the combinatorial algorithm you'd normally use is a fast special case of solving an integral LP, and the last row is a min–max theorem.
section 2
In practice you spot the structure; you don't compute determinants.
06 · recognizing
Rows are the vertices, split into two sides; each column has one 1 on each side.
Proof by Ghouila-Houri: sign left-side rows +1 and right-side rows −1. Every column sums to 0 or ±1.
Directed incidence: each column has one +1 and one −1. Tutte's network matrices generalize these (paths in a tree).
Ghouila-Houri: sign every row +1, and each column sums to 0 or ±1 over any subset.
Each row (or column) has its ones consecutive.
Ghouila-Houri: order the chosen rows by column index and alternate signs +, −, +, … Every interval then sums to 0 or ±1.
$A$ is TU if and only if every subset $R$ of rows has a signing $\sigma \in \{\pm1\}^R$ with $\sum_{r \in R} \sigma_r a_r \in \{-1, 0, 1\}^n$.
06 · recognizing · example
Rows $r_1 = (1,0,0)$, $r_2 = (1,1,0)$, $r_3 = (1,1,1)$, $r_4 = (0,0,1)$. Each column's ones are consecutive, so alternate signs down the rows:
| chosen rows | signs | sum | |
|---|---|---|---|
| all four | $+,-,+,-$ | $(1, 0, 0)$ | ✓ |
| $r_2, r_3$ | $+,-$ | $(0, 0, -1)$ | ✓ |
| $r_1, r_3, r_4$ | $+,-,+$ | $(0, -1, 0)$ | ✓ |
Every one of the 15 row subsets has a good signing: TU, the same verdict as the 34 determinants, from a test that is easy to see.
Take all three vertex rows. Each edge column has a 1 in exactly two rows, so for its sum to be 0 those two rows need opposite signs.
So adjacent vertices get opposite signs: a 2-colouring. A triangle has none. Some column sums to $\pm 2$ whatever you choose.
Try $+,-,+$: edge $02$ sums to $1 + 1 = 2$. ✗
That is the whole reason "incidence matrix TU" and "graph bipartite" are the same thing: a good signing of all rows is a 2-colouring.
06 · recognizing
Lab then, part 3, your step-1 test on interval matrices:
| size | square submatrices | seconds |
|---|---|---|
| 6×6 | 923 | 0.003 |
| 8×8 | 12 869 | 0.061 |
| 10×10 | 184 755 | 1.43 |
An $n\times n$ matrix has $\binom{2n}{n} - 1$ square submatrices, which grows like $4^n$.
You recognize the structure while modelling: "this is a flow with side constraints", "these rows are intervals". If extra side constraints break TU, expect to branch, and look for a different formulation that keeps the TU core.
section 3
One odd cycle is enough.
06 · limits
Max matching LP on a triangle: value $\tfrac32$ at the vertex $x = (\tfrac12, \tfrac12, \tfrac12)$; the best integer matching has value 1.
The incidence matrix of the triangle has determinant 2:
$$\det T = \det\begin{pmatrix}1&0&1\\1&1&0\\0&1&1\end{pmatrix} = 2$$A graph's incidence matrix is TU if and only if the graph is bipartite. The obstruction is an odd cycle: the incidence matrix of an odd cycle has determinant $\pm 2$.
Lab step 3's test checks "TU iff bipartite" on 30 random graphs, and step 5 builds the odd cycle.
06 · limits
Every vertex of the fractional matching polytope $\{x \ge 0 : \sum_{e \ni v} x_e \le 1\}$ is half-integral: entries in $\{0, \tfrac12, 1\}$, and the $\tfrac12$ entries form vertex-disjoint odd cycles.
Lab then, part 2: on 197 random non-bipartite graphs the LP vertex was fractional 42 times, and the only fractional value ever seen was 0.5. On 203 bipartite graphs it was fractional 0 times.
Add the odd-set inequalities: for every vertex set $S$ with $|S|$ odd, $\displaystyle\sum_{e \subseteq S} x_e \le \frac{|S|-1}{2}$.
The result is exactly the matching polytope: conv of matchings, integral for every graph.
There are exponentially many such inequalities, and by unit 05 no polynomial extended formulation exists (Rothvoss). The way through is separation (unit 09), or Edmonds' blossom algorithm (unit 15).
06 · limits · example
| graph | matching LP | value | + odd set $S = V$ | value |
|---|---|---|---|---|
| triangle | $(\tfrac12, \tfrac12, \tfrac12)$ | 1.5 | $(1, 0, 0)$ | 1 |
| 5-cycle | all five $= \tfrac12$ | 2.5 | $(0, 1, 0, 1, 0)$ | 2 |
Maximize the number of matched edges. The degree constraints alone allow every edge at one half. One extra constraint per cycle, "at most $\frac{|S|-1}{2}$ edges inside $S$", and the LP optimum becomes a real matching.
Triangle: $S$ = all 3 vertices. A matching inside 3 vertices has at most 1 edge, so $x_{01} + x_{12} + x_{02} \le 1$. The half point sums to $\tfrac32$: violated.
5-cycle: 5 vertices hold at most 2 disjoint edges, so the five values sum to at most 2. The half point sums to $\tfrac52$: violated.
An even cycle needs no such constraint: its all-halves point is the average of two perfect matchings, not a vertex.
06 · limits
0/1 matrices with no odd submatrix cycle. Set packing, covering and partitioning over them have integral LPs (Berge; Fulkerson, Hoffman & Oppenheim).
Clique constraints of perfect graphs: the stable-set LP with clique constraints is integral (Chvátal; Lovász's perfect graph theorem).
Total dual integrality (Edmonds & Giles 1977): the dual has integral optima for every integral $c$. Then the primal polyhedron is integral, whatever $A$ is.
The general pattern for the rest of the course: integral polyhedra are the polynomial islands. Each has a combinatorial algorithm, and a min–max theorem that is LP duality in disguise.
06 · lab
uv run co test 06
uv run co then 06 # assignment LP vs Hungarian · matching LP fractionality · TU test cost
06 · checkpoint
Wolsey, ch. 3 (§3.1–3.3), or Conforti, Cornuéjols & Zambelli, §4.1–4.3.
Schrijver, Combinatorial Optimization vol. A, ch. 5 (consulted).
07 branch and bound, for when the LP is not integral · 14 network flows and 15 matching, the algorithms this unit explains.