// Sovie Rail Nework, Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy. Nework Flow Flow nework. bracion for maerial flowing hrough he edge. G = (V, E): direced graph. Two diinguihed node: = ource, = ink. c(e): capaciy of edge e. Nonrivial applicaion. Daa mining. irline cheduling. Biparie maching. Image egmenaion. Nework conneciviy. Many more ource ink Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. capaciy Flow Flow Maximum Flow Problem Def. n - flow i a funcion ha aifie: For each e E: f (e) c(e) [capaciy] For each v V {, : f (e) = f (e) [conervaion] e in o v e ou of v Def. The value of a flow f i: v( f ) = f (e). e ou of Def. The value of a flow f i: v( f ) = f (e). e ou of Max flow problem. Find - flow of maximum value. capaciy flow Value = Value = Value =
// Cu Def. n - cu i a pariion (, B) of V wih and B. Cu Def. n - cu i a pariion (, B) of V wih and B. Minimum Cu Problem Min - cu problem. Find an - cu of minimum capaciy. Def. The capaciy of a cu (, B) i: cap(, B) = c(e) e ou of Def. The capaciy of a cu (, B) i: cap(, B) = c(e) e ou of Capaciy = + + = Capaciy = + + + = Capaciy = + + = Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Value = Value = + + - + = Value = - + - + =
// Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then. e ou of e in o Proof. by flow conervaion, all erm excep v = are For all edge e for which boh end are in, f(e) appear wice in he um once wih a poiive ign, and once wih a negaive ign v( f ) = f (e) = e ou of v $ ' & f (e) f (e)) % e ou of v e in o v ( = f (e) f (e). e ou of e in o Flow and Cu Weak dualiy. Le f be any flow, and le (, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Cu capaciy = Flow value Weak dualiy. Le f be any flow. Then, for any - cu (, B) we have v(f) cap(, B). Proof. Flow and Cu v( f ) = f (e) f (e) e ou of e in o f (e) e ou of c(e) e ou of = cap(, B) B Capaciy = Cerificae of Opimaliy Corollary. Le f be any flow, and le (, B) be any cu. If v(f) = cap(, B), hen f i a max flow and (, B) i a min cu. Value of flow = Cu capaciy = Flow value Toward a Max Flow lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. Toward a Max Flow lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. X X Flow value = X Flow value =
// Toward a Max Flow lgorihm Reidual Graph ugmening Pah lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. locally opimaliy global opimaliy greedy = op = Original edge: e = (u, v) E. Flow f(e), capaciy c(e). Reidual edge. "Undo" flow en. e = (u, v) and e R = (v, u). Reidual capaciy: $ c(e) f (e) c f (e) = % if e E & f (e) if e R E u u Reidual graph: G f = (V, E f ). Reidual edge wih poiive reidual capaciy. E f = {e : f(e) < c(e) {e R : f(e) >. capaciy v flow reidual capaciy v reidual capaciy Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph while (here exi augmening pah P) { f ugmen(f, c, P) updae G f reurn f Queion: - How do we find an augmening pah? - How o implemen he ugmen mehod ugmening Pah lgorihm Ford-Fulkeron lgorihm lgorihm Correcne ugmen(f, c, P) { b boleneck(p) foreach e P { if (e E) f(e) f(e) + b ele f(e R ) f(e R ) - b reurn f forward edge revere edge G: capaciy The algorihm erminae when here i no augmening pah in he reidual graph. We will how ha in ha cae here exi a cu (, B) uch ha v(f) = cap(, B), from which we can conclude ha f i a max flow. Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph while (here exi augmening pah P) { f ugmen(f, c, P) updae G f reurn f
// lgorihm Correcne Inegraliy Running Time Proof: Le f be a flow wih no augmening pah. Le be e of verice reachable from in reidual graph. By definiion of,. nd ince here i no augmening pah,. v( f ) = f (e) f (e) e ou of e in o = c(e) e ou of = cap(, B) B ume he capaciie are ineger We ar wih an iniial flow of. Wha can we ay abou he value of he flow produced by an augmening pah? Thi implie? umpion. ll capaciie are ineger beween and C. Invarian. Every flow value f(e) and every reidual capaciy c f (e) remain ineger hroughou he algorihm. Inegraliy heorem. If all capaciie are ineger, hen here exi a max flow f for which every flow value f(e) i an ineger. Proof. Since algorihm erminae, heorem follow from invarian. Theorem. The algorihm erminae in a mo v(f*) nc ieraion. Proof. Each augmenaion increae value by a lea. Corollary. If C =, Ford-Fulkeron run in O(mn) ime. original nework