0% found this document useful (0 votes)
31 views159 pages

Lecture 21 - Flowcut

The document illustrates the Ford-Fulkerson method for solving the maximum flow problem in flow networks, including examples of residual graphs and the conversion of multiple-source, multiple-sink problems into single-source, single-sink problems. It discusses the maximum flow-minimum cut theorem and provides visual representations of flow networks and their residual capacities. Additionally, it highlights the historical context and significance of the maximum flow problem in operations research.

Uploaded by

sifatts2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views159 pages

Lecture 21 - Flowcut

The document illustrates the Ford-Fulkerson method for solving the maximum flow problem in flow networks, including examples of residual graphs and the conversion of multiple-source, multiple-sink problems into single-source, single-sink problems. It discusses the maximum flow-minimum cut theorem and provides visual representations of flow networks and their residual capacities. Additionally, it highlights the historical context and significance of the maximum flow problem in operations research.

Uploaded by

sifatts2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 159

Illustration of the Ford-Fulkerson Method

Graph G = (V , E, c):
3/4
2 4 |f | = 18
2/4
/ 10 7/
8


8/ 10
10 0/2 8/ 6/6

⇠10
8

9/
⇠ ⇠
8/10 8/9 10/10
s 3 5 t
9/10 9/9

Residual Graph Gf = (V , Ef , cf ):
2
2 2 4

8
10

8
2 6 2
8 8
10
s 2 3 1 5 t

6.6: Maximum flow


6.6: Maximum flow T.S. 9

Frank Stajano Thomas Sauerwald

Lent 2015
Outline

Recap

Max-Flow Min-Cut Theorem

Analysis of Ford-Fulkerson

6.6: Maximum flow T.S. 2


History of the Maximum Flow Problem [Harris, Ross (1955)]

za
SECRET

3
a)
Maximum Flow is 163,000 tons per day!

On,
LL,,
cCfl

