Sovie Rail Nework, Max Flow, Min u OS Kevin Wayne Fall Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. Minimum u Problem u Flow nework.! Digraph G = (V, E), nonnegaive edge capaciie c(e).! Two diinguihed node: = ource, = ink.! umpion: no parallel edge, no edge enering or leaving. Def. n - cu i a pariion (, B) of V wih! and! B. Def. The capaciy of a cu (, B) i: cap(, B) = " c(e) e ou of ource ink capaciy apaciy = + + =
Minimum u Problem Flow Min - cu problem. Find an - cu of minimum capaciy. 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: val( f ) = " f (e). e ou of apaciy = + + = capaciy flow Value = Maximum Flow Problem Flow and u Max flow problem. Find - flow of maximum value. Flow value lemma. e f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. " f (e) # " f (e) = val( f ) e ou of e in o capaciy flow Value = Value = - + - + =
Flow and u Flow and u Flow value lemma. e f be any flow, and le (, B) be any - cu. Then " f (e) # " f (e) = val( f ). e ou of e in o Weak dualiy. e f be any flow, and le (, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Pf. by flow conervaion, all erm excep v = are val( f ) = " f (e) e ou of = % ( " ' " f (e) $ " f (e)* & ) v # e ou of v e in o v u capaciy = # Flow value " = " f (e) $ " f (e). e ou of e in o apaciy = Flow and u erificae of Opimaliy Weak dualiy. e f be any flow. Then, for any - cu (, B) we have val(f) " cap(, B). orollary. e f be any flow, and le (, B) be any cu. If val(f) = cap(, B), hen f i a max flow and (, B) i a min cu. Pf. val( f ) = " f (e) # " f (e) e ou of e in o $ " f (e) e ou of $ " c(e) e ou of = cap(, B) Value of flow = u capaciy = # Flow value "
Toward a Max Flow lgorihm 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. 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 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 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 capaciy v flow reidual capaciy v reidual capaciy greedy = op = Reidual graph: G f = (V, E f ).! Reidual edge wih poiive reidual capaciy.! E f = {e : f(e) < c(e)} $ {e R : c(e) > }.
Ford-Fulkeron lgorihm Max-Flow Min-u Theorem G: capaciy ugmening pah heorem. Flow f i a max flow iff here are no augmening pah. Max-flow min-cu heorem. [Elia-Feinein-Shannon, Ford-Fulkeron ] The value of he max flow i equal o he value of he min cu. Pf. e f be a flow. Then TFE: (i) There exi a cu (, B) uch ha val(f) = cap(, B). (ii) Flow f i a max flow. (iii) There i no augmening pah relaive o f. (i) # (ii) Thi wa he corollary o weak dualiy lemma. (ii) # (iii) We how conrapoiive.! e f be a flow. If here exi an augmening pah, hen we can improve f by ending flow along pah. Proof of Max-Flow Min-u Theorem nalyi (iii) # (i)! e f be a flow wih no augmening pah.! e be e of verice reachable from in reidual graph.! By definiion of,!.! By definiion of f, %. val( f ) = " f (e) # " f (e) e ou of e in o = " c(e) e ou of = cap(, B) B umpion. ll capaciie are ineger beween and. Invarian. Every flow value f(e) and every reidual capaciie c f (e) remain an ineger hroughou he algorihm. Theorem. The algorihm erminae in a mo val(f*) " n ieraion. I can be implemened in O(mn) ime. Pf. Each augmenaion increae value by a lea.! Inegraliy heorem. If all capaciie are ineger, hen here exi a max flow f for which every flow value f(e) i an ineger. Pf. Since algorihm erminae, heorem follow from invarian.! original nework
Ford-Fulkeron: n Exponenial Inpu Ford-Fulkeron: Pahological Inpu Q. I generic Ford-Fulkeron algorihm polynomial in inpu ize? m, n, and log Q. I Ford-Fulkeron algorihm finie? " + e r = #... [ r n+ = r n - r n+ ] Max flow = + r + r. ugmenaion: fir augmen uni, hen repeaedly chooe pah wih lowe capaciy. X X X a a X X X b r b G X G X X c r c hooing Good ugmening Pah Shore ugmening Pah: Overview of nalyi Goal: chooe augmening pah o ha:! an find augmening pah efficienly.! Few ieraion. hooe augmening pah wih: [Edmond-Karp, Diniz ]! Max boleneck capaciy.! Sufficienly large boleneck capaciy.! Fewe number of edge.. The lengh of he hore augmening pah never decreae.. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae. Theorem. The hore augmening pah algorihm perform a mo O(mn) augmenaion. I can be implemened in O(m n) ime.! O(m) ime o find hore augmening pah via BFS.! O(m) augmenaion for pah of exacly k edge.! k < n
Shore ugmening Pah: nalyi Shore ugmening Pah: nalyi number of edge evel graph.! Define l (v) = lengh of hore -v pah in G.! G = (V, F) i ubgraph of G ha conain only hoe edge (u, v)! E wih l (v) = l (u) +.! ompue G in O(m+n) ime uing BFS, deleing back and ide edge.! P i a hore -u pah in G iff i i an -u pah G.. The lengh of he hore augmening pah never decreae.! e f and f' be flow before and afer a hore pah augmenaion.! e and ' be level graph of G f and G f '! Only back edge added o G f '! Pah wih back edge ha lengh greaer han previou lengh. G l = l = l = l = ' l = l = l = l = Shore ugmening Pah: nalyi Shore ugmening Pah: Review of nalyi. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae.! lea one edge (he boleneck edge) i deleed from afer each augmenaion.! No new edge added o unil lengh of hore pah ricly increae. l = l = l = l =. The lengh of he hore augmening pah never decreae.. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae. Theorem. The hore augmening pah algorihm perform a mo O(mn) augmenaion. I can be implemened in O(m n) ime. Noe: &(mn) augmenaion neceary on ome nework.! Try o decreae ime per augmenaion inead.! Dynamic ree # O(mn log n) [Sleaor-Tarjan, ]! Simple idea # O(mn ) '
Shore ugmening Pah: Improved Verion Shore ugmening Pah: Improved Verion Two ype of augmenaion.! Normal augmenaion: lengh of hore pah doen' change.! Special augmenaion: lengh of hore pah ricly increae. boleneck edge augmen. Group of normal augmenaion ake O(mn) ime.! Explicily mainain level graph - i change by a mo n edge afer each normal augmenaion.! Sar a, advance along an edge in unil reach or ge uck. if reach, augmen and delee a lea one edge if ge uck, delee node go uck, delee node delee augmen l = l = l = l = boleneck edge Shore ugmening Pah: Improved Verion Shore ugmening Pah: Improved Verion Two ype of augmenaion. augmen! Normal augmenaion: lengh of hore pah doen' change.! Special augmenaion: lengh of hore pah ricly increae. boleneck edge. Group of normal augmenaion ake O(mn) ime.! mo n advance ep before you eiher ge uck: delee a node from level graph reach : augmen and delee an edge from level graph Theorem. lgorihm run in O(mn ) ime.! O(mn) ime beween pecial augmenaion.! mo n pecial augmenaion. Sop: lengh of hore pah mu have ricly increaed.
Hiory of Wor-ae Running Time Year Dicoverer Mehod ympoic Time... Danzig Simplex m n Ford, Fulkeron ugmening pah m n Edmond-Karp Shore pah m n Edmond-Karp Fae pah m log (m log n) Diniz Improved hore pah m n Edmond-Karp, Diniz apaciy caling m log Diniz-Gabow Improved capaciy caling m n log Karzanov Preflow-puh n Sleaor-Tarjan Dynamic ree m n log n Goldberg-Tarjan FIFO preflow-puh m n log (n / m)......... Goldberg-Rao engh funcion m / log (n / m) log mn / log (n / m) log Edge capaciie are beween and. nex ime