Minimum Cost Flows: Primal Dual Algorithm and The Out-of-Kilter Algorithm
Minimum Cost Flows: Primal Dual Algorithm and The Out-of-Kilter Algorithm
• Out-of-kilter algorithm
2
Optimality Conditions
Theorem. Suppose that x* is flow and π* is a vector of node
potential. Then x* and π* are optimal if
1. the flow x* is feasible and
2. cπ*ij ≥ 0 for all (i, j) ∈ G(x*).
The second property is often called dual feasibility.
3
Optimality Conditions
The cycle canceling algorithm starts with a feasible
flow and maintains a feasible flow at each iteration.
It terminates with dual feasibility.
5
b(i) b(j)
Primal –Dual Algorithm (, )
i j
• min-cost max-flow
• single excess node and single deficit
node.
2 -2
Add nodes s and t.
(, )
u w
s (, t
) )
( ,
v z
(, )
2 -2
6
b(i) b(j)
Primal –Dual Algorithm (, )
i j
• min-cost max-flow
• single excess node and single deficit
node.
2 -2
Add nodes s and t.
(, )
4 ,) u w
For every v such that b(v)>0: (
Add an edge (s,v) such that u(s,v)=b(v) s (, t
) )
b(s) = (, ( ,
) v z
(, )
2 -2
7
b(i) b(j)
Primal –Dual Algorithm (, )
i j
• min-cost max-flow
• single excess node and single deficit
node.
2 -2
(, ) -4
Add nodes s and t.
4 ,) u
w (,
( )
For every v such that b(v)>0:
Add an edge (s,v) such that u(s,v)=b(v) s (, t
) )
b(s) = (, (, )
) v z ( ,
For every v such that b(v)<0:
Add an edge (v,t) such that u(v,t)= -b(v)
(, )
b(t) =
2 -2
8
b(i) b(j)
Primal –Dual Algorithm (, )
i j
• min-cost max-flow
• single excess node and single deficit
node.
0 0
(, ) -4
Add nodes s and t.
4 ,) u w (,
( )
For every v such that b(v)>0:
Add an edge (s,v) such that u(s,v)=b(v) s (, t
) )
b(s) = (, (, )
) v z ( ,
For every v such that b(v)<0:
Add an edge (v,t) such that u(v,t)= -b(v)
(, )
b(t) =
0 0
For all
9
b(i) b(j)
Primal –Dual Algorithm (, )
i j
• min-cost max-flow
• single excess node and single deficit
node.
0 0
• a minimum cost flow in the
(, ) -4
4 ,) u w (,)
transformed network gives a (
minimum cost flow in the original s (, t
) )
network (, (, )
) v z ( ,
• There exists a feasible solution iff all (, )
the edges from s are saturated. 0 0
10
Primal –Dual Algorithm
• Similar to the previous SSP :
• Start with optimal (RC) feasible pseudoflow
• At every step keeps optimality (RC) and tries to build a feasible
flow.
11
Primal –Dual Algorithm
• (x) Admissible network :
• =
12
Primal –Dual Algorithm
• algorithm
primal-dual;
• begin
• x: = 0 and : = 0;
• e(s) : = b(s) and e(t) : = b(t);
• while e(s) > 0 do
• begin
• determine shortest path distances d(·) from node s to all other nodes
in G(x) with respect to the reduced costs ;
• update : = - d;
• define the admissible network ;
• establish a maximum flow from node s to node t in ;
• update e(s) , e(t), and G(x);
• end; 13
• end;
b(i) b(j)
Primal –Dual Algorithm i
(, )
j
• Example network:
2 -2
(, )
u w
(,
) )
( ,
v z
(, )
2 -2
14
b(i) b(j)
(, )
Primal –Dual Algorithm i j
• Transformed network
2 -2 0 0
(, ) (, )
u w ) u w (,
)
(,
(, 4 s (, t -4
) ) ,) )
( , (, ( )
v z ) v z ( ,
(, ) (, )
2 -2 0 0
15
b(i) b(j)
(, )
Primal –Dual Algorithm i j
0 0
(, )
) u w (,
)
(,
4 s (, t -4
,) )
(, ( )
) v z ( ,
(, )
0 0
16
b(i) b(j)
(, )
Primal –Dual Algorithm i j
0 0
(, )
) u w (,
)
(,
4 s (, t -4
,) )
(, ( )
) v z ( ,
(, )
0 0
17
b(i) b(j)
(, )
Primal –Dual Algorithm i j
0 0
(, )
) u w (,
)
(,
4 s (, t -4
,) )
(, ( )
) v z ( ,
(, )
0 0
18
b(i) b(j)
(, )
Primal –Dual Algorithm i j
(w) = 1 1
(u) = 0 0
(s) = 0 e(s)= -4 0 0
e(s) = 4 (, ) (, (t) = 1 (, )
) u w
) 0 ) u w (,
(, ) 1
(, (,
s ) ) t 4 s (, t -4
(, (, ) )
) v
, ) (,
) (, )
z ( v z ( ,
(, ) (, )
0 0
(v) = 0 (z) = 2 0 2
20
𝑟 ❑
Primal –Dual Algorithm i
𝑖𝑗
j
𝑐 𝜋𝑢 , 𝑣 =𝑐 𝑢 , 𝑣 − 𝜋 ( 𝑣 )+ 𝜋 ( 𝑢 )
• The admissible network ( = 0)
(w) = 1
(s) = 0 (u) = 0
e(s)= -4
e(s) = 4
u
(, )
w (, (t) = 1 1
) ) u w 2
(, 2
(,
s ) ) t s 1 t
(, (, ) 2
1
) v z ( ,
v z
(, ) 2
(v) = 0 (z) = 2
21
𝑟 ❑
Primal –Dual Algorithm i
𝑖𝑗
j
1
u w 2
2
s 1 t
1
2
v z
2
22
𝑟 ❑
Primal –Dual Algorithm i
𝑖𝑗
j
0
u w 0
1
s 1 t
0
1
v z
2
23
Primal –Dual Algorithm
• Correctness + Runtime:
• The primal-dual algorithm sends flow along all shortest paths at
once; therefore, proof of correctness is similar to the successive
shortest path one
24
Primal –Dual Algorithm
• Correctness + Runtime:
• Let U be an upper bound to the supply and C an upper bound to
the costs.
Out-Of-Kilter Algorithm
26
The Out of Kilter Algorithm
• An edge can be in one of 2 states:
28
Kilter Diagram
The kilter diagram represents
the conditions:
If then
If then
If then
29
Kilter Number
•• kilter
number of each edge (i, j) is the
magnitude of the change in required
to make the edge an in-kilter arc
while keeping fixed.
30
• An in-kilter edge has a kilter number
of zero.
Kilter Number
< 0 -| If then
If then
=0 If then
31
Kilter Number – residual
network
32
The Out of Kilter Algorithm
Start with a feasible flow and = 0
33
The Out of Kilter Algorithm
Correctness:
Kilter numbers of the edges are non-increasing
Two operations in the algorithm affect the kilter numbers of arcs:
updating node potentials
34
The Out of Kilter Algorithm
Runtime:
The algorithm terminate within O(mU) iterations
total runtime is : O(
35