CMP 6610/4610 Fall 2016 Flow Nework Carola Wenk lide adaped rom lide by Charle Leieron
Max low and min c Fndamenal problem in combinaorial opimizaion Daliy beween max low and min c Many applicaion: Biparie maching Image egmenaion Airline chedling Nework reliabiliy rey deign Baeball eliminaion Gene ncion predicion 2
Flow nework Deiniion. A low nework i a direced graph G = V E wih wo diingihed erice: a orce and a ink. Each edge E ha a nonnegaie capaciy c. I E hen c = 0. We reqire ha i E hen E. 2 Example: 3 3 1 1 3 2 3 2 3
Flow nework Deiniion. A poiie low on G i a ncion : V V R aiying he ollowing: Capaciy conrain: For all V 0 c. Flow coneraion: For all V \{ } V V The ale o a low i he ne low o o he orce: V V 0 4
A low on a nework low capaciy 1:3 2:2 2:3 1:3 1:1 2:2 2:3 1:2 Flow coneraion like Kircho crren law: Flow ino i 2 + 1 = 3. Flow o o i 1 + 2 = 3. The ale o hi low i 1 + 2 = 3. 5
The maximm-low problem Maximm-low problem: Gien a low nework G ind a low o maximm ale on G. 2:3 2:2 2:3 0:3 1:1 2:2 3:3 2:2 The ale o he maximm low i 4. 6
7 C Deiniion. A c T o a low nework G = V E i a pariion o V ch ha and T. I i a low on G hen he ne low acro he c i The capaciy o he c i T T T T c T c
C 2:3 0:3 2:2 1:1 2:3 T 2:2 2:2 3:3 T = 2 + 2+1+2 2+1 = 4 ct = 2+3+1+3 = 9 8
9 Anoher characerizaion o low ale Lemma. For any low and any c T we hae = T. } \{ T T T T T V V V V V V V V Proo: 0
10 Upper bond on he maximm low ale Theorem. The ale o any low i bonded rom aboe by he capaciy o any c: ct.. Proo. T c c T T T T T
Flow ino he ink 2:3 2:2 2:3 0:3 1:1 2:2 3:3 2:2 = {} V\{} = V\{} = 4 11
Reidal nework Deiniion. Le be a low on G = V E. The reidal nework G V E i he graph wih reidal capaciie c ie c = i E 0 oherwie Edge in E admi more low. Lemma. E 2 E. 12
Agmening pah Deiniion. Le p be a pah rom o in G. The reidal capaciy o p i c p min { c }. p I c p > 0 hen p i called an agmening pah in G wih repec o. The low ale can be increaed along an agmening pah p by c p. Ex.: G: 3:5 2:6 4:5 2:3 2:5 c p = 2 G : p 2 4 4 2 3 3 2 1 1 2 13
Agmening pah con. G: c p = 2 G : p 3:5 2:6 2 4 4:5 2:3 4 2 2:5 3 G: 3 5:5 2 4:6 1. 2:5 0:3 1 4:5 2 G : 0 2 2 0 5 4 3 3 1 4 14
Max-low min-c heorem Theorem. The ollowing are eqialen: 1. = c T or ome c T. min-c 2. i a maximm low. 3. admi no agmening pah. Proo. 1 2: ince c T or any c T he ampion ha c T implie ha i a maximm low. 2 3: I here wa an agmening pah he low ale cold be increaed conradicing he maximaliy o. 15
Proo conined 3 1: Deine = { V : here exi an agmening pah in G rom o } and le T = V \. ince admi no agmening pah here i no pah rom o in G. Hence and T and h T i a c. Conider any erice and T. pah in G T We m hae c = 0 ince i c > 0 hen no T a amed. Th = c i E ince c = c. And oherwie =0. mming oer all and T yield T = c T and ince = T he heorem ollow. 16
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 10 9 10 9 1 10 9 10 9 17
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 0:10 9 0:10 9 0:1 0:10 9 0:10 9 18
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 0:10 9 0:10 9 0:1 0:10 9 0:10 9 19
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 0:10 9 1:1 0:10 9 1:10 9 20
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 0:10 9 1:1 0:10 9 1:10 9 21
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 1:10 9 0:1 1:10 9 1:10 9 22
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 1:10 9 0:1 1:10 9 1:10 9 23
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 2:10 9 1:10 9 1:1 1:10 9 2:10 9 2 billion ieraion on a graph wih 4 erice! 24
Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Rnime: Le * be he ale o a maximm low and ame i i an inegral ale. The iniializaion ake O E ime There are a mo * ieraion o he loop Find an agmening pah wih DF in O V + E ime Each agmenaion ake O V ime O E * ime in oal 25
Edmond-Karp algorihm Edmond and Karp noiced ha many people implemenaion o Ford-Flkeron agmen along a breadh-ir agmening pah: a hore pah in G rom o where each edge wih poiie capaciy ha weigh 1. Thee implemenaion wold alway rn relaiely a. ince a breadh-ir agmening pah can be ond in O V + E ime heir analyi which proided he ir polynomial-ime bond on maximm low oce on bonding he nmber o low agmenaion. In independen work Dinic alo gae polynomial-ime bond. 26
Rnning ime o Edmond- Karp One can how ha he nmber o low agmenaion i.e. he nmber o ieraion o he while loop i O V E. Breadh-ir earch rn in O V + E ime All oher bookkeeping i O V per agmenaion. The Edmond-Karp maximm-low algorihm rn in O V E 2 ime. 27
Monooniciy lemma Lemma. Le = be he breadh-ir diance rom o in G. Dring he Edmond- Karp algorihm increae monoonically. Proo. ppoe ha i a low on G and agmenaion prodce a new low. Le =. We ll how ha by indcion on. For he bae cae = 0. For he indcie cae conider a breadh-ir pah in G. We m hae + 1 ince bpah o hore pah are hore pah. Cerainly E and now conider wo cae depending on wheher E. 28
Cae 1 Cae: E. We hae + 1 riangle ineqaliy + 1 indcion = breadh-ir pah and h monooniciy o i eablihed. 29
Cae 2 Cae: E. ince E he agmening pah p ha prodced rom m hae inclded. Moreoer p i a breadh-ir pah in G : p =. Th we hae 1 breadh-ir pah 1 indcion 2 breadh-ir pah < hereby eablihing monooniciy or hi cae oo. 30
Coning low agmenaion Theorem. The nmber o low agmenaion in he Edmond-Karp algorihm Ford-Flkeron wih breadh-ir agmening pah i O V E. Proo. Le p be an agmening pah and ppoe ha we hae c = c p or edge p. Then we ay ha i criical and i diappear rom he reidal graph aer low agmenaion. Example: G : 2 3 4 2 7 2 1 3 2 c p = 2 31
Coning low agmenaion Theorem. The nmber o low agmenaion in he Edmond-Karp algorihm Ford-Flkeron wih breadh-ir agmening pah i O V E. Proo. Le p be an agmening pah and ppoe ha we hae c = c p or edge p. Then we ay ha i criical and i diappear rom he reidal graph aer low agmenaion. Example: G : 5 2 4 5 1 2 3 4 32
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 33
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: = 5 = 6 34
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: = 5 = 6 35
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 6 36
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 6 37
Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 8 38
Rnning ime o Edmond- Karp Diance ar o nonnegaie neer decreae and are a mo V 1 nil he erex become nreachable. Th occr a a criical edge O V ime becae increae by a lea 2 beween occrrence. ince he reidal graph conain O E edge he nmber o low agmenaion i O V E. Corollary. The Edmond-Karp maximm-low algorihm rn in O V E 2 ime. Proo. Breadh-ir earch rn in O E ime and all oher bookkeeping i O V per agmenaion. 39
Be o dae The aympoically ae algorihm o dae or maximm low de o King Rao and Tarjan rn in O V E log E / V log V V ime. I we allow rnning ime a a ncion o edge weigh he ae algorihm or maximm low de o Goldberg and Rao rn in ime Omin{ V 2/3 E 1/2 } E log V 2 / E + 2 log C where C i he maximm capaciy o any edge in he graph. 40