4/5/05Tucker, Sec. 4.31 Applied Combinatorics, 4rth Ed. Alan Tucker Section 4.3 Graph Models Prepared by Jo Ellis-Monaghan.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Lecture 5: Network Flow Algorithms Max-Flow Min-Cut Single-Source Shortest-Path (SSSP) Job Sequencing.
Linear Programming (LP) (Chap.29)
Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Introduction to Algorithms
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
3/17/2003Tucker, Applied Combinatorics Section 4.2a 1 Network Flows Michael Duquette & Whitney Sherman Tucker, Applied Combinatorics, Section 4.2a, Group.
Bioinformatics III1 We will present an algorithm that originated by Ford and Fulkerson (1962). Idea: increase the flow in a network iteratively until it.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
Maurizio Patrignani seminar on the paper on the single-source unsplittable flow problem authored by Yefim Dinitz Naveen Garg Michel X. Goemans FOCS ‘98.
Lectures on Network Flows
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
04/12/2005Tucker, Sec Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara.
Section 4.2 Network Flows By Christina Touhey. The flow out of a equals the flow into z. Algorithm 1.Make vertex a: (0, ). 2.Scan the first vertex and.
Tucker, Applied Combinatorics, Section 1.4, prepared by Patti Bodkin
Approximation Algorithms
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
3/29/05Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 4.2 Minimal Spanning Trees Prepared by Amanda Dargie and Michele Fretta.
3/24/03Tucker, Section 4.31 Tucker, Applied Combinatorics, Sec. 4.3, prepared by Jo E-M Bipartite GraphMatching Some Definitions X-Matching Maximal Matching.
A B C D The diagram below shows water flowing through a pipework system. The values on the edges are the capacities of water that they.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Lecture 5: Network Flow Algorithms Single-Source Shortest-Path (SSSP) (Dijkstra's Algorithm) Max Flow - Min Cut (Ford-Fulkerson) Job Sequencing.
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
Approximating Market Equilibria Kamal Jain, Microsoft Research Mohammad Mahdian, MIT Amin Saberi, Georgia Tech.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
10. Lecture WS 2006/07Bioinformatics III1 V10: Network Flows V10 follows closely chapter 12.1 in on „Flows and Cuts in Networks and Chapter 12.2 on “Solving.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
CS 361 – Chapter 16 Final thoughts on minimum spanning trees and similar problems Flow networks Commitment: –Decide on presentation order.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
11/21/02CSE Max Flow CSE Algorithms Max Flow Problems.
Approximation Algorithms based on linear programming.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Network Flow.
CS4234 Optimiz(s)ation Algorithms
V12: Network Flows V12 follows closely chapter 12.1 in
Lectures on Network Flows
Maximum Flow 9/13/2018 6:12 PM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.
Network Flow.
Chapter 5. Optimal Matchings
Network Flow 2016/04/12.
Instructor: Shengyu Zhang
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Richard Anderson Lecture 21 Network Flow
Applied Combinatorics, 4th Ed. Alan Tucker
V13 Network Flows This part follows closely chapter 12.1 in the book on the right on „Flows and Cuts in Networks and Chapter 12.2 on “Solving the Maximum-Flow.
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
Max Flow / Min Cut.
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
Network Flow.
Lecture 21 Network Flow, Part 1
Network Flows – Minimum capacities
Applied Combinatorics, 4th Ed. Alan Tucker
Network Flow.
Maximum Flow Problems in 2005.
Presentation transcript:

4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 4.3 Graph Models Prepared by Jo Ellis-Monaghan

4/5/05Tucker, Sec Real World Applications Of Network Flows Maximizing the flow of oil between two cities using a large pipeline network. Maximizing the number of telephone calls possible between two places. Calculating the maximum bandwidth of a computer network.

4/5/05Tucker, Sec k(e) represents the capacity of an edge e in the network. f(e) is how much is actually going along the edge (the flow). s(e) = k(e) – f(e) is the slack on the edge. If s(e) = 0, say e is saturated. In(x) = Set of edges directed into x. Out(x) = Set of edges directed out from x. Source, a = Initial starting vertex. Sink, z = Ending vertex. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 Note: The edge labels are (k(e), f(e)), the capacity and flow on each edge.

4/5/05Tucker, Sec a-z Flow: an integer-valued function f defined on each edge e that satisfies the following conditions: a) b) c) b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6

4/5/05Tucker, Sec Cut: Let denote the set of all edges with vertex This set is known as a cut. Note: denotes the complement of P. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 Bold edges are in the cut. The grey edge is not in the cut since it goes from to P. The dashed line represents the cut. Say is an a-z cut if _________________________________________________

4/5/05Tucker, Sec _________________________________________________ The Capacity of a Cut: Just add up the capacities on the edges going from P to. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 Here,

4/5/05Tucker, Sec An observation: Let P not contain a or z. Since then Note that if x and y are both in P, and there is an edge e from x to y, then f(e) appears on both sides of the equation, so we can cancel it. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 P = {b,d,e}

