Beyond the flow decomposition barrier Authors: A. V. Goldberg and Satish Rao (1997)

Download Report

Transcript Beyond the flow decomposition barrier Authors: A. V. Goldberg and Satish Rao (1997)

Beyond the flow
decomposition barrier
Authors: A. V. Goldberg and Satish Rao
(1997)
Presented by Yana Branzburg
Advanced Algorithms Seminar
Instructed by Prof. Haim Kaplan
Tel Aviv University, June 2007
Introduction





Maximum flow problem
Use the concept of distance
Distance is defined by arc length
Methods so far use unit length function
Goldberg&Rao use adaptive binary
length function: length threshold is set
relative to an estimate of residual flow
3
Ω(mn) barrier

Ω(mn) - a natural barrier for maximum flow
algorithms



that output explicit flow decomposition (the total
path length is Θ(mn) in the worst case)
that augment flow one path at the time, for each
augmenting path, one arc at the time
Although the barrier does not apply to
algorithms that use preflows or data
structures like dynamic trees, no one beats it
4
Ω(mn) barrier (cont.)
5
Beyond the Ω(mn) barrier

Dinic’s algorithm for unit-capacity networks
O(min{ m , n }  m)
1/ 2

2/3
Goldberg-Rao algorithm for general networks
2
n
O(min{ m , n }  m  log( )  log U )
m
1/ 2
2/3
6
Background

flow network:

G = (V, E)
source s, sink t

capacity function u: E  {1, …, U}


flow function f: E  {1, …, U}



f(a) ≤ u(a)
conservation constraint
j  V  {s, t}, ( v , w) f (v, w)  (u ,v ) f (u, v)  0
flow value is
f  ( v ,t ) f ( v , t )
7
Background (cont.)





residual capacity uf (v,w) = u(v,w) – f(v,w) +
f(w,v)
Arc (v,w) is a residual arc if uf (v,w) > 0
residual flow is the difference between
optimal flow f* and current flow f
In blocking flow every directed path s-t
contains an arc with residual capacity 0
Without loss of generality assume:



G has no parallel arcs
if arc (v,w) is in G, but (w,v) is not, add (w,v) to
G, define u(w,v)=0
either f(v,w) = 0 or f(w,v) = 0
8
Dinic’s algorithm for unitcapacity networks
Dinic’s algorithm for unit
capacity networks


A unit capacity network is one in which all arc
have unit capacities
Algorithm of two phases:


Find augmenting paths, until distance between s
and t is   min{ m1/ 2 ,2n 2 / 3}
Augment the found flow to an optimal flow
10
Dinic’s algorithm for unit
capacity networks (cont.)

Algorithm Dinic

while ds ≤ α (ds stands for length of the
shortest path from s to t)



Find blocking flow in admissible network
Compute residual network
while there is an s-t path in the residual
network



Find an s-t path P
Augment one unit of flow along P
Compute residual network
11
Dinic’s algorithm for unit
capacity networks - Analysis

Phase I:

Find a blocking flow:






Find a s-t path
Route one unit of flow
Delete all arcs of the path (all saturated)
Repeat until there is no s-t path
Each arc is looked only once, hence O(m)
Thus the first phase total takes O(αm)
12
Dinic’s algorithm for unit capacity
networks – Analysis (cont.)

Phase II:



Blocking flow increases the distance
between s and t by at least one
Let the vertices be partitioned into levels
Vk  v V | d v  k , k  0,..., d s
Thus, at the end of phase I, there are at
least α levels
13
Dinic’s algorithm for unit capacity
networks – Analysis (cont.)


Lemma 1: At the end of phase I, the
maximum flow in the residual network is at
most α
Proof. Case 1: α = m½

At least m½ levels and m arcs  there is a pair of
adjacent levels Vk and Vk+1 which have at most
m½ arcs between them
k
d
(
V
,
The cut i 0 i i k 1Vi ) has capacity at most m½
 maximum residual flow is m½
s

14
Dinic’s algorithm for unit capacity
networks – Analysis (cont.)

Proof. Case 2: α = 2n ⅔



There exists a pair of adjacent levels Vk and Vk+1 ,
each of which has at most n ⅓ nodes
Assume the contrary: at least half levels must
contain more than n ⅓ nodes
Then the total number of nodes more than
α/2*n ⅓ ≥ n, which
is ad contradiction
k
Thus the cut (i 0Vi , i k 1Vi ) has capacity at most
s