(a
_Z

oS

70

21
Z

0!
E
w 0>a

0
a_
R

-C
=
Of
~0a
a cc

'ma

In

-05
0

0
7-

4'

6.6: Maximum flow T.S. 3


Multiple Sources and Multiple Sinks (Figure 26.1)
26.1 Flow networks 713

s1 s1

10 10

12 12
3 3


s2 t1 s2 t1
15 15
5 5



8 8
6 ∞ 6 ∞
s3 t2 s s3 t2 t
20 20
14 14

7 7


13 13
s4 t3 s4 t3
18 18


11 11

2 2
s5 s5
(a) (b)

Figure 26.3 Converting a multiple-source, multiple-sink maximum-flow problem into a problem


with a single source and a single sink. (a) A flow network with five sources S D fs1 ; s2 ; s3 ; s4 ; s5 g
and three sinks T D ft1 ; t2 ; t3 g. (b) An equivalent single-source, single-sink flow network. We add
a supersource s and an edge with infinite capacity from s to each of the multiple sources. We also
add a supersink t and an edge with infinite capacity from each of the multiple sinks to t.

26.1-2
Extend the flow properties and definitions to theT.S.
6.6: Maximum flow
multiple-source, multiple-sink
4
problem. Show that any flow in a multiple-source, multiple-sink flow network
Multiple Sources and Multiple Sinks (Figure 26.1)
26.1 Flow networks 713

s1 s1

10 10

12 12
3 3


s2 t1 s2 t1
15 15
5 5



8 8
6 ∞ 6 ∞
s3 t2 s s3 t2 t
20 20
14 14

7 7


13 13
s4 t3 s4 t3
18 18


11 11

2 2
s5 s5
(a) (b)

Figure 26.3 Converting a multiple-source, multiple-sink maximum-flow problem into a problem


with a single source and a single sink. (a) A flow network with five sources S D fs1 ; s2 ; s3 ; s4 ; s5 g
and three sinks T D ft1 ; t2 ; t3 g. (b) An equivalent single-source, single-sink flow network. We add
a supersource s and an edge with infinite capacity from s to each of the multiple sources. We also
add a supersink t and an edge with infinite capacity from each of the multiple sinks to t.

26.1-2
Extend the flow properties and definitions to theT.S.
6.6: Maximum flow
multiple-source, multiple-sink
4
problem. Show that any flow in a multiple-source, multiple-sink flow network
Residual Graph

Original Edge
Edge e = (u, v ) ∈ E
Graph G:
flow f (u, v ) and capacity c(u, v )
6/17
u v
Residual Capacity

c(u, v ) − f (u, v )
 if (u, v ) ∈ E ,
cf (u, v ) = f (v , u) if (v , u) ∈ E ,
0 otherwise.

Residual Gf :
11
Residual Graph
u v
Gf = (V , Ef , cf ), Ef := {(u, v ) : cf (u, v ) > 0} 6

6.6: Maximum flow T.S. 5


Residual Graph with anti-parallel edges

Original Edge
Graph G:
Edge e = (u, v ) ∈ E (& possibly e0 = (v , u) ∈ E)
flow f (u, v ) and capacity c(u, v )
6/17
u v
Residual Capacity 2/4

For every pair (u, v ) ∈ V × V ,

cf (u, v ) = c(u, v ) − f (u, v ).

Residual Gf :
Residual Graph
13
Gf = (V , Ef , cf ), Ef := {(u, v ) : cf (u, v ) > 0}
u v
8

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
5/1 2 4
0
s 4/1 1/6 3/4
Flow network G 5/8 3
3/7 t
4/7

3
1/
2/3
5
13
1
11 2 4
1
11 5 1
s 3
Residual Graph Gf 7 3 4
3 t
8
2
1
2 5
1

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
5/1 2 4
0
s 4/1 1/6 3/4
Flow network G 5/8 3
3/7 t
4/7

3
1/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
5/1 2 4
0
s 4/1 1/6 2/3
Flow network G 5/8 3
2/6 t
4/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
5/1 2 4
0
s 4/1 1/6 2/3
Flow network G 5/8 3
2/6 t
4/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
5/1 2 4
0
4/1 1/6 2/3
s
Flow network G 5/8 3
2/6 t
4/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
1/1 2 4
0
0/1 1/6 2/3
s
Flow network G 5/8 3
2/6 t
4/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 5/8 3
2/6 t
4/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 5/8 3
4/7 2/6 t

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 1/8 3
0/7 2/6 t

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 1/8 3
2/6 t
0/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)
1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 1/8 3
2/6 t
0/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)
1/14
2
1/1 2 4
0
s 0/1 1/6 2/3
Flow network G 1/8 3
2/6 t
0/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)
0/14
2
0/1 2 4
0
s 0/1 0/6 2/3
Flow network G 0/8 3
2/6 t
0/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

0/14
2
0/1 2 4
0
s 0/1 0/6 2/3
Flow network G 0/8 3
2/6 t
0/7

2
0/
2/3
5

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

0/14
2
0/1 2 4
0
s 0/1 0/6 2/3
Flow network G 0/8 3
2/6 t
0/7

2
0/
2/3
5

By successively eliminating cycles we can sim-


plify and reduce the “transportation” cost of a flow.

6.6: Maximum flow T.S. 5


Example of a Residual Graph (Handout)

0/14
2
0/1 2 4
0
s 0/1 0/6 2/3
Flow network G 0/8 3
2/6 t
0/7

2
0/
2/3
5

Comment on anti-parallel edges:


You should know about this possibility
In the following proofs we will disallow anti-parallel edges
(for convenience)

6.6: Maximum flow T.S. 5


The Ford-Fulkerson Method (“Enhanced Greedy”)

0: def fordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

Augmenting path: Path


from source to sink in Gf

Questions:
How to find an augmenting path? X
Does this method terminate?
If it terminates, how good is the solution?

6.6: Maximum flow T.S. 6


Outline

Recap

Max-Flow Min-Cut Theorem

Analysis of Ford-Fulkerson

6.6: Maximum flow T.S. 10


From Flows to Cuts
Cut
A cut (S, T ) is a partition of V into S and T = V \ S such that s ∈ S
and t ∈ T .

Graph G = (V , E, c):
4
2 4

10
10

2 6

10 9 10
s 3 5 t

6.6: Maximum flow T.S. 11


From Flows to Cuts
Cut
A cut (S, T ) is a partition of V into S and T = V \ S such that s ∈ S
and t ∈ T .

Graph G = (V , E, c):
4
2 4

10
10

2 6

10 9 10
s 3 5 t

6.6: Maximum flow T.S. 11