4/5/05Tucker, Sec This leaves only flows on edges from a vertex in to a vertex in P on the left side of the equation, and only flows out of a vertex in P to a vertex in on the right side. Thus, ( ) For each vertex subset P not containing a or z, The flow into P equals the flow out of P. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 (sum of green-to-blue flows = sum of blue-to-green flows)

4/5/05Tucker, Sec Theorem 1: For any a-z flow f, the flow out of a equals the flow into z. Proof: Let P be all vertices in N except a and z, so. The only flow into P from {a,z} must be from a, since condition (c) forbids flow from z. Similarly by condition (c), all flow out of P must go to z. Thus: _________________________________________________

4/5/05Tucker, Sec _________________________________________________ The Value of an a-z Flow: Just add up the flows on the edges going out of a, or equivalently, going into z. b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 Here, Note,

4/5/05Tucker, Sec Theorem 2: Intuitively, should equal the total flow from which is bounded by. For any a-z flow f and any a-z cut in a network N, _________________________________________________

4/5/05Tucker, Sec Expand the network N by adding a new vertex with an edge of immense capacity, and flow. Note that and z will be in for the resulting cut. Proof: z a’ e’ a P original Edges between P and

4/5/05Tucker, Sec Proof: Continued… Now apply condition ( ) from slide 8 to P in the new network.slide 8 It says that the flow into P, which is at least equals the flow out of P. Thus: z a’ e’ a

4/5/05Tucker, Sec Corollary 2a: For any a-z flow f and any a-z cut in a network N, if and only if: (i)For each edge (ii)For each edge Further, when, f is a maximal flow and is an a-z cut of minimal capacity. _________________________________________________

4/5/05Tucker, Sec Proof: Corollary 2a Recall: The first inequality is an equality—the flow from into P (in the expanded network) equals –if condition (i) holds; so that e’ is the only edge feeding into P, otherwise the flow into P is greater than. _________________________________________________

4/5/05Tucker, Sec The second inequality is an equality—the flow out of P equals –if condition (ii) holds; otherwise it is less. Thus if and only if conditions (i) and (ii) are both true. The last sentence in the corollary follows directly from Theorem 2 Proof: Corollary 2a, continued… _________________________________________________

4/5/05Tucker, Sec By Theorem 2, Thus if Then is as big as possible (say f is a maximum flow), and is as small as possible (say is an a-z cut of minimal capacity). Proof: Corollary 2a, continued… _________________________________________________

4/5/05Tucker, Sec Goal-- Find maximum flows in networks. Method I: Flow paths (Fast and easy, but not necessarily the best) b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 A flow path is just a path from a to z.

4/5/05Tucker, Sec Basic idea Find a flow path and push as much as possible along it. Find another flow path, using only unsaturated edges, and push as much as possible along it. And so on, until you can’t find any more flow paths along unsaturated edges.

4/5/05Tucker, Sec a bd c e z 5,3 6,3 3,3 1,0 6,0 5,0 3,0 Start with 0 flow on all edges. Find a flow path, L 1. Can push 3 units along it. Find another flow path, L 3. Can push 3 units along it. a bd c e z 5,0 6,0 3,0 1,0 6,0 5,0 3,0 a bd c e z 5,3+2 6,3 3,3 1,0 6,2 5,0 3,0 Find another flow path, L 2. Can push 2 units along it. Find another flow path, L 4. Can push 1 unit along it. Can’t do any more, so the flow is f = 3 L L L L 4 a bd c e z 5,3+2 6,3 3,3 1,0 6,2+3 6,2 5,3 3,3 a bd c e z 5,3+2 6,3+1 3,3 1,1 6,2+3 6,2 5,3+1 3,3

4/5/05Tucker, Sec Note--all of the edges have been saturated in the cut, where, and, so And hence by corollary 2a on slide 14, this flow is maximal.slide 14 How do we know…. That we are done? That this is the best possible flow? a bd c e z 5,3+2 6,3+1 3,3 1,1 6,2+3 6,2 5,3+1 3,3 = the sum of the flow out of a.

4/5/05Tucker, Sec Yes, but how would we find the cut in a large messy network? And what if we hadn’t noticed the last flow path and stopped too soon? Also note that we were essentially trying all possible paths from a to z, which isn’t feasible in a large network.

4/5/05Tucker, Sec Label vertex a: [__, ]. 2.Pick a labeled vertex p with label [v *, n], and consider the unlabeled vertices adjacent to it. a. Label a vertex on a incoming edge e by [p -, m], where m = min{n, f(e)} provided that f(e) > 0 b. Label a vertex on an outgoing edge e by [p +, m], where m = min{n, s(e)}, provided that s(e) > 0 If you can’t label any more vertices following the procedure in step 2, (if the edge flows and slacks are all zero), and z is unlabeled, then…. Let P be the set of labeled vertices, and is a saturated a-z cut, so is a minimal cut and f is a maximal flow with by Cor. 2aCor. 2a Augmenting Flow Algorithm