n⅔≤ α
15
Dinic’s algorithm for unit capacity
networks – Analysis (cont.)





Each iteration of phase II routes one unit of
additional flow
Since after phase I the maximum flow in the residual
network ≤ α, the maximum number of iterations in
phase II is bounded by α
One iteration of phase II is O(m)
Thus, the second phase takes total O(αm)
Hence, Dinic’s algorithm for unit capacity networks
solves the maximum flow problem in
O(min{ m1/ 2 , n 2 / 3}  m) time
16
Goldberg-Rao algorithm
Length Functions






length function ℓ : E R+
distance labeling d : V R+ with respect to a length
function ℓ if:

d(t) = 0

for every (v,w) in E : d(v) ≤ d(w) + ℓ(v,w)
admissible arc (v,w) is a residual arc where
d(v) > d(w) or d(v) = d(w) and ℓ(v,w) = 0
In case of binary length function, admissible arc
satisfies d(v) = d(w) + ℓ(v,w)
distance function dℓ(v) : distance from v to t under ℓ
dℓ(v) is a distance labeling
18
Length Functions (cont.)


Claim 2: dℓ is the biggest distance labeling
Proof (assume the contrary):

d(v) >dℓ(v) for some v
w is the last node on a shortest v-t path Γ that
satisfies d(w) >dℓ(w)
x follows w (w ≠t, hence x exists)
dℓ(w) < d(w) ≤ ℓ(w,x) +d(x) ≤ ℓ(w,x) +dℓ(x)
v-w concatenated with w-t is shorter than Γ

Contradiction to selection of Γ




19
Volume of Network

A residual arc a has






“width” uf(a)
length ℓ(a)
volume volf,ℓ(a) = uf(a) ℓ(a)
network volume Volf,ℓ = Σauf(a) ℓ(a)
The residual flow value is upper bounded by
Volf,ℓ ∕dℓ(s) (since any path from s to t has
length at least dℓ(s) > 0)
To get a tighter bound, keep Volf,ℓ small by
choosing a binary length function that is zero
for large residual capacity arcs
20
Binary Blocking Flow
Algorithm - Idea

Ensure the algorithms terminates after not
too many augmentations by showing that
every iteration increases dℓ(s) - but we have
zero arcs?!




Contract strongly connected components (nodes)
formed by zero-length arcs 
Bound the augmenting flow in a node by Δ to be
able to reroute the flow in a restored node 
Possible not to find a blocking flow  can not
guarantee increase of dℓ(s) 
Choose Δ that insures small number of nonblocking augmentations
21
Stopping Condition of the
Algorithm




Define F - an upper bound on the
residual flow value
Update F every time our estimate
improves
Stop when F < 1 (integral capacities)
Initial estimate is F = Σ(s,w)u(s,w) ≤ nU
23
The Skeleton of Goldberg-Rao
algorithm

while F ≥ 1 do


Compute Δ
while the residual capacity > F /2

update step
phase





Compute length function ℓ, distance function dℓ
Find admissible graph A(f, ℓ, dℓ)
Contract strongly connected components of A
Find a flow of value Δ or a blocking flow
Augment the current flow, extend it to original
graph and recompute the residual graph
Update F
24
Estimate a residual capacity






A residual capacity uf(S,T) of an s-t cut can
serve as an upper bound
canonical cut (Sk ,Tk) :
Sk  v V | dl (v)  k , Tk  V \ Sk , k  1,..., dl (s)
(Sk ,Tk) is an s-t cut
Initially (S,T) =({s },V \{s }) is the current cut
Find a canonical cut with the smallest residual
capacity
When the capacity of the found cut ≤ F /2,
update F to this capacity value
25
Estimate a residual capacity
(cont.)


Claim 3: The minimum capacity canonical cut
can be found in O(m) time
Proof:





Every arc may cross at most one canonical cut (its
length at most 1)
For k =1,…,dℓ(s), initialize uf(Sk,Tk) =0
For every arc (v,w) : if dℓ(v) > dℓ(w), increase
uf(Sk,Tk) by uf(v,w), k = dℓ(v)
Find minimum among all uf(Sk,Tk)
Denote the minimum capacity canonical cut ( S , T )
26
Binary length function

A first estimate of a length function:
0, if uf (a)  2
l (a)  
otherwise
1,
* this length function will have to be modified for reasons that
will come up during time analysis