From Flows to Cuts
Cut
A cut (S, T ) is a partition of V into S and T = V \ S such that s ∈ S
and t ∈ T .
The capacity of a cut (S, T ) is the sum of capacities of the edges
from S to T :
X X
c(S, T ) = c(u, v ) = c(u, v )
u∈S,v ∈T (u,v )∈E(S,T )

Graph G = (V , E, c):
4
2 4

10
10

2 6

10 9 10
s 3 5 t

c({s, 3}, {2, 4, 5, t}) =


6.6: Maximum flow T.S. 11
From Flows to Cuts
Cut
A cut (S, T ) is a partition of V into S and T = V \ S such that s ∈ S
and t ∈ T .
The capacity of a cut (S, T ) is the sum of capacities of the edges
from S to T :
X X
c(S, T ) = c(u, v ) = c(u, v )
u∈S,v ∈T (u,v )∈E(S,T )

Graph G = (V , E, c):
4
2 4

10
10

2 6

10 9 10
s 3 5 t

c({s, 3}, {2, 4, 5, t}) = 10 + 9 = 19


6.6: Maximum flow T.S. 11
From Flows to Cuts
Cut
A cut (S, T ) is a partition of V into S and T = V \ S such that s ∈ S
and t ∈ T .
The capacity of a cut (S, T ) is the sum of capacities of the edges
from S to T :
X X
c(S, T ) = c(u, v ) = c(u, v )
u∈S,v ∈T (u,v )∈E(S,T )

A mininum cut of a network is a cut whose capacity is minimum over


all cuts of the network.

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

10 − 2 + 8 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 11


From Flows to Cuts
Flow Value Lemma (Lemma 26.4)
Let f be a flow with source s and sink t, and let (S, T ) be any cut of G.
Then the value of the flow is equal to the net flow across the cut, i.e.,
X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts

X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts

X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

|f | =

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts

X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

X
|f | = f (s, w)
w∈V

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts

X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

X X X X 
|f | = f (s, w) = f (u, w) − f (w, u)
w∈V u∈S (u,w)∈E (w,u)∈E

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
From Flows to Cuts

X X
|f | = f (u, v ) − f (v , u).
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

X X X X 
|f | = f (s, w) = f (u, w) − f (w, u)
w∈V u∈S (u,w)∈E (w,u)∈E
X X
= f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

Graph G = (V , E, c): |f | = 16
0/4
2 4
8/
0

6/
/1

2/2 6/6

10
10

s 3 5 t
6/10 8/9 10/10

8 + 8 − 6 + 6 = 16
6.6: Maximum flow T.S. 11
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut.

6.6: Maximum flow T.S. 12


Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

6.6: Maximum flow T.S. 12


Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

0/4
2 4
0

6/
8/
/1

2/2 6/6
10
8
10

s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

|f | =

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)
X
≤ f (u, v )
(u,v )∈E(S,T )

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)
X
≤ f (u, v )
(u,v )∈E(S,T )
X
≤ c(u, v )
(u,v )∈E(S,T )

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Weak Duality betwen Flows and Cuts
Weak Duality (Corollary 26.5)
Let f be any flow and (S, T ) be any cut. Then the value of f is bounded
from above by the capacity of the cut (S, T ), i.e.,

|f | ≤ c(S, T ).

X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)
X
≤ f (u, v )
(u,v )∈E(S,T )
X
≤ c(u, v ) = c(S, T ).
(u,v )∈E(S,T )

0/4 4
2 4 2 4
0

6/
8/
/1

10

10
2/2 6/6 2 6

8
10
8
10

10 9 10
s 3 5 t s 3 5 t
6/10 8/9 10/10
|f | = 10 − 2 + 8 = 16 c(S, T )=10+9=19
6.6: Maximum flow T.S. 12
Max-Flow Min-Cut Theorem

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

6.6: Maximum flow T.S. 13


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 3 ⇒ 1:

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 3 ⇒ 1:
Suppose that (S, T ) is a cut with c(S, T ) = |f |

3/4 4
G 2 4 Gf 2 4
10 10
0/
9/
7/

10
0/2 6/6 2 6

8
10

1
8

10 9 10
s 3 5 t s 3 5 t
9/10 9/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 3 ⇒ 1:
Suppose that (S, T ) is a cut with c(S, T ) = |f |
By Corollary 26.5, for any flow ef ,

