15.082J and 6.855J and ESD.78J October 19, 2010 Max Flows 3 Preflow-Push Algorithms.
15.082 and 6.855J
-
Upload
dillon-hooper -
Category
Documents
-
view
19 -
download
0
description
Transcript of 15.082 and 6.855J
1
15.082 and 6.855J
Flow Decomposition
2
beginInitializewhile y dobegin
Select(s, y)Search(s, y)if a cycle C is found then dobegin
let = Capacity(C, y)Add Flow(, C) to cycle flowsSubtract Flow(, C) from y.
endif a path P is found then dobegin
let = Capacity(P, y)Add Flow(, P) to path flowsSubtract Flow(, P) from y.
endend
3
The initial flow
1
2 4
53
6
2
3
47
3
4 48
59
2 -2
00
00
A supply node
A demand node
A balanced node
The flow x
4
Find a Path or Cycle
1
2 4
53
6
2
3
47
3
4 48
59
2 -2
00
Select a supply node
1Carry out a depth first search until a cycle C or a path P is found
Determine the capacity
The capacity is 2.
5
Update the decomposition
1
2 4
53
6
2
3
47
3
4 48
59
2 -2
00
Add the cycle flow to the decomposition
1
update the current flow
cycle flows path flows
2 units around 1-2-4-5-3-1
25
6
7
0
6
Find the next path or cycle
1
2 4
53
63
3
4 4
5
2 -2
00
Start at a supply node and find the next cycle or path
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
5
6
7
7
update the decomposition and current flow
1
2 4
53
63
3
4 4
5
2 -2
00
update the current flow and decomposition
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
5
6
7
3 units around 2-4-5-3-2
0
2
3
4
8
Find the next flow or cycle
1
2 4
53
6
3
4 4
5
2 -2
00
start with a supply node and find the next flow or cycle.
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
3 units around 2-4-5-3-2
2
3
4The capacity of 4-5-3-4 is 3
9
Update
1
2 4
53
6
3
4 4
5
2 -2
00
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
3 units around 2-4-5-3-2
2
3
4
update the current flow and decomposition
0
1
1
3 units around 4-5-3-4
10
1
Find the next flow or cycle
1
2 4
53
6
3
4
5
2 -2
00
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
3 units around 2-4-5-3-2
2
41
3 units around 4-5-3-4
start with a supply node and find the next flow or cycle.
The capacity of 1-2-4-6 is 2
11
1
Update
1
2 4
53
6
3
4
5
2 -2
00
1
cycle flows path flows
2 units around 1-2-4-5-3-1
2
3 units around 2-4-5-3-2
2
41
3 units around 4-5-3-4
update the current flow and decomposition
0
01
0 0
2 units in 1-2-4-6
12
1
Find the next path or cycle
1
2 4
53
64
5
0 -2
00
cycle flows path flows
2 units around 1-2-4-5-3-1
3 units around 2-4-5-3-2
41
3 units around 4-5-3-4
10
0
2 units in 1-2-4-6
start with any node incident to an arc with flow and find the next flow or cycle.
3
13
1
Update
1
2 4
53
64
5
0 -2
00
cycle flows path flows
2 units around 1-2-4-5-3-1
3 units around 2-4-5-3-2
41
3 units around 4-5-3-4
10
0
2 units in 1-2-4-6
3
0
0
40
1 units around 3-4-6-5-3
14
The Final Decomposition
1
2 4
53
640 -2
00
cycle flows path flows
2 units around 1-2-4-5-3-1
3 units around 2-4-5-3-2
3 units around 4-5-3-4
0
0
2 units in 1-2-4-6
4
1 units around 3-4-6-5-3
4 units around 5-6-5
0
0