1 / 80

Beyond the flow decomposition barrier

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

kimball
Download Presentation

Beyond the flow decomposition barrier

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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 • Goldberg-Rao algorithm for general networks

  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 • flow value is

  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 unit-capacity networks

  9. 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 • 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 • 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 • The cut has capacity at most m½  maximum residual flow is m½

  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 a contradiction • Thus the cut has capacity at most 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 time

  16. Goldberg-Rao algorithm

  17. 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 non-blocking 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

  22. The Skeleton of Goldberg-Rao algorithm • while F ≥ 1 do • Compute Δ • while the residual capacity > F /2 • 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 phase update step

  23. 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 ,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

  24. 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

  25. Binary length function • A first estimate of a length function: * 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

  26. 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

  27. 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Δ

  28. in tree out tree Extending the flow inside contracted components (cont.) • Example: 0.5Δ +0.5Δ 0.5Δ +Δ Δ +Δ 0.5Δ 0.75Δ +0.5Δ -0.75 Δ Δ +0.25Δ Δ R -0.25 Δ Δ 0.25Δ

  29. Time bounds • Reminder: choice of Δ must insure small number of non blocking augmentations • Denote • Let • 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(α)

  30. Bound of number of blocking augmentations • Lemma 5: For a 0-1 length function on the residual graph: 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)

  31. 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 graph: • Proof: • Let • Since , there are at most dℓ(s)/2 values of k where |Vk | > 2n /dℓ(s) • Thus, at least 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 Vjhave length 1, Lemma 6 holds

  32. 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:

  33. 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: • Conclusion: Each phase of the algorithm terminates in O(α) update steps

  34. 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

  35. Time Bounds Summary • Theorem 9: The maximum flow problem can be solved in O(αּmּlog(n2/m)ּlogU) time • Proof: • Δ>U : all arcs are length one • 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)) F =uf(S,T) ≤ mM /dℓ(s) ≤ mM /α = αM ≤ αU

  36. Time Bounds Summary (cont.) • Proof (cont.): • 1≤Δ≤U :Number of phases is O(logU), since each phase decreases twice • Total time for these phases is O(αּmּlog(n2/m)ּlogU) • When Δ=1, F ≤α, the algorithm ends in O(α) update steps

  37. Proof of Lemma 7 • In every iteration of a blocking flow, dℓ(s) increases by at least 1 • Denote: • ℓ anddℓ - initial length and distance functions • ℓ’ anddℓ’ - 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)

  38. 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)

  39. 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)

  40. 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 (Γ)

  41. 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

  42. 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 Gfbut in Gf’ (means that (w,v) is in A(f, ℓ, dℓ) dℓ(w) = dℓ(v) + ℓ(v,w) dℓ(w) ≥dℓ(v))

  43. 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 : • 1=ℓ(v,w) >ℓ’(v,w) =0(w,v) is in A(f, ℓ, dℓ) • Case 2 - (v,w) not in Gf but in Gf’ : • (w,v) is in A(f, ℓ, dℓ) • But dℓ(w) =dℓ(v) ℓ(w,v) = 0

  44. Bad Example • dℓ(w) =dℓ(v), ℓ(w,v) =0 and ℓ’(v,w) =0 • Δ ≤ uf(v,w) < 2Δ • uf(w,v) > 2Δ • uf’ (v,w) ≥ uf(v,w) +2Δ – uf(v,w) ≥ 2Δ • ℓ’(v,w) = 0 w v ≥2Δ- uf(v,w)

  45. 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…)

  46. A correct length function ℓ • 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 ⅔

  47. Length function ℓ* • (v,w) is a special arc if: • 2Δ ≤ uf(v,w) < 3Δ • d(v) =d(w) • uf(w,v) ≥ 3Δ • Define new length function ℓ* that: • = zero on special arcs • = ℓ on all other arcs • dℓ* = dℓ • The algorithm determines admissible graph A(f, ℓ*, dℓ) instead of A(f, ℓ, dℓ)

  48. 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

  49. 12 16 20 9 T 4 S 10 7 4 13 14 Example 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 • n = 6, m = 10 • U = 20 • F = 29 • α = min{m½, n ⅔ } = 4 • Δ = F /α=8

  50. 12 1 1 4/12 2 1 2 1 Gf : Af : 1 1 4/16 1 16 20 4/20 1 1 1 9 0 0 4 3 3 10 7 1 1 4 1 1 4/4 13 4/13 1 1 1 1 2 1 2 1 14 4/14 Example (cont.) 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 F = 29.Δ=8

More Related