3/4 4
G 2 4 Gf 2 4
10 10
0/
9/
7/

10
0/2 6/6 2 6

8
10

1
8

10 9 10
s 3 5 t s 3 5 t
9/10 9/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 3 ⇒ 1:
Suppose that (S, T ) is a cut with c(S, T ) = |f |
By Corollary 26.5, for any flow ef , |ef | ≤ c(S, T ) = |f |.

3/4 4
G 2 4 Gf 2 4
10 10
0/
9/
7/

10
0/2 6/6 2 6

8
10

1
8

10 9 10
s 3 5 t s 3 5 t
9/10 9/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 3 ⇒ 1:
Suppose that (S, T ) is a cut with c(S, T ) = |f |
By Corollary 26.5, for any flow ef , |ef | ≤ c(S, T ) = |f |.
Hence f is a maximum flow.

3/4 4
G 2 4 Gf 2 4
10 10
0/
9/
7/

10
0/2 6/6 2 6

8
10

1
8

10 9 10
s 3 5 t s 3 5 t
9/10 9/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 1 ⇒ 2:

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 1 ⇒ 2:
For the sake of contradicion, suppose there is an augmenting path with
respect to f .

0/4 4
G 2 4 Gf 2 4
10
0/ 4
6/

6
8/

10
2/2 6/6 2 6

8
10

1
8

6 8
10
s 3 5 t s 4 3 1 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 1 ⇒ 2:
For the sake of contradicion, suppose there is an augmenting path with
respect to f .
Then we can improve f by increasing the flow along this path.

0/4 4
G 2 4 Gf 2 4
10
0/ 4
6/

6
8/

10
2/2 6/6 2 6

8
10

1
8

6 8
10
s 3 5 t s 4 3 1 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 1 ⇒ 2:
For the sake of contradicion, suppose there is an augmenting path with
respect to f .
Then we can improve f by increasing the flow along this path.
Hence f cannot be a maximum flow.

0/4 4
G 2 4 Gf 2 4
10
0/ 4
6/

6
8/

10
2/2 6/6 2 6

8
10

1
8

6 8
10
s 3 5 t s 4 3 1 5 t
6/10 8/9 10/10

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.

3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S

3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.

3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T )

3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).

3
3/4
G 2 4 Gf 2 1 4

/1
0 7/
8
2 1 6 1
9/

9
10 /10 0/2
10

 6/6
10

9 9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).

3
3/4
G 2 4 Gf 2 1 4

/1
0 7/
8
2 1 6 1
9/

9
10 /10 0/2
10

 6/6
10

9 9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).

3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S)
3
3/4
G 2 4 Gf 2 1 4
10 7/
0/ 8
2 1 6 1
9/

9
10
0/2 6/6
10

1
9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.
3
3/4
G 2 4 Gf 2 1 4
0 7
0/
1
 /8 2 1 6 1
9/

9
1 1/2 
10
0/2 6/6
10

9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.
3
3/4
G 2 4 Gf 2 1 4
0 7
0/
1
 /8 2 1 6 1
9/

9
1 1/2 
10
0/2 6/6
10

9
9 10
s 3 5 t s 1 3 5 t
9/10 9/9 10/10
6.6: Maximum flow T.S. 14
Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.

|f | =

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.
X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.
X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)
X
= c(u, v )
(u,v )∈E(S,T )

6.6: Maximum flow T.S. 14


Key Lemma

Key Lemma (Theorem 26.6)


The following three conditions are all equivalent for any flow f :
1. f is a maximum flow
2. There is no augmenting path in Gf
3. There exists a cut (S, T ) such that c(S, T ) = |f |

Proof 2 ⇒ 3:
Let f be a flow with no augmenting paths.
Let S be the nodes reachable from s in Gf , T := V \ S ⇒ s ∈ S, t 6∈ S.
(u, v ) ∈ E(S, T ) ⇒ f (u, v ) = c(u, v ).
(v , u) ∈ E(T , S) ⇒ f (v , u) = 0.
X X
|f | = f (u, v ) − f (v , u)
(u,v )∈E(S,T ) (v ,u)∈E(T ,S)
X
= c(u, v ) = c(S, T )
(u,v )∈E(S,T )

