Date post: | 23-Dec-2015 |
Category: |
Documents |
Upload: | elmer-burns |
View: | 216 times |
Download: | 0 times |
Flow [email protected]
Formalization
Basic Results
Ford-Fulkerson
Edmunds-Karp
Bipartite Matching
Min-cut
Flow Network
β’ Directed Graph G = (V, E)β’ Each edge has a capacity
Properties of Flow
Capacity Constraint
Skew Symmetry
Flow Conservation
Maximum Flow
β Returns Maximum Flow of G
Value of Flow
|π |=βπ£βπ
π (π ,π£ )
Motivating Problem
s
v1
v2
v3
v4
tFact
ory
Warehouse
16
10 4
1220
9 7
4
14
13
Motivating Problem
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/20
4/9 7/7
4/4
11/14
8/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
15/20
4/9 7/7
4/4
11/14
8/13
12/12
Multiple Sources / Sinks
s1
v1
v2
v3
v4
t1
16
10 4
1220
9 74
14
13
t24s2
4
Multiple Sources / Sinks
s1
v1
v2
v3
v4
t1
16
10 4
1220
9 74
14
13
t24s2
4
S tβ
β β
β
Implicit Summation Notation
Key EqualitiesLet G = (V, E) be a flow network, and let f be a flow in G. Then
Capacity Constraint
Skew Symmetry
Flow Conservation
Homomorphism
Flow Value
Prove
DefinitionHomomorphismFlow Conservation
Skew SymmetryHomomorphismFlow Conservation
Ford-Fulkerson
flow=0while(augmenting path p)) { augment flow f along p}return flow
Residual network
Induced network from G=(V, E) and flow f
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/20
4/9 7/7
4/4
11/14
8/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
Augmenting Path
A path of
non-zero weight
from s to t in Gf
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/20
4/9 7/7
4/4
11/14
8/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/20
4/9 7/7
4/4
11/14
8/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/20
4/9 7/7
4/4
11/14
8/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
20/20
0/9 7/7
4/4
11/14
13/13
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
20
411
1311
0 7
0
3
0
9
3
00
0
S-T Cut
β’ A cut C=(S, T) of a flow network G=(V, E) is a partition of V into S and T = V β S
β’ Net flow acrossβ’ Capacity of cut:
s
v1
v2
v3
v4
tFact
ory
Warehouse
11/16
10 1/4
12/12
15/204/9 7/
7
4/4
11/14
8/13
f(S, T) = 12 β 4 + 11 = 19c(S, T) = 12 + 14 = 26
Let f be a flow in a flow network G with source s and sink t, and let (S, T) be a cut of G. Then the net flow across (S, T) is f(S, T) = |f|
HomomorphismFlow ConservationHomomorphism
Flow ConservationDefinition
|π |= π (π ,π )The value of any flow f in a flow network G is bounded by the capacity of any cut of G
Min-Cut Max-Flow
1. f is a maximum flow in G2. The residual network Gf contains no
augmenting path3. |f|= c(S, T) for some cut (S, T) of G
(1 )β(2)1. Premise: f is a max-flow in G2. Assume Gf has augmenting path p
3. We can augment Gf with p to get a flow fβ > fβ Contradicts [1]
β’ Hence Gf has no augmenting paths
(2 )β(3)1. Premise: Gf has no augmenting paths
2. Let
1. T = V-S
3. (S, T) is a cut
1. Otherwise
(3 )β(1)
1. , |f| is maximum
The value of any flow f in a flow network G is bounded by the capacity of any cut of G
Ford-Fulkerson
flow=0while(augmenting path p)) { augment flow f along p}return flow
Termination: Gf has no augmenting path iff flow is maximum
Run-time
flow=0while(augmenting path p)) { augment flow f along p}return flow
O(E|f*|) where |f*| is the maximum flow
s
v1
v2
t1
1,000,000 1,000,000
1,000,0001,000,000
s
v1
v2
t1
1,000,000 1,000,000
1,000,0001,000,000
s
v1
v2
t1
999,999 1,000,000
1,000,0001,000,000
1
1
s
v1
v2
t1
999,999 1,000,000
1,000,0001,000,000
1
1
s
v1
v2
t1
999,999 999,999
1,000,000999,999
1
11
1
s
v1
v2
t1
999,999 999,999
1,000,000999,999
1
11
1
Edmunds Karp
flow=0while(augmenting path p)) { find augmenting path by BFS augment flow f along p}return flow
Run-time: O(VE2)
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
Critical Edge
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
Critical Edge
Lemma: Edges can be critical at most times
s
v1
v2
v3
v4
tFact
ory
Warehouse
11
5
12
15
411
811
4 7
5
3
0
5
3
00
5
πΏ π (π’ ,π£ )β hπ πππ‘ππ π‘β hπππ‘ hπππππ‘ πππππ’βπ£
πΏ π (π’ ,π£ )β hπ πππ‘ππ π‘β hπππ‘ hπππππ‘ πππππ’βπ£1. Assume (u, v) is a critical edge2. Augmenting-paths are shortest path [by EK]3. [from 1]4. After flow-augmentation, cf(u,v) = 0β’ (u, v) cannot be critical path until another
augmenting path containing (v, u).β’ Let the flow at this point be fβ5.
6. i.e, each time (u, v) is augmenting-path, path length increases by 2
7. (u, v) can be critical edge at most times
Lemma: Edges can be critical at most times
Since there are O(E) edges, the number of augmenting path is bounded by O(VE) [by Lemma].
Run-time: O(VE2)
Bipartite Matching
Bipartite Matching
Bipartite Matching MaxFlow
s t
Bipartite Matching MaxFlow
s t