Flow networks, the max-flow min-cut theorem, the Ford--Fulkerson method, the Edmonds--Karp algorithm, Dinic's algorithm, and the reduction of bipartite matching to maximum flow.
(1)⇒(2): If an augmenting path existed, the flow value could be increased, contradicting maximality.(2)⇒(3): Let S be the set of vertices reachable from s in Gf, and set T=V∖S. Since there is no augmenting path, t∈/S, so (S,T) is an s-t cut. For every arc (u,v)∈A with u∈S and v∈T, we have cf(u,v)=0, i.e., f(u,v)=c(u,v). For every arc (v,u) with v∈T and u∈S, cf(u,v)=0, i.e., f(v,u)=0. Therefore
∣f∣=u∈S,v∈T∑f(u,v)−v∈T,u∈S∑f(v,u)=c(S,T).
(3)⇒(1): By weak duality, every flow f′ satisfies ∣f′∣≤c(S,T)=∣f∣, so f is maximum.□
4 The Ford–Fulkerson Method
The Ford–Fulkerson method starts with the zero flow and repeatedly finds an augmenting path in Gf, pushing flow along it.
Algorithm 1: Ford–Fulkerson Method
Input:
Flow network (G,c,s,t)
Output:
Maximum flow f
for all(u,v)∈A
f(u,v)←0
end for
while there exists an augmenting path P in Gf
δ←min{cf(u,v):(u,v)∈P}
// Bottleneck capacity
for all(u,v)∈P
// Update flow along P
if(u,v)∈A
f(u,v)←f(u,v)+δ
// Forward arc
else
f(v,u)←f(v,u)−δ
// Backward arc
end if
end for
end while
returnf
Remark 8.
When capacities are rational, the Ford–Fulkerson method terminates in finitely many steps and produces a maximum flow. With irrational capacities, however, non-convergent examples are known. Moreover, a poor choice of augmenting paths can lead to extremely slow convergence even with integer capacities. The Edmonds–Karp algorithm addresses this by always choosing a shortest augmenting path (via BFS).
5 The Edmonds–Karp Algorithm
Theorem 9 (Edmonds–Karp).
When augmenting paths are chosen by BFS (i.e., shortest in terms of number of arcs), the total number of augmentations is O(∣V∣⋅∣A∣), and the overall running time is O(∣V∣⋅∣A∣2).
Proof.
The key lemma is that for every vertex v, the BFS distance df(v) from s in Gf is monotonically nondecreasing across augmentations. Under this lemma, each arc that becomes a bottleneck must wait for df to increase by at least 2 before it can be a bottleneck again. Since df(v)≤∣V∣, each arc is a bottleneck at most O(∣V∣) times, giving a total of O(∣V∣⋅∣A∣) augmentations.□
6 Dinic's Algorithm
Dinic's algorithm constructs a level graph from Gf using BFS, then finds a blocking flow on the level graph. This process is repeated.
Definition 10 (Level graph).
Compute BFS distances d from s in Gf. The level graphLf retains only those arcs (u,v)∈Af with d(u)+1=d(v).
Theorem 11 (Running time of Dinic's algorithm).
Dinic's algorithm runs in O(∣V∣2⋅∣A∣) time.
Proof.
Each phase computes a blocking flow on the level graph in O(∣V∣⋅∣A∣) time. After each phase, the BFS distance from s to t strictly increases, so there are at most ∣V∣−1 phases.□
Remark 12.
On unit-capacity networks (all capacities equal to 1), Dinic's algorithm runs in O(∣A∣∣V∣) time. This is particularly important for bipartite matching (see below).
7 Reduction to Bipartite Matching
Theorem 13 (Bipartite matching via flows).
The maximum matching problem on a bipartite graph G=(X⊔Y,E) reduces to a maximum flow problem: add a source s with arcs of capacity 1 to every vertex in X, and add arcs of capacity 1 from every vertex in Y to a sink t. For each edge (x,y)∈E, add an arc x→y of capacity 1.
Proof.
By the integrality theorem, the maximum flow in a network with integer capacities can be realized as an integer flow. Each arc has capacity 1, so the flow on each arc is 0 or 1. The capacity constraints on arcs incident to s and t ensure that each vertex is used by at most one flow-carrying arc. The arcs carrying flow 1 thus form a matching, and the flow value equals the matching size.□
Remark 14.
Applying Dinic's algorithm to this network yields the Hopcroft–Karp algorithm, which runs in O(∣E∣∣V∣) time. This reduction also provides an alternative proof of Kö