6.6: Maximum flow T.S. 14


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≤”:

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≤”:
For any flow f and cut (S, T ), |f | ≤ c(S, T ) (Corollary 26.5)

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≤”:
For any flow f and cut (S, T ), |f | ≤ c(S, T ) (Corollary 26.5)

max |f | ≤ min c(S, T )
f S,T ⊆V

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≥”:
Let fmax be a maximum flow

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≥”:
Let fmax be a maximum flow
Key Lemma ⇒ there is a cut (S, T ) with c(S, T ) = |fmax |.

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is

max |f | = min c(S, T ).


f S,T ⊆V

Proof of “≥”:
Let fmax be a maximum flow
Key Lemma ⇒ there is a cut (S, T ) with c(S, T ) = |fmax |.

max |f | = |fmax | = c(S, T ) ≥ min c(S, T )
f S,T ⊆V

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Max-Flow Min-Cut Theorem algorithm for computing min-cut:

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Max-Flow Min-Cut Theorem algorithm for computing min-cut:


Run Ford-Fulkerson until it terminates with a flow fmax

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Max-Flow Min-Cut Theorem algorithm for computing min-cut:


Run Ford-Fulkerson until it terminates with a flow fmax
Define S as the set of nodes reachable from s in Gf , and T = V \ S

6.6: Maximum flow T.S. 15


Proof of the Max-Flow Min-Cut Theorem
Key Lemma
The following conditions are equivalent for any flow f :
1. f is a maximum flow.
2. There is no augmenting path in Gf .
3. There exists a cut (S, T ) such that c(S, T ) = |f |.

Max-Flow Min-Cut Theorem algorithm for computing min-cut:


Run Ford-Fulkerson until it terminates with a flow fmax
Define S as the set of nodes reachable from s in Gf , and T = V \ S
⇒ (S, T ) is a minimal (s, t)-cut whose capacity is equal to |fmax |

6.6: Maximum flow T.S. 15


Outline

Recap

Max-Flow Min-Cut Theorem

Analysis of Ford-Fulkerson

6.6: Maximum flow T.S. 16


Analysis of Ford-Fulkerson

0: def FordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

6.6: Maximum flow T.S. 17


Analysis of Ford-Fulkerson

0: def FordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

Lemma
If all capacities c(u, v ) are integral, then the flow at every iteration of
Ford-Fulkerson is integral.

6.6: Maximum flow T.S. 17


Analysis of Ford-Fulkerson

0: def FordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

Lemma
If all capacities c(u, v ) are integral, then the flow at every iteration of
Ford-Fulkerson is integral.

Flow before iteration integral


& capacities in Gf are integral
⇒ Flow after iteration integral

6.6: Maximum flow T.S. 17


Analysis of Ford-Fulkerson

0: def FordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

Lemma
If all capacities c(u, v ) are integral, then the flow at every iteration of
Ford-Fulkerson is integral.

Theorem
For integral capacities c(u, v ), Ford-Fulkerson terminates after V · C
iterations, where C := maxu,v c(u, v ) and returns the maximum flow.

6.6: Maximum flow T.S. 17


Analysis of Ford-Fulkerson

0: def FordFulkerson(G)
1: initialize flow to 0 on all edges
2: while an augmenting path in Gf can be found:
3: push as much extra flow as possible through it

Lemma
If all capacities c(u, v ) are integral, then the flow at every iteration of
Ford-Fulkerson is integral.

Theorem
For integral capacities c(u, v ), Ford-Fulkerson terminates after V · C
iterations, where C := maxu,v c(u, v ) and returns the maximum flow.

at the time of termination, no augmenting path


⇒ Ford-Fulkerson returns maxflow (Key Lemma)

6.6: Maximum flow T.S. 17


Slow Convergence of Ford-Fulkerson (Figure 26.7)

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1
000 000
0/1
s 0/1 t
0/1
000 000
v 0/1

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1 u
000 000 0 100
0/1 100 0

s 0/1 t s 1 t
0/1 100
000 000 0 100
0
v 0/1 v

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1 u
000 000 0 100
0/1 100 0

s 0/1 t s 1 t
0/1 100
000 000 0 100
0
v 0/1 v

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1 u
000 000 0 100
1/1 100 0

