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