Given ℓ, next we show how to handle
the contraction of zero arcs
27
Extending the flow inside
contracted components


Claim 4: Given a flow of value at most
Δ, we can correct it to a flow of the
same value in the original graph in
O(m) time
Proof (for one component):


Choose an arbitrary vertex as a root
Form an in-tree and an out-tree


in-tree: a rooted tree with a path from each
node to the root
out-tree: a rooted tree with a path from the
root to each node
28
Extending the flow inside
contracted components (cont.)

Proof (cont.):




For each vertex compute its flow balance:
sum of flow entering minus sum of flow
leaving the vertex
Route the positive balances to the root
using the in-tree
Route the resulting flow excess from the
room to negative balances via out-tree
At most Δ flow is routed to and from the
root using one arc, which residual capacity
is at least 2Δ
29
Extending the flow inside
contracted components (cont.)

Example:
0.5Δ
0.5Δ
0.5Δ+Δ
+0.5Δ
+0.5Δ
Δ +Δ
0.75Δ
-0.75 Δ
Δ +0.25Δ
Δ
R
Δ
-0.25 Δ
in tree
out tree
0.25Δ
30
Time bounds





Reminder: choice of Δ must insure small
number of non blocking augmentations
1/ 2
2/3
Denote   min{ m , n }
Let   F  
Thus, number of non blocking augmentations
of value Δ is at most α in each phase
How many blocking augmentations per phase
there are? Need to show that O(α)
31
Bound of number of blocking
augmentations

Lemma 5: For a 0-1 length function on the residual
graph:
m
u f (S , T ) 
M
dl (s)
where M is the maximum residual capacity of a length one arc

Proof:



Every arc crosses at most one of the canonical cuts, for such
an arc, ℓ(a) =1
Total capacity of length one arcs ≤ mM, there are dℓ(s)
canonical cuts
Thus, minimum capacity canonical cut ≤ mM / dℓ(s)
32
Bound of number of blocking
augmentations (cont.)
For dense graphs, the following Lemma gives better bounds


Lemma 6: For a 0-1 length function on the residual
2
graph:
 2n 
 M
u f ( S , T )  
 d l ( s) 
Proof:





Let Vk  v V | dl (v)  k , k  0,..., dl ( s)
dl ( s )
Since k 0 Vk  n , there are at most dℓ(s)/2 values of k
where |Vk | > 2n /dℓ(s)
Thus, at least dl ( s) / 2  1 values of k have |Vk | ≤ 2n /dℓ(s)
By the pigeonhole principle, there is j such that
|Vj | ≤ 2n /dℓ(s) and |Vj+1 | ≤ 2n /dℓ(s)
Since all arcs from Vj+1 to Vj have length 1, Lemma 6 holds
33
Bound of number of blocking
augmentations (cont.)



Lemma 7: In every iteration of a blocking
flow, dℓ(s) increases by at least 1 (prove later)
Lemma 8: There are at most O(α) blocking
flow augmentations in a phase
Proof: Case 1: α = m½


Using Lemma 7: after 4m½ blocking flow update
steps dℓ(s) ≥ 4m½
M ≤ 2Δ. Thus, together with Lemma 5:
m
m
2m F
F
u f (S , T ) 
M
2 

dl (s)
dl (s)
4 m m 2
34
Bound of number of blocking
augmentations (cont.)

Proof. Case 2: α = n ⅔


Using Lemma 7: after 4n ⅔ blocking flow
update steps dℓ(s) ≥ 4n ⅔
M ≤ 2Δ. Thus, together with Lemma 6:
2
2
 2n 
 2n 
2n  F
F

 M  
 2  2 2 / 3  2 / 3 
u f ( S , T )  
2
 4n  n
 dl ( s) 
 dl ( s) 

2
Conclusion: Each phase of the algorithm
terminates in O(α) update steps
35
Finding a flow in one update
step


We use Goldberg&Tarjan algorithm for
computing a blocking flow X in each
update step in O(mּlog(n2/m)) time
If X > Δ, return extra flow to s in O(m)
time:



Place X – Δ units of excess at t
Process vertices in reverse topological
order
For current vertex reduce flow on the
incoming arcs to eliminate its excess
36
Time Bounds Summary


Theorem 9: The maximum flow problem can
be solved in O(αּmּlog(n2/m)ּlogU) time
Proof:
F =uf(S,T) ≤ mM
/done
 Δ>U : all arcs are length
ℓ(s) ≤ mM /α = αM