s 1/1 t s 1 t
0/1 100
000 000 0 100
0
v 1/1 v

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1 u
000 000 100
1/1 999 0
1
s 1/1 t s 1 t
0/1 100
000 000 0 999
v 1/1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 0/1 u
000 000 100
1/1 999 0
1
s 1/1 t s 1 t
0/1 100
000 000 0 999
v 1/1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 100
1/1 999 0
1
s 0/1 t s 1 t
1/1 100
000 000 0 999
v 1/1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 999
1/1 999
1 1
s 0/1 t s 1 t
1/1
000 000 999
999
v 1/1 1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 999
1/1 999
1 1
s 0/1 t s 1 t
1/1
000 000 999
999
v 1/1 1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 999
2/1 999
1 1
s 1/1 t s 1 t
1/1
000 000 999
999
v 2/1 1 v 1

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 999
2/1 998
2 1
s 1/1 t s 1 t
1/1
000 000 999
998
v 2/1 1 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 1/1 u
000 000 999
2/1 998
2 1
s 1/1 t s 1 t
1/1
000 000 999
998
v 2/1 1 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 999
2/1 998
2 1
s 0/1 t s 1 t
2/1
000 000 999
998
v 2/1 1 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 998
2/1 998
2 2
s 0/1 t s 1 t
2/1
000 000 998
998
v 2/1 2 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 998
2/1 998
2 2
s 0/1 t s 1 t
2/1
000 000 998
998
v 2/1 2 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 998
3/1 998
2 2
s 1/1 t s 1 t
2/1
000 000 998
998
v 3/1 2 v 2

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 998
3/1 997
3 2
s 1/1 t s 1 t
2/1
000 000 998
997
v 3/1 2 v 3

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 2/1 u
000 000 998
3/1 997
3 2
s 1/1 t s 1 t
2/1
000 000 998
997
v 3/1 2 v 3

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 3/1 u
000 000 998
3/1 997
3 2
s 0/1 t s 1 t
3/1
000 000 998
997
v 3/1 2 v 3

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 3/1 u
000 000 997
3/1 997
3 3
s 0/1 t s 1 t
3/1
000 000 997
997
v 3/1 3 v 3

G Gf

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 3/1 u
000 000 997
3/1 997
3 3
s 0/1 t s 1 t
3/1
000 000 997
997
v 3/1 3 v 3

G Gf

Number of iterations is at least C := maxu,v c(u, v )!

6.6: Maximum flow T.S. 18


Slow Convergence of Ford-Fulkerson (Figure 26.7)

u 3/1 u
000 000 997
3/1 997
3 3
s 0/1 t s 1 t
3/1
000 000 997
997
v 3/1 3 v 3

G Gf

Number of iterations is at least C := maxu,v c(u, v )!

For irrational capacities, Ford-Fulkerson


may even fail to terminate!

6.6: Maximum flow T.S. 18


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞

2 3 4 5

6.6: Maximum flow T.S. 19


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞

2 3 4 5

./∞
./∞ ./∞
t

6.6: Maximum flow T.S. 19


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 0/1
2 3 4 5

./∞
./∞ ./∞
t

6.6: Maximum flow T.S. 19


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 0/1 0/φ
2 3 4 5

./∞ φ2 = 1 −./∞
φ, φ = ( 5./∞
− 1)/2 ≈ 0.618

6.6: Maximum flow T.S. 19


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 0/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

6.6: Maximum flow T.S. 19


Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 0/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 0/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 1, |f | = 0

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 
0/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 1, |f | = 0

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 1, |f | = 1

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 1, |f | = 1

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


0/1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 2, |f | = 1

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞



0/1 
1/1 
0/φ

2 3 4 5

./∞
./∞ ./∞
t

Iteration: 2, |f | = 1

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1 − φ/1 φ/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 2, |f | = 1 + φ

1 1 φ
2 3 4 5

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1 − φ/1 φ/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 2, |f | = 1 + φ

1−φ φ
φ
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1 − φ/1 φ/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 3, |f | = 1 + φ

1−φ φ
φ
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞



φ/1
1 − φ /1 2

1−

φ/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 3, |f | = 1 + φ

1−φ φ
φ
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 3, |f | = 1 + 2 · φ

1−φ φ
φ
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 3, |f | = 1 + 2 · φ

1−φ
1 φ
2 3 4 5
φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1/1 0/φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 4, |f | = 1 + 2 · φ

1−φ
1 φ
2 3 4 5
φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
φ

