Sovie Rail Nework, 1 Reference: On he hiory of he ranporaion and maximum flow problem. Alexander Schrijver in Mah Programming, 1: 3,.
Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy. Nonrivial applicaion / reducion. Daa mining. Open-pi mining. Projec elecion. Airline cheduling. Biparie maching. Baeball eliminaion. Image egmenaion. Nework conneciviy. Nework reliabiliy. Diribued compuing. Egaliarian able maching. Securiy of aiical daa. Nework inruion deecion. Muli-camera cene reconrucion. Many many more... 3
Minimum Cu Problem Flow nework. Abracion for maerial flowing hrough he edge. G = (V, E) = direced graph, no parallel edge. Two diinguihed node: = ource, = ink. c(e) = capaciy of edge e. ource 3 8 ink capaciy 3 7
Cu Def. An - cu i a pariion (A, B) of V wih A and B. Def. The capaciy of a cu (A, B) i: cap( A, B) = c(e) e ou of A 3 8 A 3 7 Capaciy = + + = 3
Cu Def. An - cu i a pariion (A, B) of V wih A and B. Def. The capaciy of a cu (A, B) i: cap( A, B) = c(e) e ou of A 3 8 A 3 7 Capaciy = + + 8 + 3 =
Minimum Cu Problem Min - cu problem. Find an - cu of minimum capaciy. 3 8 A 3 7 Capaciy = + 8 + = 8 7
Flow Def. An - 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 3 8 capaciy flow 3 7 Value = 8
Flow Def. An - 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 3 8 8 3 8 capaciy 1 flow 11 11 3 7 Value =
Maximum Flow Problem Max flow problem. Find - flow of maximum value. 1 8 3 8 capaciy flow 1 1 3 7 Value = 8
Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = 11
Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = + + 8-1 + 11 = 1
Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = - + 8 - + = 13
Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then f (e) f (e) = v( f ). e ou of A e in o A Pf. by flow conervaion, all erm excep v = are v( f ) = f (e) e ou of = v A f (e) f (e) e ou of v e in o v = f (e) f (e). e ou of A e in o A 1
Flow and Cu Weak dualiy. Le f be any flow, and le (A, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Cu capaciy = 3 Flow value 3 3 8 A 3 7 Capaciy = 3
Flow and Cu Weak dualiy. Le f be any flow. Then, for any - cu (A, B) we have v(f) cap(a, B). Pf. v( f ) = f (e) f (e) e ou of A e in o A f (e) e ou of A c(e) e ou of A = cap(a, B) A 8 7 B 1
Cerificae of Opimaliy Corollary. Le f be any flow, and le (A, B) be any cu. If v(f) = cap(a, B), hen f i a max flow and (A, B) i a min cu. Value of flow = 8 Cu capaciy = 8 Flow value 8 1 8 3 8 A 1 1 3 7 17
Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. 1 3 Flow value = 18
Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. 1 X 3 X X Flow value = 1
Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. locally opimaliy global opimaliy 1 1 3 3 greedy = op = 3
Reidual Graph Original edge: e = (u, v) E. Flow f(e), capaciy c(e). u 17 capaciy v flow Reidual edge. "Undo" flow en. e = (u, v) and e R = (v, u). Reidual capaciy: u 11 reidual capaciy v c(e) f (e) c f (e) = if f (e) e E if e R E reidual capaciy Reidual graph: G f = (V, E f ). Reidual edge wih poiive reidual capaciy. E f = {e : f(e) < c(e)} {e R : c(e) > }. 1
Ford-Fulkeron Algorihm G: 8 capaciy 3
Augmening Pah Algorihm Augmen(f, c, P) { b boleneck(p) foreach e P { } if (e E) f(e) f(e) + b ele f(e R ) f(e) - b } reurn f forward edge revere edge Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph } while (here exi augmening pah P) { f Augmen(f, c, P) updae G f } reurn f 3
Max-Flow Min-Cu Theorem Augmening pah heorem. Flow f i a max flow iff here are no augmening pah. Max-flow min-cu heorem. [Ford-Fulkeron 1] The value of he max flow i equal o he value of he min cu. Proof raegy. We prove boh imulaneouly by howing he TFAE: (i) There exi a cu (A, B) uch ha v(f) = cap(a, 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. Le 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-Cu Theorem (iii) (i) Le f be a flow wih no augmening pah. Le A be e of verice reachable from in reidual graph. By definiion of A, A. By definiion of f, A. v( f ) = f (e) f (e) e ou of A e in o A = c(e) e ou of A = cap(a, B) A B original nework
Running Time Aumpion. All capaciie are ineger beween 1 and C. 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 v(f*) nc ieraion. Pf. Each augmenaion increae value by a lea 1. Corollary. If C = 1, Ford-Fulkeron run in O(mn) ime. 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.
7.3 Chooing Good Augmening Pah
Ford-Fulkeron: Exponenial Number of Augmenaion Q. I generic Ford-Fulkeron algorihm polynomial in inpu ize? m, n, and log C A. No. If max capaciy i C, hen algorihm can ake C ieraion. 1 1 1 X 1 X X 1 C C C C X 1 1 1 X X1 C C C C X 1 1 X X 1 8
Chooing Good Augmening Pah Ue care when elecing augmening pah. Some choice lead o exponenial algorihm. Clever choice lead o polynomial algorihm. If capaciie are irraional, algorihm no guaraneed o erminae! Goal: chooe augmening pah o ha: Can find augmening pah efficienly. Few ieraion. Chooe augmening pah wih: [Edmond-Karp 17, Diniz 17] Max boleneck capaciy. Sufficienly large boleneck capaciy. Fewe number of edge.
Capaciy Scaling Inuiion. Chooing pah wih highe boleneck capaciy increae flow by max poible amoun. Don' worry abou finding exac highe boleneck pah. Mainain caling parameer Δ. Le G f (Δ) be he ubgraph of he reidual graph coniing of only arc wih capaciy a lea Δ. 1 1 1 1 17 1 17 G f G f () 3
Capaciy Scaling Scaling-Max-Flow(G,,, c) { foreach e E f(e) Δ malle power of greaer han or equal o C G f reidual graph } while (Δ 1) { G f (Δ) Δ-reidual graph while (here exi augmening pah P in G f (Δ)) { f augmen(f, c, P) updae G f (Δ) } Δ Δ / } reurn f 31
Capaciy Scaling: Correcne Aumpion. All edge capaciie are ineger beween 1 and C. Inegraliy invarian. All flow and reidual capaciy value are inegral. Correcne. If he algorihm erminae, hen f i a max flow. Pf. By inegraliy invarian, when Δ = 1 G f (Δ) = G f. Upon erminaion of Δ = 1 phae, here are no augmening pah. 3
Capaciy Scaling: Running Time Lemma 1. The ouer while loop repea 1 + log C ime. Pf. Iniially C Δ < C. Δ decreae by a facor of each ieraion. Lemma. Le f be he flow a he end of a Δ-caling phae. Then he value of he maximum flow i a mo v(f) + m Δ. proof on nex lide Lemma 3. There are a mo m augmenaion per caling phae. Le f be he flow a he end of he previou caling phae. L v(f*) v(f) + m (Δ). Each augmenaion in a Δ-phae increae v(f) by a lea Δ. Theorem. The caling max-flow algorihm find a max flow in O(m log C) augmenaion. I can be implemened o run in O(m log C) ime. 33
Capaciy Scaling: Running Time Lemma. Le f be he flow a he end of a Δ-caling phae. Then value of he maximum flow i a mo v(f) + m Δ. Pf. (almo idenical o proof of max-flow min-cu heorem) We how ha a he end of a Δ-phae, here exi a cu (A, B) uch ha cap(a, B) v(f) + m Δ. Chooe A o be he e of node reachable from in G f (Δ). By definiion of A, A. By definiion of f, A. v( f ) = f (e) f (e) e ou of A e in o A Δ) Δ (c(e) e ou of A e in o A = c(e) Δ Δ e ou of A e ou of A e in o A cap(a, B) - mδ A B original nework 3