≤ αU
Each update step finds a blocking flow and
increases dℓ(s) by at least one
After α steps dℓ(s) ≥α F ≤αU
After O(α) steps F =α Δ ≤αU  Δ≤U
Total time till Δ =U is O(αּmּlog(n2/m))
37
Time Bounds Summary (cont.)

Proof (cont.):



1≤Δ≤U : Number of phases is O(logU),
since each phase decreases   F   twice
Total time for these phases is
O(αּmּlog(n2/m)ּlogU)
When Δ=1, F ≤α, the algorithm ends in
O(α) update steps
38
Proof of Lemma 7


In every iteration of a blocking flow,
dℓ(s) increases by at least 1
Denote:




ℓ and dℓ - initial length and distance functions
ℓ’ and dℓ’ - after finding a blocking flow and
recomputing the residual graph
f and f’ - the flows before and after
augmentation respectively
Need to prove: dℓ(s) < dℓ’ (s)
39
Proof of Lemma 7 (cont.)


Claim 10: dℓ is a distance labeling with
respect to ℓ’
Proof:






By definition: dℓ(v) ≤ dℓ(w) + ℓ(v,w)
Need to show: dℓ(v) ≤ dℓ(w) + ℓ’(v,w)
If dℓ(v) ≤ dℓ(w) – trivial
dℓ(v) >dℓ(w) (w,v) is not admissible (for
admissible arc dℓ(w)=dℓ(v)+ℓ(w,v))
 uf’ (v,w) ≤ uf(v,w)
 ℓ’(v,w) ≥ ℓ(v,w)
40
Proof of Lemma 7 (cont.)


Claim 11: dℓ(s) ≤ dℓ’ (s)
Proof:



By Claim 2: for any distance labeling d,
d(v) ≤ dℓ(v)
By Claim 10: dℓ is a distance labeling with
respect to ℓ’
 dℓ(s) ≤ dℓ’ (s)
41
Proof of Lemma 7 (cont.)




We need to show dℓ(s) < dℓ’ (s)
Let Γ be an s-t path in Gf’
By Claim 10:
cost(v,w) =dℓ(w) -dℓ(v) +ℓ’(v,w) ≥0
ℓ’ (Γ) = dℓ(s) –dℓ(v1) +c(s,v1) +
dℓ(v1) –dℓ(v2) +c(v1,v2) +…+
dℓ(vk) –dℓ(t) +c(vk,t) =
dℓ(s) – dℓ(t) +c (Γ) = dℓ(s) +c (Γ)
42
Proof of Lemma 7 (cont.)


dℓ’ (s) = ℓ’ (Γ) = dℓ(s) + c (Γ)
Enough to show that along every s-t
path Γ in Gf’ there is an arc (v,w)
satisfying c(v,w) > 0
43
Proof of Lemma 7 (cont.)


dℓ(v) >dℓ(w):
dℓ(v) ≤ dℓ(w) + ℓ(v,w)
< dℓ(v) + ℓ(v,w) 
ℓ(v,w) > 0 
dℓ(v) = dℓ(w) + ℓ(v,w)
We routed a blocking flow  Γ contains
arc (v,w) that is not in A(f, ℓ, dℓ)
dℓ(v) ≤ dℓ(w) either because:


(v,w) in Gf (otherwise (v,w) would be in
A(f, ℓ, dℓ)) or
(v,w) not in Gf but in Gf’ (means that (w,v)
is in A(f, ℓ, dℓ) dℓ(w) = dℓ(v) + ℓ(v,w) 
dℓ(w) ≥dℓ(v))
44
Proof of Lemma 7 (cont.)



Assume the contrary that
c(v,w) =dℓ(w) -dℓ(v) +ℓ’(v,w) = 0
dℓ(v) ≤dℓ(w)  dℓ(w) =dℓ(v) and ℓ’(v,w) =0
Case 1 - (v,w) in Gf :


Case 2 - (v,w) not in Gf but in Gf’ :


1=ℓ(v,w) >ℓ’(v,w) =0(w,v) is in A(f, ℓ, dℓ)
(w,v) is in A(f, ℓ, dℓ)
But dℓ(w) =dℓ(v) ℓ (w,v) = 0
45
Bad Example

dℓ(w) =dℓ(v), ℓ(w,v) =0 and ℓ’(v,w) =0


Δ ≤ uf(v,w) < 2Δ
uf(w,v) > 2Δ
w
v
≥ 2Δ- uf(v,w)


