47.04.03 · theoretical-cs / algorithms-analysis

Network Flow: Ford-Fulkerson, Augmenting Paths, and the Max-Flow Min-Cut Theorem

shipped3 tiersLean: none

Anchor (Master): CLRS 2022 Introduction to Algorithms 4e (MIT Press) §26.1-26.5; Tarjan 1983 Data Structures and Network Algorithms (SIAM) (preflow-push methods, minimum-cost flow)

Intuition Beginner

Imagine a network of pipes connecting a water source to a destination. Each pipe has a maximum capacity — it can carry only so much water per second. You want to push as much water as possible from source to destination without exceeding any pipe's limit.

This is the maximum flow problem. The answer is governed by a beautiful duality: the maximum amount you can push through the network equals the minimum capacity of any "bottleneck" cut. A cut is a partition of the network into two sides, with the source on one side and the destination on the other, and the cut's capacity is the total capacity of pipes crossing from the source side to the destination side.

The Ford-Fulkerson method finds the maximum flow by repeatedly searching for a path from source to destination that can carry more flow (an augmenting path), then pushing as much additional flow as that path allows. Each such push increases the total flow. When no augmenting path exists, the flow is maximum, and the method also identifies a minimum cut.

The max-flow min-cut theorem is one of the most widely applied results in combinatorial optimisation. It connects a maximisation problem (find the most flow) with a minimisation problem (find the smallest cut) and proves they always give the same value.

Visual Beginner

A 4-node flow network:

         10
    s ──────────→ a
    │             │
    │5            │8
    ↓             ↓
    b ──────────→ t
         7

Current flow: s→a: 8, a→t: 8, s→b: 3, b→t: 3
Residual: s→a: 2, a→s: 8, s→b: 2, b→s: 3, a→t: 0, t→a: 8, b→t: 4, t→b: 3
Cut Source side Sink side Cut capacity

The minimum cut has capacity 13, which equals the maximum flow.

Worked example Beginner

Consider the 4-node network above with source , sink , and intermediate nodes , . Capacities: , , , .

Step 1. Find an augmenting path: . Residual capacity along this path is . Push 8 units. Now , .

Step 2. Find another augmenting path: . Residual capacity is . Push 5 units. Now , .

Step 3. Search for another augmenting path. From , edge has residual 2 (capacity 10 minus flow 8), edge has residual 0. From , edge has residual 0. No augmenting path exists.

Wait — let us check if there is a path through or (if such edges exist). In this network there are no direct edges between and . So no augmenting path exists.

Step 4. Total flow = . The minimum cut is vs. with capacity . The max-flow min-cut theorem is satisfied.

Check your understanding Beginner

Formal definition Intermediate+

Definition (flow network). A flow network is a tuple where is a directed graph, is the source, is the sink (), and is the capacity function. We assume whenever (no anti-parallel edges; these can be handled by introducing a dummy vertex).

Definition (flow). A flow in is a function satisfying:

  1. Capacity constraint: For all : .
  2. Skew symmetry: For all : .
  3. Flow conservation: For all : .

The value of the flow is .

Definition (residual network). Given a flow in , the residual capacity of is . The residual network where .

Definition (cut). An s-t cut is a partition of with and . The capacity of the cut is . The flow across the cut is .

Counterexamples to common slips

  • "The maximum flow equals the capacity of every cut." No. It equals the capacity of the minimum cut. Other cuts may have larger capacity.

  • "Residual capacity is always the capacity minus the flow on the forward edge." It is. But the residual network also contains reverse edges with capacity equal to the current flow, allowing flow to be redirected.

  • "Ford-Fulkerson always terminates in polynomial time." Not with arbitrary augmenting path choices. Using DFS, the method can take exponentially many iterations on networks with irrational capacities. The Edmonds-Karp algorithm (BFS for shortest augmenting paths) guarantees time.

Key theorem with proof Intermediate+

Theorem (max-flow min-cut). In any flow network, the value of the maximum flow equals the capacity of the minimum s-t cut.

Proof. We show three equivalent statements: (1) is a maximum flow, (2) there is no augmenting path in , (3) for some cut .

(1 2): If an augmenting path existed, we could increase , contradicting maximality.

(2 3): Let be the set of vertices reachable from in , and . Since no augmenting path exists, . For any : , so , meaning . Also for : , and since , means , so , but more importantly . Therefore .

(3 1): For any flow and any cut : (each edge contributes at most its capacity). So , proving is maximum.

Bridge. The max-flow min-cut theorem is the foundational reason duality pervades combinatorial optimisation: the equality connects a maximisation and a minimisation problem, and every application of network flow reduces to finding this correspondence. This builds toward bipartite matching in 47.04.04, where the max-flow formulation of matching yields Koenig's theorem and Hall's marriage theorem as corollaries of the min-cut, and it appears again in 47.02.03 where NP-completeness reductions often encode Boolean constraints as flow networks. The central insight is that the residual network is dual to the cut structure, and putting these together gives a polynomial-time algorithm (Edmonds-Karp) that simultaneously computes the maximum flow and the minimum cut.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib has Mathlib.Combinatorics.SimpleGraph for basic graph structures but no flow network definition, no flow function with capacity and conservation constraints, and no max-flow min-cut theorem. The Ford-Fulkerson algorithm and the Edmonds-Karp implementation are absent. A Codex.Algorithms.MaxFlow module defining flow networks with a proof of the max-flow min-cut theorem would be the foundational target; this unit ships without it.

