Definition · Totally unimodularA matrix A is totally unimodular when every square submatrix of A — of every size, formed by choosing any rows and any equally many columns — has determinant 0, +1 or −1.
Every entry of such a matrix is itself a one-by-one submatrix, so every entry is 0, +1 or −1. The converse fails, and the failure is the interesting part of this lesson.
Theorem · Integrality of network cornersLet A be totally unimodular and b an integer vector. Then every basic feasible solution of Ax = b, x ≥ 0 is an integer vector.
The node-arc incidence matrix N of any directed network is totally unimodular. Hence every corner of the minimum-cost flow programme is whole, on whole supplies and whole capacities, with no integrality constraint written anywhere.
A basic solution takes a square non-singular submatrix B of the columns and sets x_B = B⁻¹b, with every other variable zero. By Cramer's rule the k-th component of x_B is det(Bₖ) / det(B), where Bₖ is B with its k-th column replaced by b.
B is a square submatrix of a totally unimodular matrix and is non-singular, so det(B) is +1 or −1. Bₖ has integer entries throughout — the columns of B are integer and b is integer — so det(Bₖ) is an integer. An integer divided by ±1 is an integer, and every component of x_B is therefore whole. The non-basic components are zero.
Nothing in this depends on the objective, so it holds at the optimum in particular; and since a bounded linear programme attains its optimum at a corner, the optimum is an integer point.
□
That the incidence matrix satisfies the condition is checkable rather than memorable, and the lab checks it. On the five-arc network from the minimum-cost flow lesson, N is four by five and the sweep runs every submatrix of size one, two and three — 20, then 60, then 40, which is 120 in all — and reports every determinant in {0, ±1}.
N for s>a s>b a>b a>t b>t
s 1 1 0 0 0
a -1 0 1 1 0
b 0 -1 -1 0 1
t 0 0 0 -1 -1
rows 1,2,3 and columns 1,3,4 det 1
rows 1,2 and columns 1,2 det 1
rows 1,2,3 and columns 1,2,3 det 0
the whole matrix is singular: every column holds one +1 and one -1,
so the four rows sum to the zero row
sweep to size 3: 20 + 60 + 40 = 120 submatrices, 0 failures
The same drawing, undirected, and the corner that is halves
Now take the triangle on three vertices and build the undirected incidence matrix instead: +1 at both ends of each edge rather than +1 and −1. Nothing about the picture has changed. The matrix is three by three, and its determinant is 2.
undirected incidence of the triangle directed, same drawing
1 0 1 1 0 -1
1 1 0 -1 1 0
0 1 1 0 -1 1
det = 2 sweep: unimodular
exactly one submatrix out of 19 fails, and it is the whole matrix
max x1 + x2 + x3 subject to that matrix times x ≤ 1, x ≥ 0
corner x = (1/2, 1/2, 1/2) value 3/2
no integer point reaches 3/2; the best whole answer is 1
Example · The halves are real, and exactThe lab runs the same exact simplex on the same kind of programme and returns 1/2 three times, printed as a fraction. There is no rounding anywhere and nothing has gone wrong: (1/2, 1/2, 1/2) is a genuine corner of that polyhedron, and it is strictly better than any lattice point inside it.
This is the gap that the whole of Integer Programming is about, arriving here as a two-line consequence of one determinant. It is also the reason this course can be solved by the simplex method and that one cannot.
Example · An even cycle keeps its whole cornersDo the same on the four-cycle. The undirected incidence matrix has determinant 0, the sweep finds nothing outside {0, ±1}, and the packing programme's corner is (1, 0, 1, 0) worth 2 — whole.
So it is not undirectedness as such that breaks integrality; it is the odd cycle. An even cycle is bipartite, and bipartite graphs are where the undirected incidence matrix stays totally unimodular. That observation is what makes the assignment problem behave, and it comes back on the matching lesson.
Two warnings about the direction of the theorem. It says total unimodularity is sufficient for integer corners, not necessary: plenty of programmes have integral polyhedra for other reasons. And it says nothing whatever about a programme whose matrix is not totally unimodular — such a programme may still happen to have a whole optimum on some instance, and that is luck rather than structure.