Data Structures and Algorithms: Maximum Flows
Data Structures and Algorithms: Maximum Flows
Algorithms
Maximum flows
Maximum flows
s 10 4 9 7 t
13 4
14
Flow
Capacity constraint:
For all u,v V, f(u,v) c( u,v).
Skew symmetry:
For all u,v V: f(u,v) = f(v,u)
Flow conservation:
For all u V-{s,t}, we require
f ( e ) f ( e)
e.in .v e.out .v
Net flow and value of a flow f
f f ( s, v )
vV
12/12
11/16 15/20
8/13 4/4
11/14
f 19
13 4
v2 v4
14
4/12 The flow in G that
4/16 v1 v3 20 results from
augmenting along
path p by its
s 10 4 7 t residual capacity
4/9 4.
13 4/4
v2 v4
4/14
Example of Residual network
8
12 v1 v3
20
4
4
s 10 4 4 7 t
5
13 10 4
v2 v4
4
f f' f f'
Augmenting paths
(a)
8
12 v1 v3 4/12
20 v1 v3 7/20
4 11/16
4
s 10 4 4 7 t s 7/10 4 7/7 t
5 4/9
13 10 4 13 4/4
v2 v4 v2 v4
4 11/14
(b)
8 12/12
5 v1 v3 13 v1 v3
4 11/16 15/20
11 4
s 3 11 7 7 t s 7/7
10 1/4 4/9 t
5
13 3 8/13 4/4
v2 v4 4 v2 v4
11 11/14
(c)
12 12/12
5 v1 v3 5 v1 v3
11/16 19/20
11 4
s 11 3 7 15 t s 10 1/4 9 7/7 t
5 5
8 3 12/13 4/4
v2 v4 4 v2 v4
11 11/14
(d)
12
5 v1 v3 1
s
1 11 3 9 7 19 t
12 3 4
v2 v4
11
(e)
Running time
O(E | f* | ).