19-flow2
19-flow2
Ghazaleh Parvini
Pearson Demo
12/12
v1 v2
15/20
11/16
s 1/4 t
4/9 7/7
8/13 4/4
v3 v4
11/14
12/12
v1 v2
15/20
11/16
s 1/4 t
4/9 7/7
8/13 4/4
v3 v4
11/14
Capacity Flow
A. 16+4+9+14 11+1+3+11
B. 16+4 -9+14 11+1 -4+11
C. 16+4+14 11+1 -4+11
D. 16+4+14 11+1+11
12/12
v1 v2
15/20
11/16
s 1/4 t
4/9 7/7
8/13 4/4
v3 v4
11/14
Flow Value Lemma
Lemma: let f be any flow and (A, B) be any s-t cut. Then
X X
v(f ) = f (e) − f (e)
e out of A e into A
Flow Value Lemma
Lemma: let f be any flow and (A, B) be any s-t cut. Then
X X
v(f ) = f (e) − f (e)
e out of A e into A
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Corollary: Cuts and Flows
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Proof:
Corollary: Cuts and Flows
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Proof: X X
v(f ) = f (e) − f (e)
e out of A e into A
Corollary: Cuts and Flows
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Proof: X X
v(f ) = f (e) − f (e)
e out of A e into A
X
≤ f (e)
e out of A
Corollary: Cuts and Flows
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Proof: X X
v(f ) = f (e) − f (e)
e out of A e into A
X
≤ f (e)
e out of A
X
≤ c(e)
e out of A
Corollary: Cuts and Flows
Corollary: Let f be any s-t flow and let (A, B) be any s-t cut.
Then v(f ) ≤ c(A, B).
Proof: X X
v(f ) = f (e) − f (e)
e out of A e into A
X
≤ f (e)
e out of A
X
≤ c(e)
e out of A
= c(A, B)
Duality
Illustration on board
Duality
Illustration on board
12
v1 v2
11 19
5 9 1
Gf s 1 3 7 t
1
3 4
12
v3 v4
11
F-F finds a minimum cut
Theorem: The cut (A, B) where A is the set of all nodes reachable
from s in the residual graph is a minimum-cut.
12
v1 v2
11 19
5 9 1
Gf s 1 3 7 t
1
3 4
12
v3 v4
11
12/12
v1 v2
19/20
11/16
G s 1/4
0/9 7/7
t
12/13 4/4
v3 v4
11/14
F-F finds a minimum cut
Is this polynomial?
Ford-Fulkerson Running Time
u
What is the smallest number of
augment operations with which
C C
Ford-Fulkerson can find a
maximum-flow in this graph?
s 1 t
A. 1
C C B. 2
C. 3
v D. C
Improving Running Time
u
Good path choice will find:
s → u → t, flow C
C C
s → v → t, flow C
s 1 t
C C
v
Improving Running Time
u
Good path choice will find:
s → u → t, flow C
C C
s → v → t, flow C
s 1 t Worst-case: keep incrementing by 1:
s → u → v → t, flow 1
C C s → v → u → t, flow 1
s → u → v → t, flow 1
v ...
Improving Running Time
u
Good path choice will find:
s → u → t, flow C
C C
s → v → t, flow C
s 1 t Worst-case: keep incrementing by 1:
s → u → v → t, flow 1
C C s → v → u → t, flow 1
s → u → v → t, flow 1
v ...
u
Good path choice will find:
s → u → t, flow C
C C
s → v → t, flow C
s 1 t Worst-case: keep incrementing by 1:
s → u → v → t, flow 1
C C s → v → u → t, flow 1
s → u → v → t, flow 1
v ...
u
Good path choice will find:
s → u → t, flow C
C C
s → v → t, flow C
s 1 t Worst-case: keep incrementing by 1:
s → u → v → t, flow 1
C C s → v → u → t, flow 1
s → u → v → t, flow 1
v ...
107 102
107 102
s t
s 1 t
105 108
105 108
v
v
Gf (∆) for ∆ = 100. Def: only
original residual graph Gf
edges with residual capacity ≥ ∆
Capacity-scaling algorithm