Download presentation
Presentation is loading. Please wait.
1
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Algorithm that allows ππ₯(π£)>0 (conservation of flow not maintained) before completion. For ease of exposition, take (i) π’π€π£=π₯π€π£=0 if π£π€βπΈ and π€π£βπΈ (conceptual device, donβt make actual arc) (ii) Define auxiliary digraph πΊ(π₯) as before, but do not bother with parallel arcs, i. e., we put π£π€βπΈ(πΊ(π₯)) iff π₯π€π£>0 or π₯π£π€<π’π£π€. If π£π€βπΈ(πΊ(π₯)), up to π’ π£π€ =π’π£π€βπ₯π£π€+π₯π€π£ can be βpushedβ from π£ to π€ (residual capacity of π£π€) (increase π₯π£π€ to π’π£π€ and decrease π₯π€π£ to 0 ) Combinatorial Optimization 2016
2
We call π₯ a preflow if it satisfies ππ₯(π£)β₯0 for all π₯βπβ{π, π }
Definitions: We call π₯ a preflow if it satisfies ππ₯(π£)β₯0 for all π₯βπβ{π, π } feasible preflow if it also satisfies 0β€π₯β€π’ push on π£π€ : For pair (π£, π€) with π’ π£π€ >0 and ππ₯(π£)>0, pushing up to ο₯ = min ( π’ π£π€ , ππ₯(π£)) from π£ to π€. (it produces new feasible preflow ) (If both π£π€ and π€π£ are arcs of πΊ and ο₯< π’ π£π€ , we decrease π₯π€π£ first as much as possible, then increase π₯π£π€ ) (pushing 2 units on ab) π π 3,3 4,0 3,3 4,0 π 4,1 1,0 π π 4,0 1,1 π 4,4 2,1 4,4 2,1 π π Combinatorial Optimization 2016
3
We call π£βπβ{π, π } active if ππ₯(π£)>0 (has positive net flow) Idea:
Definitions: We call π£βπβ{π, π } active if ππ₯(π£)>0 (has positive net flow) Idea: choose an active node and push flow toward sink. difficulties order of selection pushing on π£π€, then π€π£, ... causes infinite loop. Possible to have situation that we cannot push toward sink, but there are still active nodes. retreat to restore conservation of flow to identify the direction of push, use estimate of distances to π in πΊ(π₯). Combinatorial Optimization 2016
4
for every arc π£π€ of πΊ(π₯), π(π£)β€π(π€)+1
We say vector πβ( π + βͺ{β})π is a valid labelling with respect to a preflow π₯ if π(π)=π, π(π )=0 (3.14) for every arc π£π€ of πΊ(π₯), π(π£)β€π(π€)+1 (Recall that ππ₯(π£, π€) denotes the number of arcs in a shortest (π£, π€) dipath in πΊ(π₯). π(π£)= π π₯ (π£, π ) satisfies all conditions except π(π)=π.) (Note that β π, 0<π<π such that π(π£)β π for all π£βπ.) Valid labelling gives an estimate of the shortest distance of the node π£ to π in πΊ(π₯). Given an active node π£, we try to push excess flow to the node closer to π using the valid label as estimate. However, valid labelling may not exist for some feasible preflow. So, start with some feasible preflow and valid labelling which we can easily identify and maintain the validity of labelling. Combinatorial Optimization 2016
5
Put π₯π=π’π for all arcs π having tail π π₯π=0 for all other arcs πβπΈ
Constructing initial feas. preflow and valid labelling (initialize π₯, π) Put π₯π=π’π for all arcs π having tail π π₯π=0 for all other arcs πβπΈ Put π(π)=π, π(π£)=0 for all other nodes π£βπ (Assume each π’ππ£ β β (HW)) (1,0) π π (Initialize π₯, π) (1,0) (1,1) (1,0) (3,0) (3,0) π π 6 (4,4) (4,0) (1,0) π π (1,0) Combinatorial Optimization 2016
6
(feasible preflow and valid labelling saturates a cut)
Prop 3.22: If π₯ is a feasible preflow and π is a valid labelling for π₯, then there exists an (π, π )-cut ο€(π
) such that π₯π£π€=π’π£π€ for all π£π€βο€(π
) and π₯π£π€=0 for all π£π€βο€( π
). (feasible preflow and valid labelling saturates a cut) (pf) There exists π, 0<π<π, such that π(π£)β π for all π£βπ. Take π
={π£βπ: π(π£)>π}. Then πβπ
and π βπ
. (3.14) implies that no arc of πΊ(π₯) leaves π
. ο Cor 3.23: If a feasible flow π₯ has a valid labelling, then π₯ is a maximum flow. Consider the duality relation with augmenting path algorithm. (Augmenting path alg. Maintains feasible flows and stops when a saturated cut is found, while push-relabel alg. maintains saturated cuts and stops when the flow becomes feasible.) In what sense a valid labelling gives an approximation to distances in πΊ(π₯)? Lemma 3.24: For any feasible preflow π₯, and any valid labelling π for π₯, we have ππ₯(π£,π€)β₯π π£ βπ(π€), for all π£, π€βπ. (pf) If ππ₯(π£, π€)=β, true. So suppose ππ₯(π£, π€) finite. Consider any shortest (π£, π€) dipath in πΊ(π₯). Add inequality π(π)βπ(π)β€1 on the arcs ππ on the dipath. ο Combinatorial Optimization 2016
7
π(π£) is a lower bound on ππ₯(π£, π ) π π£ βπ is a lower bound on ππ₯(π£, π)
Observations: π(π£) is a lower bound on ππ₯(π£, π ) π π£ βπ is a lower bound on ππ₯(π£, π) If π(π£)β₯π, it means ππ₯(π£, π )=β, and excess flow at π£ should be moved toward the source π. Think π(π£) as height of node π£ in a liquid flowing network using gravity. At a node with excess flow, we try to move flow toward nodes π€ having π(π€)<π(π£). π(π€)<π(π£) and π£π€ is an arc of πΊ(π₯) β π π€ =π π£ β1 (We have π(π£)β€π(π€)+1 for a valid labelling) β push the preflow only on the arc π£π€ in πΊ(π₯) with π(π£)=π(π€)+1. (admissible arc) Note that push does not affect the validity of the labelling (a possible new arc π€π£ in πΊ(π₯) satisfies π(π€)β€π(π£)+1.) If π£ active, but no π£π€ in πΊ(π₯) with π(π£)=π(π€)+1 β increase π(π£) to min (π(π€)+1: π£π€βπΈ(πΊ(π₯)) (labelling still valid) ; relabel Combinatorial Optimization 2016
8
Push-Relabel Algorithm
Process π While there exists an admissible arc π£π€ Push on π£π€; If π£ is active Relabel π£. Push-Relabel Algorithm Initialize π₯, π; While π₯ is not a flow Choose an active node π£; Process π£. Combinatorial Optimization 2016
9
Modification on basic form:
Maximum distance push-relabel algorithm - Choose active node π£ whose distance label π(π£) is maximum. Bounds on the number of operations Thm 3.25: Push-relabel algorithm performs π( π 2 ) relabels and π(π π 2 ) pushes. Thm 3.26: The maximum distance push-relabel algorithm performs π( π 2 ) relabels and π( π 3 ) pushes. Lemma 3.27: If π₯ is a preflow and π€ is an active node, then there is a π€,π -dipath in πΊ(π₯). (pf) Let π
denote the set of nodes π£ for which there is a (π£,π)-dipath in πΊ(π₯). Then no arc leaves π
in πΊ(π₯), so π₯ πΏ π
=0. But suppose that we add the inequalities π π₯ (π£)β₯0 for all π£β π
. Then, we get π₯ πΏ π
βπ₯(πΏ π
)β₯0. With π₯ πΏ π
=0, this implies π₯ πΏ π
=0, hence have π π₯ π£ =0 for all π£β π
. That is there is no active node in π
, so active π€βπ
, as required. ο Combinatorial Optimization 2016
10
(2) nonsaturating push: π£ is no longer active: π(ππ2)
Lemma 3.28: At every stage of the push-relabel algorithm, for every π£βπ, we have π π£ β€2πβ1. Each node is relabelled at most 2πβ1 times, and there are π( π 2 ) relabels in all. (pf) Since each relabel of π£ increases π(π£) by at least 1, the second statement follows from the first. Since only active nodes are relabelled, enough to prove the first statement for π£ active. By Lemma 3.27, π π₯ π£,π β€πβ1. By Lemma 3.24, π π₯ π£,π β₯π π£ βπ. Combining these two inequalities gives π π£ β€2πβ1. ο Pushes: (1) saturating push : π’ π£π€ β€ππ₯(π£), value pushed is π’ π£π€ , π£π€ leaves πΊ(π₯): β€2ππ (2) nonsaturating push: π£ is no longer active: π(ππ2) β total π(ππ2) pushes (Pf): reading assignment Combinatorial Optimization 2016
11
Lemma 3.31: The maximum distance push-relabel algorithm performs π(π3) nonsaturating pushes. (β total π(π3) pushes) (pf) Any nonsaturating push from a node π£ makes π£ inactive, and π£ cannot become active again before there is a relabel, since all active nodes π€ has π(π€)β€π(π£). Hence, if there are π nonsaturating pushes with no relabel, there is no active node and the algorithm terminates. Therefore, the number of nonsaturating pushes is less than π times the number of relabels, so by Lemma 3.28, it is π( π 3 ). ο Tuncel(1994): max distance push-relabel algorithm requires only π π 2 π pushes. Combinatorial Optimization 2016
12
(Implementation of Push-Relabel Algorithms)
For each π£, we keep list πΏπ£ of pairs π£π€ such that π£π€ or π€π£ (or both) is an arc of πΊ (possible arcs in πΊ(π₯)) For each π£π€ in πΏπ£, keep π’ π£π€ . Keep links between π£π€βπΏπ£ and π€π£βπΏπ€ (update residual capacity on π£π€ and π€π£ in constant time) For each π£, keep π(π£) and ππ₯(π£) Each relabel of node π£ takes π πΏπ£ : Each push on π£π€ takes constant time once the arc is selected for push. Total time looking for admissible arcs and determining whether it is time to relabel? Combinatorial Optimization 2016
13
Lemma 3.32: Suppose π£βπ is active and arc π£π€ is not admissible.
Then before π£π€ becomes admissible, there will be a relabel of π£. (pf) If π£π€ not admissible, then (1) π(π£)β€π(π€) or (2) π’ π£π€ =0. In the case of (2), need push on π€π£ before π£π€ becomes admissible, which needs π(π€)=π(π£)+1, i.e. π(π£)β€π(π€). Hence need relabel of π£ before π£π€ becomes admissible. ο Processing of π£ results in (1) relabelling of π£ or (2) push that makes π£ inactive. If case (2), when we process node π£ again, we do not need to push on the arcs that became inadmissible earlier by Lemma 3.32. Hence, remember the current element of πΏπ£ where we stopped scanning, and start from that point when we process node π£ again. β relabel node π£ when and only when a traversal of πΏπ£ is completed. Combinatorial Optimization 2016
14
=> Total time spent looking for admissible arcs is
π£ can be relabeled at most 2πβ1 times (Lemma 3.28), hence only need π(π) traversal of πΏπ£. => Total time spent looking for admissible arcs is π(Ξ£(π| πΏ π£ |: π£βπ))=π(ππ) Total time spent on relabel is the same, since each relabel of π£ takes π(|πΏπ£|). Let π be the number of pushes. Total time spent on choosing the next active node is π(π+π2) since each one leads to a push or a relabel. (For general algorithm, maintain list of active nodes) Total time for general algorithm is π(π2π) Combinatorial Optimization 2016
15
For maximum distance push-relabel algorithm, not sure if choosing the next active node can be done in constant time. (may need π(π) if we use list) Maintain doubly linked list π·π for the (active) nodes π£ s.t. π(π£)=π. Also maintain pointer for node π£ to its position in π·π. If a node is relabelled, we remove it from its list and insert it into its new list. If we use max distance rule, after π£ is relabeled, it still has max distance. If π£ becomes inactive and π·π empty, there almost always exists π€ with π(π€)=πβ1 and active (unless π€=π), so can look at π· πβ1 . Some abnomalities can be handled with bounds. Thm 3.34: Maximum distance push-relabel max flow algorithm can be implemented to run in time π(π3). Practical enhancement: Periodically (say, after a sequence of π/2 node processing steps) compute a largest valid labeling for the current preflow. Combinatorial Optimization 2016
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.