Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u."— Presentation transcript:

1 Maximum Flow

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

3 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 16 13 104 9 12 7 14 4 20 11 8 1 12 4 11 7 15 4

4 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 

5 p5. Lemma 1 X Y Z 1 2 3 4 X Y

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

7 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 5 8 11 3 5 12 7 4 5 (b) Residual network 114 15 3 11 5

8 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 5 12 11 3 9 12 7 4 1 (d) Residual network 11 19 3 11 1

9 p9. Lemma 2 Pf :

10 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

11 p11. Lemma3: Cor4:

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

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

14 (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 5 13 3 11 5 8 7 4 13 11 7 3 4 4

15 (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 5 13 3 3 5 12 7 4 5 11 15 3 5 4 11

16 s v4v4 v2v2 v3v3 v1v1 t 5 12 11 3 9 12 7 4 1 (e) 11 19 3 1

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

18 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.

19 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 16 13 104 9 12 7 14 4 20 ST

20 p20. Lemma 5 Pf:

21 p21. Cor6 Pf:

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

23 p23.

24 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.

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

26 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.

27 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.

28 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

29 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 2 +...+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 2 +...+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. □

30 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 1 +...+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. 0 0 -1.5 2 A= 1 2.1 0 0.2 0 -1 1.4 -0.2 0 0 -2 2 B= 1 2 0 0 0 -1 2 0 s t 0.5 3.3 0.2 -1.5 2 1 1.1 -0.1 2 1 2.1 0.2 1.4 -0.2 4


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

Similar presentations


Ads by Google