Advanced results Master

Theorem 1 (Edmonds-Karp: time). The Edmonds-Karp algorithm, which uses BFS to find shortest augmenting paths in the residual network, terminates in at most augmentations, for a total running time of [CLRS §26.2]. The proof shows that the shortest-path distance from to any vertex in the residual network is non-decreasing, and each edge can be critical (the bottleneck of an augmenting path) at most times.

Theorem 2 (integrality theorem). If all capacities in a flow network are integers, then the Ford-Fulkerson method produces a maximum flow with integer values on all edges. The maximum flow value is itself an integer [CLRS §26.2]. This is because each augmentation adds an integer amount (the minimum of integer residual capacities), so integrality is preserved throughout. The integrality theorem is the reason max-flow reduces to integer optimisation problems like bipartite matching.

Theorem 3 (push-relabel: time). The push-relabel algorithm of Goldberg and Tarjan (1988) maintains a "preflow" (which may violate conservation by allowing excess at vertices) and a "height" function with , . Operations: push sends flow from a vertex with excess to a neighbour of lower height; relabel increases a vertex's height when it cannot push. The algorithm runs in time using the gap heuristic, improving on Edmonds-Karp for dense graphs [Tarjan 1983].

Synthesis. The max-flow min-cut theorem is the foundational reason duality structures appear throughout combinatorial optimisation: the equality between maximum flow and minimum cut transforms maximisation into minimisation and vice versa, with each side providing insight into the other. The central insight is that the residual network is the dual object — it encodes the "room for improvement" in the current flow, and its structure reveals the minimum cut, and putting these together with the integrality theorem gives polynomial-time solutions to a vast family of combinatorial problems. This builds toward bipartite matching in 47.04.04 and the Hungarian algorithm, and appears again in the LP duality that underlies the ellipsoid method and interior-point methods of 44.02.01.

Full proof set Master

Proposition 1 (max-flow min-cut theorem). The value of the maximum flow equals the capacity of the minimum s-t cut.

Proof. See the Key theorem section above.

Proposition 2 (weak duality). For any flow and any s-t cut : .

Proof. by flow conservation on internal vertices of . Since and for all : .

Proposition 3 (integrality). If all capacities are integers, Ford-Fulkerson produces an integer maximum flow.

Proof. Initially (integer). Each augmentation adds units of flow. The residual capacities are differences of integers, hence integers. So is a positive integer. The augmented flow remains integer. By induction, the final flow is integer.

Connections Master

  • 40.04.01 — Graph theory provides the foundational definitions of directed graphs, paths, and cuts that flow networks are built on.

  • 47.04.01 — Amortized analysis applies to the Edmonds-Karp algorithm, where the total work across all augmenting path searches is bounded using distance-based potential arguments.

  • 47.04.04 — Bipartite matching reduces to max-flow; the max-flow min-cut theorem specialises to Koenig's theorem and Hall's marriage theorem.

Historical & philosophical context Master

The max-flow min-cut theorem was first proved by Lester Ford and Delbert Fulkerson in 1956 in their paper "Maximal Flow Through a Network" [CLRS §26.2]. Their proof introduced the augmenting path method and established the fundamental duality between flow and cut. Peter Elias, Amiel Feinstein, and Claude Shannon independently proved an equivalent result in the context of information theory in 1956, showing that the maximum rate of reliable communication through a network of noisy channels is determined by a minimum cut.

The Edmonds-Karp algorithm was published by Jack Edmonds and Richard Karp in 1972, showing that BFS-based augmenting path selection gives polynomial-time performance. Andrew Goldberg and Robert Tarjan introduced the push-relabel method in 1988, achieving the best known running time for general flow networks and opening the door to efficient parallel implementations.

Bibliography Master

@book{clrs2022,
  author    = {Cormen, T. H. and Leiserson, C. E. and Rivest, R. L. and Stein, C.},
  title     = {Introduction to Algorithms},
  edition   = {4th},
  publisher = {MIT Press},
  year      = {2022},
}
@article{ford1956maximal,
  author  = {Ford, L. R. and Fulkerson, D. R.},
  title   = {Maximal Flow Through a Network},
  journal = {Canadian Journal of Mathematics},
  volume  = {8},
  pages   = {399--404},
  year    = {1956},
}
@article{edmonds1972theoretical,
  author  = {Edmonds, Jack and Karp, Richard M.},
  title   = {Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems},
  journal = {Journal of the ACM},
  volume  = {19},
  number  = {2},
  pages   = {248--264},
  year    = {1972},
}
@article{goldberg1988new,
  author  = {Goldberg, Andrew V. and Tarjan, Robert E.},
  title   = {A New Approach to the Maximum-Flow Problem},
  journal = {Journal of the ACM},
  volume  = {35},
  number  = {4},
  pages   = {921--940},
  year    = {1988},
}