Professional Documents
Culture Documents
Network Flows PDF
Network Flows PDF
corridors and 10 10 5 50 15 15 15
stair ways 50
capacity 60 60
(used simulation)
50
For each person determine the path to follow to reach the meeting point
Do not violate the capacity
Maximum flow problem
Given a directed graph G = (N, A)
and t wo nodes s, t ∈ N
(integer) capacities uij ≥ 0, ∀(i, j) ∈ A
Send as much flow as possible from s to t
constraints
arc capacities
flow conser vation at intermediate nodes
Example
3
1 3
2
10 1 10
s 6 2 t
2
6
2 4
4
Building evacuation plan
people to
evacuate from t
the offices
corridors and 10 10 5 50 15 15 15
stair ways 50
capacity 60 60
15 10 60 60 15 15
s 50
Scheduling problem
m identical machines
set of jobs J = {1, . . . , n}
(pj , rj , dj )∀j ∈ J
processing release due
time time date
s 6 2 t
2
6
2 4
4
Capacity of the
! cut
U (Ns , Nt ) = uij
(i,j)∈A:i∈Ns ,j∈Nt
Flow!
traversing the cut !
x(Ns , Nt ) = xij − xji
(i,j)∈A:i∈Ns ,j∈Nt (j,i)∈A:j∈Nt ,i∈Ns
A+ (Ns , Nt )
<latexit sha1_base64="Dsb83jf6jDbv1LaJm6d9hjwAWyE=">AAAB8nicdVDLSgMxFM3UV62vqks3wSJUlCHT2teu6sZVqWBtoa1DJs20oZnMkGSEUvobblyouPVr3Pk3pg9BRQ9cOJxzL/fe40WcKY3Qh5VYWl5ZXUuupzY2t7Z30rt7tyqMJaENEvJQtjysKGeCNjTTnLYiSXHgcdr0hpdTv3lPpWKhuNGjiHYD3BfMZwRrI3XO706yNVed1lx97KYzyEbFQiWPILILyClVKoYgVCznc9AxZIoMWKDupt87vZDEARWacKxU20GR7o6x1IxwOkl1YkUjTIa4T9uGChxQ1R3Pbp7AI6P0oB9KU0LDmfp9YowDpUaBZzoDrAfqtzcV//LasfbL3TETUaypIPNFfsyhDuE0ANhjkhLNR4ZgIpm5FZIBlphoE1PKhPD1KfyfNHJ2xXauzzLVi0UaSXAADkEWOKAEquAK1EEDEBCBB/AEnq3YerRerNd5a8JazOyDH7DePgEIZ5CX</latexit>
A (Ns , Nt )
−
Properties
Given a feasible flow xij , ∀(i, j) ∈ A
for any cut (Ns , Nt )
the flow going from s to t equals the flow traversing the cut
v = x(Ns , Nt )
the flow traversing the cut is less than or equal to the capacity
of the cut
x(Ns , Nt ) ≤ U (Ns , Nt )
=
Can we prove that when x is optimum the equality holds?
Computation tool
Given a feasible flow
2 3
1 3
3 2
2 2
10 1 10
1
s 6 2 2 t
0
2
2 3 6
2 4
4 4
+
A (x) = {(i, j) 2 A : xij < uij }
the flow can be increased by at least one unit
flow augmentation
Augment_flow(P,x)
ϑ←Residual_capacity(P,x)
foreach (i,j) ∈ P do if (i,j) ∈ A+ then x[i,j] ← x[i,j]+ϑ
else x[j,i] ← x[j,i]-ϑ
Very important property
Given a directed graph G = (N, A)
and t wo nodes s, t ∈ N
2 7
3 8
4 9
5 10
Compatibility
Assign jobs to workers (at most one worker per job)
Maximize the number of pairs
Maximum cardinality assignment
Given a bipartite graph G = (S, T, A)
A⊆S×T
Matching M ⊆ A
no t wo arcs are incident in the same node
unit capacities
landfill
pile of waste
55
burner
3 4 2
level of the road
3 3 3
lack of material
Cost of moving material from one site to an adjacent one = 1 per truck
!
min cij xij
(i,j)∈A
! !
xji − xij = bi ∀i ∈ N
(j,i)∈BS(i) (i,j)∈F S(i)
p number of seats
bij i < j persons willing to go from i to j
fij i < j ticket price for going from i to j
3 i j
1, 2 cost, capacity
2, 4 1 1, 5
0
0 2 4
3, 3 3 4
+
A (x) = {(i, j) 2 A : xij < uij }
the flow can be increased by at least one unit
+
cost: cij , 8(i, j) 2 A (x)
Update_flow(C, ϑ, x)
foreach (i,j) ∈ C do if (i,j) ∈ A+ then x[i,j] ← x[i,j]+ϑ
else x[j,i] ← x[j,i]-ϑ
Detecting negative cost cycles
From the complexity analysis we know that a node cannot be
inserted into Q more than n-1 times
flow in the 1 3
3, 2
original arcs 2, 10 7, 1 1, 10
-3 5 4, 6 7, 2 6 t
3
2
1, 2 1, 6
s
2 4
2, 4
2
-2 1
Add a source and a sink
Connect the source to all offer nodes
Connect the demand nodes to the sink
Move the balances on the capacities
Compute! the maximum flow from s to t
If the flow = bi then there is a feasible solution
i:bi >0
Complexity issues
initialization max flow
Multicommodity flow
CO 6 10 9 6 MiL - 80 30 0 15 2 10
5 25 MiB 10 5 MiB 70 - 0 20 0 5 5
11 5
CR MN CO 20 5 - 3 1 0 0
4 9 1 100
7 10 8 10 13 9
LC 1 3 1 - 2 0 1
3 7 MiL 12 5 CR 10 2 3 0 - 4 1
PC PC 2 5 0 0 3 - 0
MN 10 15 0 0 2 1 -