Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.

Slides:



Advertisements
Similar presentations
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Advertisements

1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
(0,1)-Matrices If the row-sums of a matrix A are r 1, …,r k, then we shall call the vector r:=(r 1,r 2, …,r k ) the row-sum of A, and similarly for the.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
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 
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network.
1 Maximum flow problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.
1 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method Maximum bipartite matching.
The max flow problem
Feasible Flow Network : A digraph with a nonnegative capacity c(e) on each edge e and a distinguished source node s and sink node t. Flow: A flow f assign.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Maximum flow Algorithms and Networks. A&N: Maximum flow2 Today Maximum flow problem Variants Applications Briefly: Ford-Fulkerson; min cut max flow theorem.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
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.
Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Flow Networks & Flows.
Chapter 7 April 28 Network Flow.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Exercise 6.1 Find the number of different shortest paths from point A to point B in a city with perfectly horizontal streets and vertical avenues as shown.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
1 Network Flow CSC401 – Analysis of Algorithms Chapter 8 Network Flow Objectives: Flow networks –Flow –Cut Maximum flow –Augmenting path –Maximum flow.
Fall 2003Maximum Flow1 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 
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Flow A flow f for a network N is is an assignment of an integer value f(e) to each edge e that satisfies the following properties: Capacity Rule: For each.
Network Flow What is a network? Flow network and flows
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Algorithms and Networks Hans Bodlaender
Network flow problem [Adapted from M.Chandy].
Richard Anderson Lecture 23 Network Flow
Network Flow 2016/04/12.
Edmonds-Karp Algorithm
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Network Flow and Connectivity in Wireless Sensor Networks
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Flow Networks General Characteristics Applications
Algorithms (2IL15) – Lecture 7
Flow Feasibility Problems
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Lecture 22 Network Flow, Part 2
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

Maximum Flow

p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u

p3. Maximum-flow problem Given a flow network G with source s and sink t, we wish to find a flow of maximum value from s to t s v4v4 v2v2 v3v3 v1v1 t

p4. positive net flow entering a vertex v: Networks with multiple source and sinks: s1s1 s’ s2s2 s3s3 s4s4 s5s5 t3t3 t1t1 t2t2 t’ s1s1 s2s2 s3s3 s4s4 s5s5 t3t3 t1t1 t2t2 

p5. Lemma 1 X Y Z X Y

p6. Lester Randolph Ford, Jr. (born September 23, 1927) is an American mathematician Delbert Ray Fulkerson (August 14, January 10, 1976) Ford-Fulkerson method Residual networks

s v4v4 v2v2 v3v3 v1v1 t 11/16 8/13 101/4 4/9 12/12 7/7 11/14 4/4 15/20 (a) Flow network s v4v4 v2v2 v3v3 v1v1 t (b) Residual network

s v4v4 v2v2 v3v3 v1v1 t 11/16 12/13 101/4 9 12/12 7/7 11/14 4/4 19/20 (c) Flow network s v4v4 v2v2 v3v3 v1v1 t (d) Residual network

p9. Lemma 2 Pf :

p10. Augmenting paths (special paths): Given a flow network G=(V,E) and a flow f an augmenting path p is a simple path from s to t in the residual network G f

p11. Lemma3: Cor4:

s v4v4 v2v2 v3v3 v1v1 t (a) 12 s v4v4 v2v2 v3v3 v1v1 t 4/ /9 7 4/14 4/4 20 4/12

s v4v4 v2v2 v3v3 v1v1 t 11/ /10 4 4/9 7/7 11/14 4/4 7/20 4/12 (b) s v4v4 v2v2 v3v3 v1v1 t

(c) s v4v4 v2v2 v3v3 v1v1 t 11/16 8/13 101/4 4/9 7/7 11/14 4/4 15/20 12/12 s v4v4 v2v2 v3v3 v1v1 t

(d) s v4v4 v2v2 v3v3 v1v1 t 11/16 12/13 101/4 9 7/7 11/14 4/4 19/20 12/12 s v4v4 v2v2 v3v3 v1v1 t

s v4v4 v2v2 v3v3 v1v1 t (e)

The basic Ford-Fulkerson algorithm st M M M M 1

