CS800: Algorithm & Data Jonathan Ullman Lecture 17: Network Flow Chooing Good Augmenting Path Mar 0, 018
Recap Directed graph! = #, % Two pecial node: ource & and ink = ' Edge capacitie ( ) 9 5 15 15 ource 5 8 6 t ink capacity 15 6 15 0 7
Recap An -t flow i a function * ) uch that For every ) %, 0 * ) ( ) (capacity) For every. %, 1 56 7 * ) = 1 685 69 7 * ) (conervation) The value of a flow i.:; * = * ) 1 685 69 < 0 9 5 0 15 15 0 0 0 5 8 6 t capacity flow 15 0 0 0 0 6 15 0 0 0 7
Recap MaxFlow = Find an -t flow of maximum value 9 9 5 0 1 15 15 0 9 8 9 5 8 6 t capacity flow 15 1 0 6 15 0 1 0 7
Recap An -t cut i a partition (>,?) of # with & > and '? The capacity of a cut (A,B) i (:A >,? = ( ) 1 685 69 B 9 5 15 15 ource 5 8 6 t ink capacity 15 6 15 0 7
Recap MinCut: Find an -t cut of minimum capacity 9 5 15 15 ource 5 8 6 t ink capacity 15 6 15 0 7
Ford-Fulkeron Algorithm Start with * ) = 0 for all ) % While There i an augmenting path C in the reidual graph! D Augment flow along the path C 1 0 0 0 0 0 t 0 0 0
Ford-Fulkeron Demo!: 8 6 9 5 t! * : 5 t
Ford-Fulkeron Demo!: 8 6 9 5 t! * : 5 t
Ford-Fulkeron Demo!: 8 6 9 5 t! * : 5 t
Ford-Fulkeron Demo!: 8 6 9 5 t! * : 5 t
Ford-Fulkeron Demo!: 8 6 9 5 t! * : 5 t
Summary The Ford-Fulkeron Algorithm olve maximum -t flow Running time i O(m) per augmentation tep O(val(f*)) augmentination in any graph with integer capacitie O(n) augmentation in graph with unit capacitie MaxFlow-MinCut Theorem: The value of the max -t flow equal the capacity of the min -t cut If * i a max flow, the node reachable from in! D are a min cut Given a max flow, can find a min cut in time O(n+m) via BFS
Recap Two Problem: MaxFlow: given a network G=(V,E), capacitie c(e), ource, ink t, find the -t flow of maximum value MinCut: given a network G=(V,E), capacitie c(e), ource, ink t, find the -t cut of minimum value Ford-Fulkeron Algorithm: Start with the empty flow f(e) = 0 While there i an augmenting path P in the reidual graph! D, increae f along the path
Ford-Fulkeron Algorithm Start with * ) = 0 for all ) % While There i an augmenting path C in the reidual graph! D Augment flow along the path C 1 C C 1 t C C
Chooing Good Path Lat time: arbitrary augmenting path If FF terminate, it output a maximum flow Today: clever augmenting path Maximum-capacity augmenting path ( fattet path ) Shortet augmenting path ( hortet path )
Fattet Augmenting Path
Fattet Augmenting Path Maximum-capacity augmenting path Can find the maximum-capacity augmenting path in time F G log K uing a variant of Prim or Krukal MST Exercie for the reader
Fattet Augmenting Path Arbitrary Path Aume integer capacitie Maximum-Capacity Path Aume integer capacitie Value of maxflow:. Value of aug path: 1 Flow remaining in! D :. 1 # of aug path:. Value of maxflow:. Value of aug path: Flow remaining in! D : # of aug path:
Fattet Augmenting Path * i a maximum flow with value. =.:; * C i a fattet augmenting -t path with capacity? Claim:? 7 O 8 6 9 5 9 t
Fattet Augmenting Path Arbitrary Path Aume integer capacitie Maximum-Capacity Path Aume integer capacitie Value of maxflow:. Value of aug path: 1 Flow remaining in! D :. 1 # of aug path:. Value of maxflow:. Value of aug path: Flow remaining in! D : # of aug path:
Chooing Good Path Lat time: arbitrary augmenting path If FF terminate, it output a maximum flow Today: clever augmenting path Maximum-capacity augmenting path ( fattet path ) G ln. augmenting path (auming integer capacitie) F(G Q ln K ln. ) total running time See KT for a lightly fater variant ( fat enough path ) Shortet augmenting path ( hortet path )
Shortet Augmenting Path
Shortet Augmenting Path Find the augmenting path with the fewet hop Can find hortet augmenting path in O(m) time uing BFS Theorem: for any capacitie RO Q Overall running time F G Q K Work for any capacitie! augmentation uffice Warning: proof i very tricky (you will not be teted on it)
Shortet Augmenting Path Let * S be the flow after the T-th augmenting path Let! S =! DU be the T-th reidual graph * V = 0 and! V =! Let W S. be the ditance from to v in! S Recall that the hortet path in! S move layer-by-layer 8 6 9 5 9 t
Shortet Augmenting Path Every augmentation caue at leat one edge to diappear from the reidual graph, may alo caue an edge to appear Key Property: each edge diappear at mot R Q time Mean that there are at mot OR Q augmentaiton
Shortet Augmenting Path Claim 1: for every. # and every T, W SXY. W S. Obviou for. = & becaue W S & = 0 Suppoe for the ake of contradiction that W SXY. < W S (.) Let. be the mallet uch node Let & \. be a hortet path in! SXY By optimality of the path, W SXY. = W SXY \ + 1 By aumption, W SXY \ W S \ Two Cae: \,.! S, o W S. W S \ + 1 \,.! S, o., \ wa in the T-th path, o W S. = W S \ 1
Shortet Augmenting Path Claim : If an edge \. diappear from! S and reappear in!`xy then W` \ W S \ + \. i on the T-th augmenting path, W S. = W S \ + 1. \ i on the b-th augmenting path, W` \ = W`. + 1 By Claim 1: W`. W S.
Chooing Good Path Lat time: arbitrary augmenting path If FF terminate, it output a maximum flow Today: clever augmenting path Maximum-capacity augmenting path ( fattet path ) G ln. augmenting path (auming integer capacitie) F(G Q ln K ln. ) total running time See KT for a lightly fater variant ( fat enough path ) Shortet augmenting path ( hortet path ) OR augmenting path (for any capacitie) Q F(G Q K) total running time
Summary The Ford-Fulkeron Algorithm olve maximum -t flow Different choice of augmenting path give different running time Still an active area of reearch! Can olve many problem efficiently via reduction to the maximum flow or minimum cut problem