Motivation
Moving as much as possible of something — freight, water, data — from an origin to a destination through connections of limited capacity is one of the basic problems of operations research. Its mathematical form, the maximum flow problem, was posed in the 1950s in work on rail networks and solved independently by Ford and Fulkerson (Maximal flow through a network, Canadian J. Math. 8 (1956)) and by Elias, Feinstein and Shannon (A note on the maximum flow through a network, IRE Trans. Inform. Theory 2 (1956)). The answer, the Max Flow–Min Cut Theorem, is a min–max duality: the largest amount that can be shipped equals the smallest total capacity whose removal disconnects the destination from the origin. It is a standard example of linear-programming duality with a combinatorial proof, and it is the source of Hall's matching theorem, Menger's theorem and Dilworth's theorem via network constructions.
This mission formalizes Chapter 13 of Keller and Trotter's Applied Combinatorics (2017 Edition), together with the two theorems of Chapter 14 that apply it, in the book's own model of a network.
Setting
A network consists of a finite vertex set V, a set of directed edges (x,y), a source S and a sink T with S=T, and a capacity c(x,y)≥0 (a real number) on each edge. The underlying directed graph is an oriented graph: for any two vertices x,y at most one of (x,y), (y,x) is an edge. Every edge at S points away from S and every edge at T points into T.
A flow is a function ϕ on the edges with 0≤ϕ(x,y)≤c(x,y), extended by ϕ(x,y)=0 on pairs that are not edges, satisfying the conservation laws
x∑ϕ(S,x)=x∑ϕ(x,T),x∑ϕ(x,y)=x∑ϕ(y,x)(y=S,T).
The value of ϕ is value(ϕ)=∑xϕ(S,x).
A cut is a partition V=L∪U with S∈L, T∈U. Its capacity is
c(L,U)=x∈L, y∈U∑c(x,y),
summed over the edges directed from L to U only.
Given a flow ϕ, an edge (x,y) is used if ϕ(x,y)>0 and has spare capacity if ϕ(x,y)<c(x,y). An augmenting path is a sequence P=(x0,…,xm) of distinct vertices from x0=S to xm=T such that each step either follows an edge (xi−1,xi) with spare capacity (a forward edge) or traverses a used edge (xi,xi−1) backwards (a backward edge). Its augmentation amount is δ=min{δ1,δ2}, where δ1 is the least spare capacity of a forward edge and δ2 the least flow on a backward edge (δ=δ1 when there is no backward edge).
For Chapter 14: in a finite simple graph with bipartition V=V1∪V2, a matching is a set of edges no two of which share an endpoint; it saturates a vertex that is an endpoint of one of its edges; and N(A) is the set of neighbors of the vertices in A.
Formalization targets
Goal: the Max Flow–Min Cut Theorem (Theorem 13.10)
For every network there is a real number v0 with
v0=max{value(ϕ):ϕ a flow}=min{c(L,U):V=L∪U a cut},
that is, v0 is attained by some flow and bounds every flow value from above, and v0 is attained by some cut and bounds every cut capacity from below.
Milestones
- Theorem 13.4. For every flow ϕ and every cut, value(ϕ)≤c(L,U).
- Proposition 13.7. If P is an augmenting path for a flow ϕ of value v and δ is its augmentation amount, the function obtained by adding δ on the forward edges of P and subtracting δ on its backward edges is a flow of value v+δ.
- Theorem 14.1. If every capacity is an integer, some maximum flow has ϕ(x,y)∈Z on every edge.
- Theorem 14.7 (Hall). In a finite bipartite graph with bipartition V1∪V2 there is a matching saturating every vertex of V1 if and only if ∣N(A)∣≥∣A∣ for every A⊆V1.
Significance
The result. Theorem 13.10 turns every maximum-flow computation into a certified one: a flow and a cut of equal value prove each other optimal, and Theorem 13.4 shows no certificate can do better. Together with the integrality theorem 14.1 it is the engine behind the combinatorial applications of Chapter 14: maximum matchings in bipartite graphs, Hall's theorem, and the computation of the width of a poset with a minimum chain partition. Beyond the book, the same duality underlies Menger's theorem, König's theorem, the analysis of image segmentation by graph cuts, and the combinatorial theory of totally unimodular linear programs.
Formalizing it. The results are classical and proved. Mathlib has no theory of network flows. The platform has a Max-Flow Min-Cut theorem in the model of Bertsimas and Tsitsiklis (a general digraph on Fin n with capacities in (0,∞], value compared in EReal), which does not cover the book's networks with zero capacities and is stated for a different encoding. This mission produces the theory in the book's model: finite oriented networks with real non-negative capacities, flows as functions on vertex pairs, cuts as vertex subsets, and the augmenting-path step that the Ford–Fulkerson labeling algorithm iterates. Hall's theorem is in Mathlib in its indexed-family form; the graph form stated here is new to the platform.
Difficulty
Theorem 13.4 is a finite-sum rearrangement. The difficulty of the goal is the existence of a maximum flow. The textbook argument runs the labeling algorithm until it halts, then reads off a cut from the labeled vertices. With real capacities this algorithm need not halt: with badly chosen augmenting paths and irrational capacities the flow values can converge to a limit strictly below the maximum, so "repeat until no augmenting path exists" does not by itself produce a maximum flow. The existence of an optimal flow is therefore not a by-product of the algorithm's description; it has to be established in its own right before the absence of augmenting paths can be turned into a cut of equal capacity. A formalization that assumes a maximum flow exists proves a strictly weaker statement. Proposition 13.7 is elementary but bookkeeping-heavy: backward edges subtract flow, and conservation must be checked at every interior vertex of the path.
Formalization scope
The vertex set is a type V with [Fintype V] [DecidableEq V]. A network (AppliedComb.Flows.Network) bundles an edge relation adj, the source S and sink T with S ≠ T, and a real capacity function cap, together with the axioms of an oriented graph, the orientation of edges at S and T, and 0 ≤ cap x y on edges. Flows are functions ϕ : V → V → ℝ satisfying IsFlow, which includes ϕ=0 off the edges and keeps the first conservation law as part of the definition, as on the page. The value is ∑xϕ(S,x). A cut is its part L : Finset V with S ∈ L, T ∉ L. Augmenting paths are injective maps Fin (m + 1) → V, and δ1,δ2,δ are computed in WithTop ℝ so that an empty minimum is ⊤ and δ=δ1 when there is no backward edge. Hall's theorem uses Mathlib's SimpleGraph with a given bipartition into two Finsets and matchings as sets of Sym2 V edges.
No explicit constants arise: the chapter has no asymptotic or approximate statements.
The book's sentence of Theorem 13.10 reads "if v0 is the maximum value of a flow and c0 the minimum capacity of a cut, then v0=c0". A formalization that takes v0 and c0 as hypothetical extrema of possibly empty or unattained sets would be trivial or vacuous; the goal here asserts the existence of a maximum flow and a minimum cut at the same number, and the existence of a maximum flow for real capacities is part of what must be proved.
Needed infrastructure: finite-sum manipulation over Finset (reindexing, splitting over L and Lᶜ), existence of maximizers of a linear function over the set of flows, and, for Theorem 14.1, control of integrality. The definitions of networks, flows, cuts and augmenting paths are reusable for Menger's theorem, König's theorem and the chain-partition network of Section 14.3. Contributions of alternative proofs (via linear-programming duality) are welcome.
Selected references
- M. T. Keller and W. T. Trotter, Applied Combinatorics, 2017 Edition, Chapters 13–14. https://www.appliedcombinatorics.org/book/
- L. R. Ford and D. R. Fulkerson, Maximal flow through a network, Canadian Journal of Mathematics 8 (1956), 399–404. https://doi.org/10.4153/CJM-1956-045-5
- P. Elias, A. Feinstein and C. E. Shannon, A note on the maximum flow through a network, IRE Transactions on Information Theory 2 (1956), 117–119. https://doi.org/10.1109/TIT.1956.1056816
- P. Hall, On representatives of subsets, Journal of the London Mathematical Society 10 (1935), 26–30. https://doi.org/10.1112/jlms/s1-10.37.26
- U. Zwick, The smallest networks on which the Ford–Fulkerson maximum flow procedure may fail to terminate, Theoretical Computer Science 148 (1995), 165–170. https://doi.org/10.1016/0304-3975(95)00022-O