uf’ (v,w) ≥ uf(v,w) + 2Δ – uf(v,w) ≥ 2Δ
ℓ’(v,w) = 0
46
Solution to bad example



Distort the length function, so that such
bad arcs get length zero ahead
Might become an inner arc in a strongly
connected component
The capacity of such arcs must be at
least 2Δ in order to be able to route a
flow of Δ in flow extension (remember
example…)
47
A correct length function ℓ
0, if uf (a)  3
l (a)  
otherwise
1,

Changes due to new ℓ in Lemma 8 (p.
32):


Case 1 - 6m½ blocking flow update steps
instead of 4m½
Case 2 - 5n ⅔ blocking flow update steps
instead of 4n ⅔
48
Length function ℓ*

(v,w) is a special arc if:




Define new length function ℓ* that:




2Δ ≤ uf(v,w) < 3Δ
d(v) =d(w)
uf(w,v) ≥ 3Δ
= zero on special arcs
= ℓ on all other arcs
dℓ* = dℓ
The algorithm determines admissible graph
A(f, ℓ*, dℓ) instead of A(f, ℓ, dℓ)
49
Proof of Lemma 7 using ℓ*







dℓ(w) =dℓ(v), ℓ(w,v) =0 and ℓ’(v,w) =0
ℓ(w,v) =0  uf(w,v) ≥ 3Δ
ℓ’(v,w) =0  uf’ (v,w) ≥ 3Δ
(w,v) is in A(f, ℓ*, dℓ)  pushing a flow
(at most Δ) increased uf’ (v,w)
 uf(v,w) ≥ 2Δ
 Either (v,w) is a special arc before
augmentation or uf(v,w) ≥ 3Δ
 (v,w) is in A(f, ℓ*, dℓ) - contradiction 50
Example
12
while F ≥ 1 do
16
20
10
S
4
9
T
7
4
13
14