1− /1 
1/1 
0/φ

2 3 4 5

./∞
./∞ ./∞
t

Iteration: 4, |f | = 1 + 2 · φ

1−φ
1 φ
2 3 4 5
φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


1/1 φ/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 4, |f | = 1 + 2 · φ + φ2

1−φ
1 φ
2 3 4 5
φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


1/1 φ/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 4, |f | = 1 + 2 · φ + φ2

1−φ φ3
1
2 3 4 5
φ φ − φ3

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


1/1 φ/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 5, |f | = 1 + 2 · φ + φ2

1−φ φ3
1
2 3 4 5
φ φ − φ3

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞



1/1  φ − φ3 /φ
φ/1
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 5, |f | = 1 + 2 · φ + φ2

1−φ φ3
1
2 3 4 5
φ φ − φ3

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 5, |f | = 1 + 2 · φ + 2 · φ2

1−φ φ3
1
2 3 4 5
φ φ − φ3

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


2
1 − φ /1 1/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

Iteration: 5, |f | = 1 + 2 · φ + 2 · φ2

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 1/1 φ − φ3 /φ
2 3 4 5

./∞
./∞ ./∞
t

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5

./∞
./∞ ./∞
t

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞ ./∞
t

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

More generally, s

1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

More generally, s
1−φ2i 1 φ−φ2i+1
For every i = 0, 1, . . . after iteration 1 + 4 · i: −→ , −→, ←−
1−φ φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

More generally, s
1−φ2i 1 φ−φ2i+1
For every i = 0, 1, . . . after iteration 1 + 4 · i: −→ , −→, ←−
1 − φ does not terminate!
Ford-Fulkerson φ3
1
2 3 4 5
φ 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

More generally, s
1−φ2i 1 φ−φ2i+1
For every i = 0, 1, . . . after iteration 1 + 4 · i: −→ , −→, ←−
1 − φ does not terminate!
Ford-Fulkerson φ3
1
2 3 4 5
|f | = 1 + 2 2i Φi < 7
P
φ k =1 1−φ

t
6.6: Maximum flow T.S. 19
Non-Termination of Ford-Fulkerson for Irrational Capacities
s

./∞ ./∞ ./∞


In summary:
2
1 − φ /1 0 1 0 1/1 φ − φ3 /φ
After
2 iteration 1: −→, −→,
3 ←−, |f | = 1 4 5
1−φ2 1 φ−φ3 2
After iteration 5: −→ , −→, ←− , |f |./∞
= 1 + 2φ + 2φ
./∞1−φ4 5 ./∞
1 φ−φ
After iteration 9: −→ , −→, ←− , |f | = 1 + 2φ + 2φ2 + 2φ3 + 2φ4
t

More generally, s
1−φ2i 1 φ−φ2i+1
For every i = 0, 1, . . . after iteration 1 + 4 · i: −→ , −→, ←−
1 − φ does not terminate!
Ford-Fulkerson φ3
1
2 3 4 5
|f | = 1 + 2 2i Φi < 7
P
φ k =1 1−φ
It does not even converge to a maximum flow!

t
6.6: Maximum flow T.S. 19
Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities

6.6: Maximum flow T.S. 20


Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities
Runtime: O(E · |f ∗ |) = O(E · V · C)

6.6: Maximum flow T.S. 20


Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities
Runtime: O(E · |f ∗ |) = O(E · V · C)

Capacity-Scaling Algorithm

6.6: Maximum flow T.S. 20


Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities
Runtime: O(E · |f ∗ |) = O(E · V · C)

Capacity-Scaling Algorithm
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v ) with cf (u, v ) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E 2 · log C)

6.6: Maximum flow T.S. 20


Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities
Runtime: O(E · |f ∗ |) = O(E · V · C)

Capacity-Scaling Algorithm
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v ) with cf (u, v ) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E 2 · log C)

Edmonds-Karp Algorithm

6.6: Maximum flow T.S. 20


Summary and Outlook

Ford-Fulkerson Method
works only for integral (rational) capacities
Runtime: O(E · |f ∗ |) = O(E · V · C)

Capacity-Scaling Algorithm
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v ) with cf (u, v ) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E 2 · log C)

Edmonds-Karp Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E 2 · V )

6.6: Maximum flow T.S. 20

You might also like