1 / 32

UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2001

UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2001. Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network Flows, Case Study. Network Flow. Chapter 26. Basic Network Flow Concepts. Network Flow. edge weights. source.

sovann
Download Presentation

UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2001

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. UMass Lowell Computer Science 91.503Analysis of AlgorithmsProf. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network Flows, Case Study

  2. Network Flow Chapter 26

  3. Basic Network Flow Concepts

  4. Network Flow edge weights source Goal: compute second set of edge weights <= capacities. sink weighted network flow in = flow out (except at source, sink) flow direction source: Sedgewick, Graph Algorithms

  5. Network Flow Applications • Distribution Problems • move objects from place to place within network • examples: • merchandise • communications • traffic flow source: Sedgewick, Graph Algorithms

  6. Network Flow Applications (continued) • Matching Problems • network represents ways to connect vertices • goal: choose connections to • cover vertex set • only touch each vertex once • examples: • job placement • minimum-distance point matching (2 point sets) source: Sedgewick, Graph Algorithms

  7. Network Flow Applications(continued) • Cut Problems • remove edges to cut network into >= 2 pieces • examples: • network reliability • cutting supply lines source: Sedgewick, Graph Algorithms

  8. Flow Definitions • Flow network G = (V,E) • directed graph • each edge (u,v) in E has capacity c(u,v) >= 0 • every vertex is on some path from source s to sink t • G is connected • |E| >= |V| - 1 source: 91.503 textbook Cormen et al.

  9. Flow Properties • Flow in G is f: VxV -> R satisfying: • Capacity Constraint: • Skew Symmetry: • Flow Conservation: • f(u,v) is net flow from vertex u to vertex v • positive net flow entering vertex v: • positive net flow entering a vertex other than source or sink must = positive net flow leaving the vertex • Value of a flow f is total net flow out of source: source: 91.503 textbook Cormen et al.

  10. Flow Properties (continued) • Lemma 26.1 • Let G=(V,E) be a flow network, and let f be a flow in G. Then: • Implicit summation notation: Exercise: show source: 91.503 textbook Cormen et al.

  11. Flow Properties (continued)Flow Equilibrium D = amount of flow out of right set (and not into left set) B = amount of flow out of left set (and not into right set) C = amount of flow into right set from outside left set A = amount of flow into left set from outside right set x = amount of flow into right set from left set y = amount of flow into left set from right set EQUILIBRIUM requires A + x = B + y C + y = D + x A + C = B + D source: Sedgewick, Graph Algorithms

  12. Controlling Network Flow open switches along path < 0,2,4,5> open switches along path < 0,1,3,5> change switch at 1 to redirect flow to fill 1-4; add flow on < 0,2,3,5 > (maxflow results) source: Sedgewick, Graph Algorithms

  13. Augmenting Paths

  14. Augmenting Flow on a Path 2 2 1 1 2 2 increase flow in <0,2> increase flow in <2,3> decrease flow in <1,3> flow increases from 3 to 4 1 1 2 divert to <1,4>,<4,5> source: Sedgewick, Graph Algorithms

  15. Augmenting Path Sequences source: Sedgewick, Graph Algorithms

  16. Residual Networks

  17. Residual Networks min capacity on augmenting path flow network G and flow f residual network Gf and augmenting path augmented flow in Gf augmented flow in G source: 91.503 textbook Cormen et al.

  18. Residual Networks source: Sedgewick, Graph Algorithms

  19. Cuts

  20. s-t Cut Disconnects source from sink source: Sedgewick, Graph Algorithms

  21. MaxFlow MinCut Theorem • If f is a flow in a flow network G=(V,E) with source s and sink t, then, equivalently: • 1. f is a maximum flow in G • 2. The residual network Gf contains no augmenting paths • 3. |f| = c(S,T) for some cut (S,T) of G source: 91.503 textbook Cormen et al.

  22. MaxFlow MinCut TheoremProof Layout Lemma 26.1 Lemma 26.2 Lemma 26.3 Eq 26.4 Eq 26.6 Lemma 26.5 (2) -> (3) Corollary 26.4 (1) -> (2) Corollary 26.6 (3) -> (1) MaxFlow MinCut Theorem 26.7

  23. Ford-Fulkerson MaxFlow Method

  24. General Approach source: 91.503 textbook Cormen et al.

  25. With Residual Networks source: 91.503 textbook Cormen et al.

  26. source: 91.503 textbook Cormen et al.

  27. Analysis Q(E) time Time depends on method termination? Q( |maxf | ) iterations, assuming integral capacities Each iteration of while loop can be executed in O(E) time = time to find path in residual network using BFS or DFS Total time = Q( E |maxf | ) assuming integral capacities source: 91.503 textbook Cormen et al.

  28. Shortest Augmenting PathsEdmonds-Karp source: Sedgewick, Graph Algorithms

  29. Shortest Augmenting PathsEdmonds-Karp • Time is in O(VE2): • Each iteration of while loop takes time in O(E) • Number of iterations is in O(VE) • Shortest-path distance in residual network increases monotonically with each flow augmentation • Total number of augmentations is in O(VE) • Proof Sketch: • Edge in residual network is critical on augmenting path if residual capacity of path is residual capacity of (u,v) • Critical edge disappears from residual network • Critical edge reappears only if net flow from u to v is decreased; happens only if (v,u) appears later on another augmenting path • From time (u,v) becomes critical to time it next becomes critical, distance of u from source increases by >= 2 • (u,v) becomes critical at most O(V) times

  30. Graph Algorithms Research Case Study

  31. Case Study LiteratureWu, Li [1999]

  32. Case Study LiteratureWu, Li [1999] • Board work • In-class exercise

More Related