n = 6, m = 10
U = 20
F = 29
α = min{m½, n ⅔ } = 4
Δ = F /α = 8
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
51
Example (cont.)
Gf :
16
1
3
1
13
2
1
1
4
10
1
2
4/16
1
3
2
9
1
1
14
4/12
1
Compute Δ, ℓ, dℓ
0
7
Find A(f, ℓ*, dℓ)
1
Contract SCC of A
1 1
Find a flow f*
f’ = f + f*
4/20
0
2
1
4/14
1
while (S,T) > F /2
Compute ℓ*
4
1
4/13
while F ≥ 1 do
1 1
1
20
1
F = 29. Δ = 8
Af :
12
1
4/4
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
52
Example (cont.)
4 1 2
12 1
1
Gf ‘:
3
1
9
4
4
10
1
1
F = 29. Δ = 8
(S,T) = 15
1
3
4
8
1
1 1
4
1
16
9
1
10
4
2
1
1
0
7
1
while F ≥ 1 do
4
1
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
53
Example (cont.)
4 1 2
12 1
1
Gf ‘:
3
1
9
4
4
10
1
1
1
3
8/12
1
2
3
8
3
1 1
4
1
16
9
1
4
1
8/8
1
1
4
1
1
2
while (S,T) > F /2
Find A(f, ℓ*, dℓ)
Contract SCC of A
1
1 1
Compute Δ, ℓ, dℓ
Compute ℓ*
2
0/7
0/10
while F ≥ 1 do
0
7
10
0/4
1
1
1
F = 29. Δ = 8
Af’ :
4
Find a flow f*
f’ = f + f*
8/16
0
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
54
Example (cont.)
12 1 4
4
1
1
Gf ‘:
4
1
4
4
10
1
9
1
12
3
1
1 1
1
8
9
10
4
F = 29. Δ = 8
(S,T) = 7  F = 7, Δ = 2
1
0
7
1
1
12
2
1
4
1
while F ≥ 1 do
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
55
Example (cont.)
12 0 0
4
0
0
Gf ‘:
0
0
4
F = 7. Δ = 2
4
10
0
9
0
12
0
0
0
0
0
2/9
4
0
12
0
9
0
4
1
0
0
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Find A(f, ℓ*, dℓ)
Contract SCC of A
0
0 0
12
0
2/8
0
2/7
while F ≥ 1 do
Compute ℓ*
0
2/10
4
0
0
0
0
12
7
10
4
4
10
9
0
12 0 0
4
0
0
Af ‘:
0
0 0
0
8
0
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
56
Example (cont.)
12 0 1
4
0
1
Gf ‘:
1
0
6
F = 7. Δ = 2
(S,T) = 5
4
10
1
7
0
12
1
0
0 0
0
6
1
14
5 2
0
9
1
0
8
6
1
0
4
0
1
while F ≥ 1 do
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
57
Example (cont.)
12 0 1
4
0
0
Gf ‘:
1
0
6
F = 7. Δ = 2
4
10
0
7
0
12
1
0
0 0
0
6
1
14
5 2
0
9
1
0
8
6
1
0
10
0
2/7
4
0
1
2/5
1
0
2/8
4
1
0
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
0
0 0
4
1
1
12 0 1
4
0
0
Af ‘:
4
0
while F ≥ 1 do
2/6
12
0
0
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
58
Example (cont.)
12 0 1
4
0
1
Gf ‘:
2
1
8
4
10
1
5
0
12
1
0
0 0
0
4
1
16
3 4
0
9
1
0
6
8
F = 7. Δ = 2
(S,T) = 3  F = 3, Δ = 1
0
1
4
0
1
while F ≥ 1 do
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
59
Example (cont.)
12 0 0
4
0
0
Gf ‘:
0
0
8
F = 3. Δ = 1
4
10
0
5
0
12
0
0
0
0
0
1/5
8
0
0
3 4
0
9
6
4
12
9
1/6
8
0
1/3
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Find A(f, ℓ*, dℓ)
Contract SCC of A
0
4
0
while F ≥ 1 do
Compute ℓ*
0
0 0
16
0
1/4
0
0
0
0
0
0
8
4
10
16
0
12 0 0
4
0
0
Af ‘:
0
0 0
0
4
0
4
0
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
60
Example (cont.)
12 0 1
4
0
0
Gf ‘:
1
0
9
F = 3. Δ = 1
(S,T) = 2
4
10
0
4
0
12
1
0
0 0
0
3
0
17
2 5
0
9
1
0
5
9
0
1
4
0
0
while F ≥ 1 do
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
61
Example (cont.)
12 0 1
4
0
0
Gf ‘:
1
0
9
F = 3. Δ = 1
4
10
0
4
0
12
1
0
0 0
0
3
0
17
2 5
0
9
1
0
5
9
0
12 0 1
4
0
0
Af ‘:
1
0
10
0
1/4
9
0
1
1/5
9
0
1
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
1/3
17
0
0
1/2
1
0
0
1
0 0
4
4
0
while F ≥ 1 do
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
62
Example (cont.)
Gf ‘:
2
12 0 2
4
0
0
0
10
4
10
0
3
0
12
2
0
1 1
0
2
0
18
1 6
0
9
1
0
4
10
F = 3. Δ = 1
(S,T) = 1  F = 1, Δ = 1
0
2
4
0
0
while F ≥ 1 do
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
63
Example (cont.)
Gf ‘:
2
12 0 2
4
0
0
0
10
F = 1. Δ = 1
Af ‘:
2
4
10
0
3
0
12
2
0
1 1
0
2
0
18
1 6
0
9
1
0
4
10
0
12 0 2
4
0
0
0
10
0
1/3
10
0
2
1/4
10
0
2
Compute Δ, ℓ, dℓ
while (S,T) > F /2
Compute ℓ*
Find A(f, ℓ*, dℓ)
Contract SCC of A
1/2
18
0
0
1/1
1
0
0
2
1 0
4
4
0
while F ≥ 1 do
Find a flow f*
f’ = f + f*
Extend f* to G
Recompute ℓ,dℓ,Gf’
Update F
64
Example (cont.)
Final flow:
12/12
12/16
S
0/10
11/13
19/20
0/4
0/9
T
7/7
4/4
11/14
65
Concluding Remarks


These results can be extended to a wide class
of length functions (not binary) to obtain
same time bounds
Open issues:


Can the flow decomposition bound be improved
upon by a strongly polynomial algorithm? For
example, O(αm(logn)O(1))
Can these results be extended to obtain better
bounds for the minimum-cost flow problem?
66
Appendix
Unless you had enough 
Computing dℓ in linear time

We use Dial’s algorithm (1969):

Init:




Compute GT
Mark t as “reached but not scanned”, Dist[t]=0
Mark rest of the nodes as “not reached”,
Dist[v]=INF, v ≠t
Step 1:


