Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap. 26 Maximum Flow 26.5 The relabel-to-front algorithm

Similar presentations


Presentation on theme: "Chap. 26 Maximum Flow 26.5 The relabel-to-front algorithm"— Presentation transcript:

1 Chap. 26 Maximum Flow 26.5 The relabel-to-front algorithm
Presenter: Wu YongShou From: Multimedia Networking lab Date: April 26, 2008

2 Definitions[1/5] Definition
List: list consisting of all vertices in V-{s,t} Neighbor list: Neighbors of the vertex

3 Neighbor lists[2/5] Neighbor List: N(x) Head[N[x]] Current(X)
Next-neighbor(X)

4 Admissible edges and networks[3/5]
(u,v)is admissible if 1) cf(u,v)>0 2) h(u)=h(v)+1 cf=capacity-flow We can deal with the excess flow through admissible edge Admissible means there can be a flow

5 Relabel, Push[4/5] Relabel: adjust height Push

6 Admissible edges and networks[5/5]
Admissible network is , where is set of admissible edges This network is consists of these edges through which flow can be pushed

7 Lemma [1/4] If is a flow network, f is a preflow in G, and h is a height function on G, then the admissible network is acyclic The admissible network is acyclic

8 Lemma [2/4] Let V=(V,E) be a flow network, let f be a preflow in G, and suppose that the attribute h is height function. If a vertex u is overflowing and (u,v) is an admissible network, then Push(u,v) applies. The operation does not create any new admissible edge, but it may cause (u,v) to became inadmissible. Push makes no admissible edge, but may make edge inadmissible

9 Lemma [3/4] If (u,v) is admissible after relabel, then h(v)=h(u)+1 So before relabel h(v)>h(u)+1 By lemma no residual edges exist between vertices whose height differ more than 1 So contradicted Let G=(V,E) be a flow network, let f be a preflow in G, and suppose that the attribute h is a height function. If a vertex u is overflowing and there are no admissible edges leaving u, then relabel(u) applies. After the relabel operation, there is at least one admissible edge leaving u, but there are no admissible edges entering u. The lamma says: if vertex y is overflowing and there are no admissible edge, then relabel operates after relabel, there is at least one admissible edge leaving y and no admissible edge entering y

10 Discharging an overflowing vertex
DISCHARGE(u) While(e[u]>0) Do v current[u] if v=NIL then Relabel(u) current[u]head[N[u]] elseif cf(u,v)>0, h[u]=h[v]+1 then push(u,v) else current[u] next-neighbor[v] If there is admissible edge, then push If there is no admissible edge, then go to next neighbor If get to NIL and e(u)>0, then relabel

11 Discharging an overflowing vertex[1/8]

12 Discharging an overflowing vertex[2/8]

13 Discharging an overflowing vertex[3/8]

14 Discharging an overflowing vertex[4/8]

15 Discharging an overflowing vertex[5/8]

16 Discharging an overflowing vertex[6/8]

17 Discharging an overflowing vertex[7/8]

18 Discharging an overflowing vertex[8/8]

19 Lemma [4/4] 1. If discharge calls Push(u,v) in line 7, then a push operation applies to u. 2. If discharge calls Relabel(u) in line 4, then a relabel operation applies to u DISCHARGE(u) While(e[u]>0) Do v current[u] if v=NIL then Relabel(u) current[u]head[N[u]] elseif cf(u,v)>0, h[u]=h[v]+1 then push(u,v) else current[u] next-neighbor[v] 1. Self evident 2. Need to prove: by the time of relabel, all edges leaving u is inadmissible - relabel(u) means u is overflowing - from 6,7,8 line we can see that by the time relabel, all edges are inadmissible

20 The relabel-to-front algorithm
We maintain a linked list consisting of all vertices in v-{s,t} A key property is that the vertices in L are topologically sorted according to admissible network Pseudo code for relabel-to-front algorithm Initialize-Preflow(G,s,t) LV[G]-{s,t} For each vertex u in V[G]-{s,t} do current[u]head[N[u]] Uhead[L] While u!=NIL do old-heighth[u] Discharge(u) if h[u]>old-height then move u to the front of list L unext[u]

21 Main flow of the algorithm
Initialize preflow as push-relabel Discharge vertices one by one

22 The relabel-to-front algorithm[1/6]

23 The relabel-to-front algorithm[2/6]

24 The relabel-to-front algorithm[3/6]

25 The relabel-to-front algorithm[4/6]

26 The relabel-to-front algorithm[5/6]

27 The relabel-to-front algorithm[6/6]

28 Analysis We've already learned the running time of
Relabel operation of each vertex is O(V) Relabel operation of all vertices is O(V2) Theorem The running time of relabel-to-front algorithm on any flow G=(V,E) is O(V3)

29 Proof of the running time
“Phase”: time between two consecutive relabel operation There are O(V2) phases * Each phase consists of at most |V| calls to discharge So running time of discharge is O(V3)

30 Proof of the running time
Bound the Discharge There are three types of operation in Discharge Relabel operation: O(v2) are performed Advanced pointer: O(VE) given by handshaking lemma Push operation: total number of saturating push operation is O(VE) So the running time of Relabel-to-front is therefore O(V3+VE)=O(V3)

31 Conclusion We can solve the maximum flow problem faster than O(V2E) which is the running time of push-relabel algorithm The running time of relabel-to-front algorithm is O(V3), which is asymptotically at least as good as O(V2E), and better for dense network

32 Thank you! ANY QUESTIONS?


Download ppt "Chap. 26 Maximum Flow 26.5 The relabel-to-front algorithm"

Similar presentations


Ads by Google