Lecture 19
Max Flow III
CSE 421 Autumn 2025
1
Previously…
2
The maximum flow problem
Input: a flow network
Output: a s-t flow of maximum value
3
i.e. what’s maximum rate at which water can flow from from to ?
The minimum cut problem
Input: a flow network
Output: a s-t cut of minimum capacity
4
Cuts limit flows (“Weak duality”)
5
Lemma: Let be any - flow, and let be any - cut. Then,
.
Goal: show that cuts are the only thing that limit flows, i.e. that the there is a flow that achieves the minimum capacity cut�(this would prove the Max Flow-Min Cut theorem)
Our strategy to prove this: let’s think about how to find the max flow (and hope to discover useful structural properties)!
Augmenting paths through residual flow
6
Augmenting paths through residual flow
7
Augmenting paths through residual flow
8
Augmenting paths through residual flow
9
Note: since the middle edges in the two graphs are in opposite directions, we subtract one from the other!
Residual network definition
For and flow , define as the residual network with the same vertices, source and sink , and: for every edge ,
10
Ford-Fulkerson algorithm
Call this the bottleneck capacity of the path
Ford-Fulkerson algorithm
12
Lemma: The value of increases at every iteration.
Proof: At each iteration, we perform the update:
Could decrease the flow on some edges
Since the value of a flow is, by definition, , we have shown that the value of increases.
Notice that, in the augmenting path , the edge containing must be a forward edge (so it contributes positively to , the flow out of ).
Why?
Because, in the original graph, only has outgoing edges, so backward edges of any residual graph must be of the form , and so they are not on a path .
Ford-Fulkerson algorithm
Runtime
Run any graph traversal to find such a path: time
time
How many iterations in the while loop?
Ford-Fulkerson algorithm
Runtime
How many iterations in the while loop?
So, there are at most iterations, where is the Max Flow.
Suppose the capacities are integers, then each iteration increases the value at least by 1.
So, overall, runtime is . Can simplify this to since we can ignore “isolated” vertices, and there are at most vertices that are not isolated.
Today
15
Ford-Fulkerson animation
16
Ford-Fulkerson animation
17
Ford-Fulkerson animation
18
Ford-Fulkerson animation
19
Ford-Fulkerson animation
20
Ford-Fulkerson animation
21
Ford-Fulkerson animation
22
Ford-Fulkerson animation
23
Ford-Fulkerson animation
24
Ford-Fulkerson animation
25
Ford-Fulkerson animation
26
Ford-Fulkerson animation
27
Ford-Fulkerson animation
28
Ford-Fulkerson animation
29
“Weak duality”: the value of a flow can never exceed any cut’s capacity.
Ford-Fulkerson always finds a max flow
30
Have we already proven that Ford-Fulkerson finds the Max Flow?
No.
We have only shown that the flow always increases as long as we are still in the while loop.
Since the Max Flow is finite, this shows that the algorithm terminates.
But it could in principle terminate before it finds the Max Flow.
Ford-Fulkerson always finds a max flow
Theorem: When capacities are positive integers, Ford-Fulkerson outputs a max-flow.
Observation: Ford-Fulkerson only terminates if there is no path in the residual graph .
Therefore, it suffices to show that a flow is maximal when there is no path in the residual graph .
31
Ford-Fulkerson always finds a max flow
32
We will prove that:
No path in .
There exists a s-t cut such that .
This implies would imply is maximal.
Why?
By weak duality, for all . So, if , then is maximal.
Ford-Fulkerson always finds a max flow
Proof:
33
No path in .
There exists a s-t cut such that .
Ford-Fulkerson always finds a max flow
Proof:
34
No path in .
There exists a s-t cut such that .
Ford-Fulkerson always finds a max flow
Proof:
35
No path in .
There exists a s-t cut such that .
Ford-Fulkerson always finds a max flow
Proof:
36
No path in .
There exists a s-t cut such that .
Ford-Fulkerson always finds a max flow
Proof:
37
No path in .
There exists a s-t cut such that .
So is maximal! (by Weak Duality, as argued earlier)
Recall:
Back to the max flow-min cut theorem..
38
Theorem: The value of the maximum flow from to is equal to the value of the minimum capacity - cut (i.e. minimum capacity cut separating and ).
Have we proved it?
What we had earlier:
Step 1. (“weak duality”) The capacity of any - cut is an upper bound on the maximum flow (in particular, the minimum - cut is an upper bound on the maximum flow).
Our proof of correctness of Ford-Fulkerson says something powerful: �not only Ford-Fulkerson finds the Max-Flow, but the output of Ford-Fulkerson achieves the capacity of some cut! (in fact, of the minimum capacity cut, by weak duality).
So we are done!
Another instance of proving a theorem by considering an algorithm!
Ford-Fulkerson: summary
39