Lecture 18
Max Flow II
CSE 421 Autumn 2025
1
Previously…
2
Flow network definition
3
s-t flow
4
The net flow leaving
= net flow into (due to conservation)!
The maximum flow problem
5
i.e. what’s maximum rate at which water can flow from from to ?
Graph cuts
6
Value of flow from to
Graph cuts
7
Value of flow from to
Graph cuts
8
Value of flow from to
The minimum cut problem
9
Cuts limit flows (“Weak duality”)
10
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)!
Finding the Max Flow
11
First idea: find a path that we can push flow along.
More precisely:
Finding the Max Flow
12
First idea: find a path that we can push flow along.
More precisely:
Finding the Max Flow
13
First idea: find a path that we can push flow along.
More precisely:
Finding the Max Flow
14
First idea: find a path that we can push flow along.
More precisely:
Finding the Max Flow
15
First idea: find a path that we can push flow along.
You’ll find a valid flow: each augmentation respects capacity constraints and conservation of flow.
More precisely:
But it may not be optimal.
Finding the Max Flow
16
First idea: find a path that we can push flow along.
More precisely:
optimal
Today
17
Naive greedy algorithm is suboptimal
18
Augmenting paths through residual flow
19
Augmenting paths through residual flow
20
Augmenting paths through residual flow
21
Augmenting paths through residual flow
22
Note: since the middle edges in the two graphs are in opposite directions, we subtract one from the other!
Why is overall flow larger?
Residual network definition
For and flow , define as the residual network with the same vertices, source and sink , and: for every edge ,
23
Notation
24
New greedy algorithm (Ford-Fulkerson)
Call this the bottleneck capacity of the path
Q1: Is it clear that, at every iteration, is still a valid flow?
Q2: Is it clear that, at every iteration, the value of increases?
New greedy algorithm (Ford-Fulkerson)
26
Q1: Is it clear that, at every iteration, is still a valid flow?
Lemma: remains a valid flow at every iteration.
Proof: At each iteration, we perform the update:
Recall that is a flow along a path , with a constant value of on each edge of , where was the bottleneck capacity of .
The net flow through each vertex is unchanged!
(so conservation is still satisfied)
Moreover,
So, the capacity constraint is also satisfied
New greedy algorithm (Ford-Fulkerson)
27
Q2: Is it clear that, at every iteration, the value of increases?
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 .
New greedy algorithm (Ford-Fulkerson)
Runtime
How do we find such a path?
One option is to run graph traversal: time
time
How many iterations in the while loop?
New greedy algorithm (Ford-Fulkerson)
Runtime
How many iterations in the while loop?
Suppose the capacities are integers
New greedy algorithm (Ford-Fulkerson)
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.
It’s a bit strange that the runtime is in terms of the answer, but such is life sometimes..
So, overall, runtime is
New greedy algorithm (Ford-Fulkerson)
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.
It’s a bit strange that the runtime is in terms of the answer, but such is life sometimes..
So, overall, runtime is .
New greedy algorithm (Ford-Fulkerson)
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.
It’s a bit strange that the runtime is in terms of the answer, but such is life sometimes..
So, overall, runtime is . Can simplify this to since we can ignore “isolated” vertices, and there are at most vertices that are not isolated.