4/5/05Tucker, Sec If z has been labeled, go to step 4. Otherwise, go to step 2. 4.Find an a-z chain * backtracking the labels. Increase the flow in the forward edges from a to z (decrease the flow in the backward edges) m units, where m is the second label on z. 5.Remove all the vertex labels (but not the new edge labels!) and return to step 1. Continue doing this until you get stuck on step 2, which is when you are finished, having found a min cut/max flow. * A chain is just a path along the edges of the graph that doesn’t have to follow the directions of the arrows. Augmenting Flow Algorithm, cont…

4/5/05Tucker, Sec Tip… This algorithm assumes that the original flow is 0 on all the edges, and for a computer program this works just fine. However, if you are finding a max flow by hand, you can reduce the amount of work by starting with a ‘pretty good’ flow constructed from flow paths before implementing the algorithm. In fact, if your ‘pretty good’ flow is actually maximal, the algorithm will confirm this in the first run through (you will get stuck on step 2 before reaching z).

4/5/05Tucker, Sec ,0 7,0 5,0 4,0 12,0 3,0 5,0 4,0 7,0 9,0 Start with 0 flow…. Example a d c f be z K1K1 K2K2 K3K3 4K14K1 + 5K 2 + 4K 3 a c f e z 6,4 7,4 5,0 4,0 4,4 12,9 3,0 5,4 4,4 7,5 9,9 d b Use flow paths to get a ‘pretty good’ flow.

4/5/05Tucker, Sec Apply algorithm 6,4 7,4 5,0 4,0 4,4 12,9 3,0 5,4 4,4 7,5 9,9 a c f e z d b

4/5/05Tucker, Sec Getting… 6,4 7,4 5,0 4,0 4,4 12,9 3,0 5,4 4,4 7,5 9,9 a c f e z d b (_, ∞) (a +, 2) (c +,2) (f +,2) (b +, 2) (d -, 2) (a +, 2) Now backtrack from z to get an a-z chain

4/5/05Tucker, Sec Now augment along the chain from a to z by the amount of the label on z 6,4 7,4 5,0 4,0 4,4 12,9+2 3,0+2 5,4-2 4,4 7,5+2 9,9 a c f e z d b

4/5/05Tucker, Sec Now run the algorithm again on this new flow. 6,4 7,4 5,0 4,0 4,4 12,11 3,2 5,2 4,4 7,7 9,9 a c f e z d b

4/5/05Tucker, Sec ,4 7,4 5,0 4,0 4,4 12,11 3,2 5,2 4,4 7,7 9,9 a c f e z d b Getting… (_, ∞) (c +, 2) (c +,1) (f +,1) (b +, 2) (e +, 2) (a +, 2) Now backtrack from z to get an a-z chain

4/5/05Tucker, Sec ,4+1 7,4+1 5,0 4,0 4,0+1 4,4 12,11+1 3,2+1 5,2 4,4 7,7 9,9 a c f e z d b Now augment along the chain from a to z by the amount of the label on z

4/5/05Tucker, Sec ,5 7,5 5,0 4,0 4,1 4,4 12,12 3,3 5,2 4,4 7,7 9,9 a c f e z d b Now run the algorithm again on this new flow.

4/5/05Tucker, Sec ,5 7,5 5,0 4,0 4,1 4,4 12,12 3,3 5,2 4,4 7,7 9,9 a c f e z d b (_, ∞) (c +, 1) (b +, 1) (e +, 1) (a +, 1) The capacity of the cut is the size of the flow, here =16. Can’t label any more, so let P be the labeled vertices.

4/5/05Tucker, Sec Theorem 3 For any given a-z flow f, a finite number of applications of the augmenting flow algorithm yields a maximum flow. If P is the set of vertices labeled during the final application of the algorithm, then is a minimal a-z cut set.

4/5/05Tucker, Sec If f is the current flow and K is the augmenting a-z flow chain, we must show the new flow f + m K is a legal flow, where m is the label on z. Check that f + m K satisfies the flow conditions:flow conditions So yes, it is a valid flow. Proof of Theorem 3

4/5/05Tucker, Sec Each time we reach z in the algorithm, we augment the flow by a positive integer m, increasing the flow along some edges. But the capacities on the edges (and the number of edges) is finite, so eventually the algorithm must get stuck on step 2, failing to label z. Proof of Theorem 3 (cont.)

4/5/05Tucker, Sec Proof of Theorem 3 (cont.) Let P be the set of labeled vertices when z is not labeled. Clearly is an a-z cut since a is labeled and z is not.

4/5/05Tucker, Sec There is no edge with non-zero slack (i.e. where the flow on the edge doesn’t equal the capacity) from any labeled vertex p to any unlabeled vertex q or else q would have been labeled.labeled Thus, by Cor. 2a, is minimal and the flow is maximal.Cor. 2a Proof of Theorem 3 (cont.)

4/5/05Tucker, Sec b a d c z e 8,8 5,5 4,3 4,0 5,5 3,2 4,1 7,6 7,4 8,6 Class exercise—apply augmenting flow algorithm.