p18. Edmonds-Karp algorithm Implement the computation of the augmenting path p with a breadth-first search. That is the augmenting path is a shortest path from s to t in the residual network, where each edge has unit distance.

p19. Cuts of flow networks A cut(S,T) of flow network G=(V,E) is a partition of V into S and T=V-S such that The net flow across the cut(S,T) is defined to be f(S,T). The capacity of the cut(S,T) is c(S,T) Eg: s v4v4 v2v2 v3v3 v1v1 t ST

p20. Lemma 5 Pf:

p21. Cor6 Pf:

p22. Thm7 (Max-flow min-cut theorem) Pf:

p23.

p24. Thm 7.2. If all the capacities in a flow network are integers, then there is a maximum flow f for which f(e) is an integer for all edge e. Thm 7.3. Let A be a b × v (0,1)-matrix with k 1’s per row and r 1’s per column (so bk=vr). Let R be a rational number, 0<R<1, such that k’=Rk and r’=Rr are integers. Then there is a (0,1)-matrix A’ of size b × v with k’ 1’s per row and r’ 1’s per column such that A’ is obtained from A by changing some 1’s into 0’s.

p25. b=6, v=3, k=2, r=4, k’=1, r’= A = A’=

p26. Proof of Thm 7.3. Construct a flow network from A with s and t and associate a vertex with each row and column. There is a max flow with all edges saturated. Change the capacities from k to k’ and r to r’. All the capacities are integers and there is a max flow for which all f(x i,y j )=R. By Thm 7.2 there exists an integer max flow, such that f*(x i,y j )= 0 or 1. From this max flow, we find the required A’. □ s t x1x1 xbxb y1y1 yvyv k k 1 r r c(x i,y j )=1 iff a ij =1.

p27. Def: A circulation on a digraph D is a mapping f from E(D) to the reals satisfying conservation of flow at every vertex. Thm 7.4. Let f be a circulation on a finite graph D. Then there exists an integral circulation g such that for every edge e, g(e) is equal to one of  f(e)  or  f(e) . Pf: Given a circulation f, consider a circulation g satisfying (*)  f(e)   g(e)   f(e)  and for which the number of edges e with g(e) an integer is as large as possible. Let H be the spanning subgraph of D with edge set consisting of those edges of D for which g(e) is not an integer.

p28. Proof continue Conservation of flow implies that no two vertex can have degree 1 in H, so if g is not integral, then H contains a cycle. Let P be a polygon in H and traverse P with a simple closed path; let A be the set of edges of P that are forward edges of the path in D, and B the set of edges of P that are backward edges in this path. For any constant c, we obtain a new circulation g’: g’(e) = (1) g(e)+c if e is in A, or (2) g(e)-c if e is in B, or (3) g(e) if e is not in E(P). If c is small then (*) still hold with g replaced by g’. Choose c= min{ min e in A (  f(e)  -g(e)), min e in B ( g(e)-  f(e)  )}. Then g’ still satisfies (*), yet g’(e) is an integer for at least one more edge. Contradict the choice of g.  +c - c

Corollary: Let f be an integral circulation on a finite digraph D and d any positive integer. Then f can be written as the sum g 1 +g g d of integral circulations such that for each index j and each edge e, (**)  f(e)/d   g j (e)   f(e)/d . Pf: By induction on d. For d=1, trivial. Given d  2, apply Thm 7.4 to f/d to find an integral circulation g 1 satisfying (**) for j=1. Apply the induction hypothesis to find f - g 1 =g g d where for each j=2,...,d, g j is an integral circulation satisfying  (f(e)-g 1 (e))/(d-1)   g j (e)   (f(e)-g 1 (e))/(d-1) . It is easy to see that if a is an integer and b is either  a/d  or  a/d , then  a/d    (a-b)/(d-1)  and  (a-b)/(d-1)    a/d , so that the above inequalities imply (**) for j=2,3,...,d. □

Thm 7.5: (1) Given a matrix A and a real number c, there is an integral matrix B so that the entries of B, the row-sums of B, the column-sums of B and the sum of all entries of B, are the corresponding values for cA rounding up or down. (2) If A is an integral matrix and d any positive integer, then A= B B d, where each B i is an integral matrix whose entries, row-sums, column-sums, and sum of all entries, are those of (1/d)A, rounding up or down A= B= s t