Choose a “reached but not scanned” node v
with minimal Dist
If no such node – compute G back and FINISH,
else go to Step 2
68
Dial’s algorithm (cont.)

Step 2:

For each (v,w) :

if Dist(w ) > Dist(v ) + ℓ(v,w), then






Mark w as “reached but not scanned”
Dist(w ) = Dist(v ) + ℓ(v,w)
Add (v,w) to the output
Remove all arcs (u,w) from the output, u ≠ w
Mark v as “reached and scanned”
Go to Step 1
69
Dial’s algorithm Example
G
0
1
t
RnS
0
s
nR
INF
d
a
nR
INF
b
b
nR
INF
c
nR
INF
d
nR
INF
1
0
1
0
c
GT
1
a
0
0
s
node status Dist
b
0
0
s
1
a
1
1
0
1
0
1
c
t
0
d
t
1
70
Dial’s algorithm Example
(cont.)
a
0
0
s
1
1
b
1
c
0
d
Dist(b) > Dist(t) + ℓ(t,b)
distance nodes
b
0
1
0
1
0
node status Dist
t
1
t
RnS
0
s
nR
INF
a
nR
INF
b
c
nR
INF
RnS
0
nR
INF
d
nR
INF
71
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
s
RnS
0
RS
nR
INF
a
nR
INF
b
RnS
0
distance nodes
c
nR
INF
0
d
nR
INF
RnS
1
0
s
1
1
0
1
0
c
d
Dist(d) > Dist(t) + ℓ(t,d)
1
b
d
t
1
t
72
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
0
s
nR
INF
d
a
Dist(a) > Dist(b) + ℓ(b,a)
b
nRRnS INF
1
RnS
0
distance nodes
c
nR
INF
0
b
d
RnS
1
1
d a
0
s
1
1
0
1
0
c
t
1
73
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
0
s
nR
INF
d
a
RnS
1
Dist(d) > Dist(b) + ℓ(b,d)
b
0
s
1
1
0
1
0
c
t
1
distance nodes
c
RnS
0
RS
nR
INF
0
d
RnS
1
d
da
1
0
74
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
0
s
nR
INF
d
a
RnS
1
Dist(c) > Dist(d) + ℓ(d,c)
b
RS
0
c
nR
INF
RnS
0
RnS
0
RS
0
s
1
1
0
1
0
c
distance nodes
0
d c
1
a
t
1
d
75
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
s
a
nR
INF
RnS
1
RnS
1
b
RS
0
distance nodes
c
RnS
0
0
c
d
RS
0
1
a s
0
s
1
1
0
1
0
c
d
Dist(s) > Dist(c) + ℓ(c,s)
t
1
0
76
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
0
s
RnS
1
d
a
RnS
1
Dist(a) > Dist(c) + ℓ(c,a)
b
RS
0
distance nodes
c
0
d
RnS
0
RS
RS
0
0
s
1
1
0
1
0
c
1
a
as
t
1
0
77
Dial’s algorithm Example
(cont.)
1
a
0
b
node status Dist
0
t
RS
0
s
RnS
1
d
a
Dist(s) > Dist(a) + ℓ(a,s)
b
RnS
0
RS
RS
0
c
RS
0
d
RS
0
0
s
1
1
0
1
0
c
distance nodes
0
a s
1
s
t
1
0
78
Dial’s algorithm Example
(cont.)
1
a
0
0
s
1
b
0
1
0
node status Dist
t
1
t
RS
s
0
d
a
RnS
0
RS
RS
0
Dist(s) > Dist(a) + ℓ(a,s)
b
RS
0
distance nodes
c
RS
0
0
d
RS
0
1
0
c
1
s
79
Dial’s algorithm Example
(cont.)
Final result:
a
0
0
s
1
1
node status Dist
b
1
0
1
c
0
0
d
t
1
t
RS
0
s
RS
0
a
RS
0
b
RS
0
c
RS
0
d
RS
0
80
Dial’s algorithm Running Time




Build GT – O(n+m)
Each arc is examined once – O(m)
By keeping bins for possible distances,
perform Step 1 in linear time – O(nU)
Total – O(m + nU)
81
References




“Beyond the Flow Decomposition
Barrier”, A.V. Goldberg, Satish Rao
“A Brief History Of Max-Flow”, R.
Khandekar, K.Talwar
“The maximum flow problem”, I.
Hudson
“Shortest-path forest with topological
ordering”, R.B. Dial
82