Professional Documents
Culture Documents
Slides20 - Max-Flow Min-Cut
Slides20 - Max-Flow Min-Cut
Correctness?
Today
1) Prove that Ford-Fulkerson algorithm finds a
maximum flow by proving the Max-Flow Min-Cut
Theorem
Fundamental result in combinatorial optimization
(best know example of duality)
Independently proven in 1956 by Ford and
Fulkerson AND by Elias, Feinstein and Claude
Shannon
2) Bipartite matching
Flows and Cuts are Intimately
Related!
10 4 15 15 10
source s 5 3 8 6 10 t sink
4 6 15 10
15
4 30 7
Cuts
capacity of cut = 9 + 15 + 8 + 30 = 62
(Capacity is sum of weights on edges leaving A.)
A B
2 9 5
10 4 15 15 10
source s 5 3 8 6 10 t sink
4 6 15 10
15
4 30 7
Flows and Cuts
Flow value lemma. Let f be any flow, and let (A, B)
be any s-t cut. Then, the net flow sent across the
cut is equal to the amount leaving s.
∑ f(e) - ∑ f(e) = v(f)
e out of A e into A
value = 24 2
9
9 5 B
A 1 0 9
0
10 10 4 15 15 10
4 6 6
source s 5 3 8 6 10 t sink
0
10 4 1 6 15 9
15 10
0
4 7
10 30
Flows and Cuts
Flow value lemma. Let f be any flow, and let (A, B)
be any s-t cut. Then, the net flow sent across the
cut is equal to the amount leaving s.
∑ f(e) - ∑ f(e) = v(f)
e out of A e into A
9
value = 24 A 2 9 5 B
1 0 9
0
10 10 4 15 15 10
4 6 6
source s 5 3 8 6 10 t sink
0
10 4 1 6 15 9
15 10
0
4 7
10 30
Flows and Cuts
Flow value lemma. Let f be any flow, and let (A, B)
be any s-t cut. Then, the net flow sent across the
cut is equal to the amount leaving s.
∑ f(e) - ∑ f(e) = v(f)
e out of A e into A
9
value = 24 2 9 5
A 1 0 9
0
10 10 4 15 15 10
4 6 6 B
source s 5 3 8 6 10 t sink
0
10 4 1 6 15 9
15 10
0
4 7
10 30
Flows and Cuts
Proof on board.
Important Corollary!
Flow value lemma. Let f be any flow, and let (A, B)
be any s-t cut. Then ∑ f(e) - ∑ f(e) = v(f).
e out of A e into A
Proof as exercise
Important Corollary!
2 9 5
A
10 4 15 15 10
source s 5 3 8 6 10 t sink
4 6 15 10
15
4 30 7
Max-Flow Min-Cut
Theorem
Theorem: Let f be a flow such that there are no s-t
paths in the residual graph Gf. Let (A, B) be the s-t
cut where A contains the nodes reachable from s in
Gf, and B = V-A. Then v(f) = C(A, B), and f is a
maximum flow and (A,B) is a minimum cut.
Proof on board
Min-Cut
How?
Finding Min Cut
0
2 4 4
G: 0 0 0
10 2 0 8 6 0 10
0 0 0
s 10 3 9 5 10 t
Flow value = 0
Finding Min Cut
3
2 4 4
G 10 7 9
10 2 0 8 6 6 10
9 9 10
s 10 3 9 5 10 t
maximum flow = 19
3
2 1 4
Gf 10 9
2 7 6 1
1
s 1 3 5 t
9 9 10
Ford-Fulkerson Wrap-Up
We’ve now shown that F-F:
(1) runs in O((m+n)OPT) time → pseudo-polynomial
(2) finds an integer-valued flow (if capacities are
integers)
(3) finds a maximum flow
3 3'
Is this the max
matching?
4 4'
L 5 5' R
Bipartite Matching
Bipartite matching.
Input: undirected, bipartite graph G = (L ∪ R, E).
M ⊆ E is a matching if each node appears in at most
1 edge in M.
Max matching: find a max cardinality matching.
1 1'
max matching
2 2'
4 4'
L 5 5' R
Bipartite Matching
Max flow formulation.
Direct all edges from L to R and assign capacity
of 1.
1
1 1'
1
2
1 2'
1
1
3 3'
1 1
4
1 4'
1
1
L 5 5' R
Bipartite Matching
Max flow formulation.
Add source s, and unit capacity edges from s to
each node in L.
1
1 1'
1
1
1 1 2 2'
1
1 1
s 3 3'
1 1 1
4
1 4'
1 1
1
L 5 5' R
Bipartite Matching
Max flow formulation.
Add sink t, and unit capacity edges from each
node in R to t.
1
1 1'
1
1 1
1 1 2 2' 1
1
1 1 1
s 3 3' t
1 1 1 1
4
1 4'
1 1 1
1
L 5 5' R
Bipartite Matching
Max flow formulation.
Solve max flow problem.
Claim: edges between L and R with flow = 1
identify max matching.
1
1 1'
1
1 1
1 1 2 2' 1
1
1 1 1
s 3 3' t
1 1 1 1
4
1 4'
1 1 1
1
L 5 5' R
Proof
Details: exercise
Next Time