1 / 55

Lecture 16

Lecture 16. Max Flows 3 Preflow-Push Algorithms. Review. The Ford Fulkerson Maximum Flow Algorithm. Begin x := 0; create the residual network G(x); while there is some directed path from s to t in G(x) do begin let P be a path from s to t in G(x); ∆ := δ (P);

lars-sutton
Download Presentation

Lecture 16

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. Lecture 16 Max Flows 3 Preflow-Push Algorithms

  2. Review

  3. The Ford Fulkerson Maximum Flow Algorithm • Begin x := 0; • create the residual network G(x); • while there is some directed path from s to t in G(x) do • begin • let P be a path from s to t in G(x); • ∆:= δ(P); • send ∆ units of flow along P; • update the r's; • End • end {the flow x is now maximum}.

  4. e(3)=1

  5. Exact distance: d(i) equals the length of the shortest path from node i to node t in G(x)

  6. The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem

  7. Preflow Push 4 2 5 1 3 1 1 2 4 s 4 t 3 2 1 3 This is the original network, and the original residual network.

  8. 5 4 3 2 1 0 Initialize Distances 4 2 2 5 1 1 3 1 1 2 4 2 s 1 4 t 0 3 2 2 s 1 3 4 5 1 3 t The node label henceforth will be the distance label. d(j) is at most the distance of j to t in G(x)

  9. 5 4 3 2 1 0 Saturate Arcs out of node s 3 s 4 2 2 2 1 5 1 3 1 1 2 4 6 s 2 4 1 1 0 t 3 2 2 2 s s 2 1 3 3 4 4 5 1 3 1 t 3 Saturate arcs out of node s. Move excess to the adjacent arcs Relabel node s after all incident arcs have been saturated.

  10. 5 4 3 2 1 0 Select, then relabel/push 3 s 4 2 2 2 1 5 1 3 1 1 2 4 s 2 6 1 1 4 t 0 3 2 2 s s 2 1 3 4 5 1 3 1 1 t 3 1 Select an active node, that is, one with excess Push/Relabel Update excess after a push

  11. 5 4 3 2 1 0 Select, then relabel/push 3 s 4 2 2 2 1 5 1 3 1 1 2 4 2 6 s 1 4 1 t 0 3 2 s 3 s 2 1 3 3 4 5 2 2 1 3 1 1 t 1 Select an active node, that is, one with excess No arc incident to the selected node is admissible. So relabel.

  12. 5 4 3 2 1 0 Select, then relabel/push 3 s 4 2 2 2 1 5 1 3 1 1 2 4 s 6 2 1 1 4 t 0 3 2 3 s 3 s 3 2 1 4 5 2 2 2 2 t 1 1 Select an active node, that is, one with excess Push/Relabel

  13. 3 3 5 4 3 2 1 0 Select, then relabel/push 3 s 4 1 2 2 2 2 2 1 5 1 3 1 3 1 1 2 4 6 2 s 1 4 1 0 t 3 2 2 3 s s 3 2 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  14. 5 4 3 2 1 0 Select, then relabel/push 2 3 s 4 1 2 2 2 2 1 1 5 3 1 3 1 1 2 4 s 6 2 4 1 1 t 0 3 2 s 3 s 3 2 1 4 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  15. 5 4 3 2 1 0 Select, then relabel/push 3 2 s 4 1 2 2 2 2 5 1 2 1 3 1 3 1 1 2 4 6 2 s 1 4 1 t 0 3 2 s s 3 5 2 3 1 4 5 5 2 2 2 t 1 1 Select an active node. There is no incident admissible arc. So Relabel.

  16. 5 4 3 2 1 0 Select, then relabel/push 1 3 2 s 4 1 2 2 2 2 5 2 2 1 3 1 3 1 1 2 4 s 6 2 1 4 1 0 t 3 2 3 s s 5 3 2 4 1 4 2 2 2 t 1 1 Select an active node. Push/Relabel

  17. 5 4 3 2 1 0 Select, then relabel/push 3 1 2 s 4 1 2 2 2 2 1 2 2 3 5 3 1 3 1 1 2 4 5 6 s 2 1 1 4 0 t 3 2 s s 3 5 5 3 4 2 1 4 2 2 2 t 1 1 Select an active node. There is no incident admissible arc. So relabel.

  18. 5 4 3 2 1 0 Select, then relabel/push 3 1 2 s 4 1 2 2 2 2 2 1 2 3 3 5 3 1 3 1 1 2 4 5 2 s 6 1 1 4 t 0 3 2 3 s s 2 4 3 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  19. 5 4 3 2 1 0 Select, then relabel/push 1 s 4 2 2 2 2 2 5 2 3 1 3 2 2 1 3 1 1 2 4 5 6 s 2 1 4 1 1 1 0 t 3 2 s 3 s 2 3 4 4 1 4 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  20. 5 4 3 2 1 0 Select, then relabel/push 1 s 4 2 2 2 2 2 4 2 5 3 3 2 2 1 2 1 3 1 2 1 2 4 5 s 6 2 4 1 1 0 t 3 2 2 s s 3 2 3 4 4 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  21. 5 4 3 2 1 0 Select, then relabel/push 1 s 4 2 2 4 2 2 4 2 2 1 2 3 3 5 2 1 3 1 2 1 2 4 5 s 2 6 1 4 1 t 0 3 3 s s 2 3 4 4 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  22. 5 4 3 2 1 0 Select, then relabel/push 1 s 4 1 4 2 2 2 4 2 5 1 3 5 2 3 3 2 5 3 1 3 1 2 1 2 4 5 5 s 6 2 1 4 1 0 t 3 3 s s 4 3 2 4 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

  23. 5 4 3 2 1 0 Select, then relabel/push 1 s 4 1 4 2 2 2 4 2 5 1 3 5 2 3 3 2 5 3 1 3 1 2 1 2 4 5 5 s 6 2 1 4 1 0 t 3 3 s s 4 3 2 4 1 4 5 5 2 2 2 t 1 1 One can keep pushing flow between nodes 2 and 5 until eventually all flow returns to node s. There are no paths from nodes 2 and 5 to t, and there are ways to speed up the last iterations.

More Related