Chaper 13 Nework Flow III Applicaion CS 573: Algorihm, Fall 014 Ocober 9, 014 13.1 Edge dijoin pah 13.1.1 Edge-dijoin pah in a direced graph 13.1.1.1 Edge dijoin pah queiong: graph (dir/undir)., : verice. k: parameer. Tak: Compue k pah from o ha are edge dijoin (A) Conver G ino nework flow H. (B) Capaciie 1. (C) Compue max flow in H. (D) Value of flow = # of edge dijoin pah. 13.1.1. Edge Dijoin pah lemma Lemma 13.1.1. k edge dijoin - pah in G = max flow value H i a lea k. Proof: Given k uch edge dijoin pah, puh one uni of flow along each uch pah. The reuling flow i legal in h and i ha value k. Definiion 13.1. (0/1-flow). A flow f i a 0/1-flow if every edge ha eiher no flow on i, or one uni of flow. 13.1.1.3 0/1 flow Lemma 13.1.3. f: 0/1 flow in H wih flow value µ. Then here are µ edge dijoin pah beween and in H. 1
proof (A) Inducion on # edge H wih 1 uni of flow on hem. If µ = 0... (B) Oherwie... Travel from on edge wih flow 1. Exrac pah. Repea. (C) If reached. Take pah π. Reduce flow along π. H /f : new nework/flow f = µ 1, H ha le edge, (D) By inducion: ha µ 1 edge dijoin pah in H beween and. Wih π hi form µ uch pah. 13.1.1.4 0/1 flow proof coninued Lemma 13.1.4. f: 0/1 flow in H wih flow value µ. Then here are µ edge dijoin pah beween and in H. Proof coninued (A) If vii a verex v for he econd ime (while exracing π). (B) Traveral conain a cycle C. (C) C edge in H have flow 1 on hem. (D) Se flow along edge of C o 0. (E) Inducion on he remaining graph. (F) Value of f did no change by removing C. (G) By inducion µ edge dijoin pah in H. 13.1.1.5 Example: Exracing pah
13.1.1.6 Exracing pah (A) G i imple (B) = n = V(H) edge leaving. (C) max flow in H i n. (D) Ford-Fulkeron ake O(mn) ime. (E) Exracion of pah ake linear ime (by proof). Theorem 13.1.5. G: direced graph, n verice, m edge,, verice. Compue max # edge dijoin pah from o in O(mn) ime. 13.1. # edge dijoin pah 13.1..1 Max-flow min-cu heorem rike again! Lemma 13.1.6. G,, a above. Max # edge dijoin pah = Proof: (A) U: e of edge-dijoin pah from o. (B) F : e of edge removing hem eparae from (C) every pah in U conain edge of F. = U F. (D) F : form a cu in G beween and. (E) F minimal = min cu. (F) max-flow mincu heorem F = max flow in G (G) = F dijoin pah in G. = F U. min # edge whoe removal eparae from. 3
13.1.3 Edge-dijoin pah in undireced graph 13.1.3.1 Edge-dijoin pah in undireced graph Problem 13.1.7. G: undireced graph G, and, find max # edge-dijoin pah beween and. (A) Duplicae every edge in G = direced graph H, apply algorihm for direced cae. (B) Problem: flow f migh ue imulaneouly edge in boh direcion: (u v) and (v u). (C) Soluion: Remove -cycle! Repea. (D) Then ue algorihm for direced cae... Lemma 13.1.8. k edge-dijoin pah in undireced G max flow in (direced) graph i a lea k. Pah in G compued in O(mn) ime (Ford-Fulkeron). 13. Circulaion wih demand 13..0. Circulaion wih demand 3 3 G = (V, E). v V here i a demand d v : (A) d v > 0: ink requiring d v flow ino hi node. (B) d v < 0: ource wih d v uni of flow leaving i. (C) d v = 0: regular node. 4 S e of ource verice T : e of ink verice. 4
13..1 A circulaion wih demand: example 13..1.1 A valid circulaion for he given inance / 1/ 3 3 / / / 13..1. Definiion: Circulaion wih demand Definiion 13..1. circulaion wih demand {d v } i a funcion f : E(G) R + : Capaciy condiion: e E: f(e) c(e). Conervaion condiion: v V : f in (v) f ou (v) = d v. Where: (A) f in (v) flow ino v. (B) f ou (v): flow ou of v. Problem 13... I here a circulaion ha comply wih he demand requiremen? 4 13..1.3 Feaible circulaion lemma Lemma 13..3. If here i a feaible circulaion wih demand {d v }, hen v d v = 0. Proof: (A) Circulaion = v d v = f in (v) f ou (v). (B) v V d v = v f in (v) v f ou (v) (C) Flow on every edge i ummed wice, one wih poiive ign, one wih negaive ign. (D) = d v = f in (v) f ou (v) = 0, v v v 13..1.4 Compuing circulaion feaible circulaion only if D = d v = d v. v,d v>0 v,d v<0 5
13.. The algorihm for compuing a circulaion Algorihm for compuing circulaion (A) G = (V, E): inpu nework wih demand on verice. (B) Check D = v,d v>0 d v = v,d v<0 d v. (C) Creae uper ource. Connec o all v wih d v < 0. Se capaciy ( v) o d v. (D) Creae uper ink. Connec o all verice u wih d u > 0. Se capaciy (u ) o d u. (E) H: new nework flow. Compue max-flow f in H from o. (F) If f = D = valid circulaion. Eay o recover. 13...1 Reul: Circulaion wih demand Theorem 13..4. feaible circulaion wih demand {d v } in G max-flow in H ha value D. Inegraliy: If all capaciie and demand in G are ineger, and here i a feaible circulaion, hen here i a feaible circulaion ha i ineger valued. 13.3 Circulaion wih demand and lower bound 13.3.0. Circulaion wih demand and lower bound (A) circulaion and demand + for each edge a lower bound on flow. (B) e E(G): l(e) c(e). (C) Compue f uch ha e l(e) f(e) c(e). (D) Be upid! Conider flow: e f 0 (e) = l(e). (E) f 0 violae conervaion of flow! L v = f in 0 (v) f ou 0 (v) = e ino v l(e) (F) If L v = d v, hen no problem. (G) Fix-up demand: v d v = d v L v. Fix-up capaciy: c (e) = c(e) l(e). (H) G : new nework w. new demand/capaciie (no lower bound!) (I) Compue circulaion f on G. = The flow f = f 0 + f, i a legal circulaion, 13.3.0.3 Circulaion wih demand and lower bound e ou of v l(e). Lemma 13.3.1. feaible circulaion in G feaible circulaion in G. Inegraliy: If all number are ineger = inegral feaible circulaion. Proof: Le f be a circulaion in G. Le f(e) = f 0 (e) + f (e). Clearly, f aifie he capaciy condiion in G, and he lower bound. f in (v) f ou (v) = e ino v(l(e) + f (e)) e ou of v(l(e) + f (e)) = L v +(d v L v ) = d v. f: valid circulaion in G. Then f (e) = f(e) l(e) i a valid circulaion for G. 6
13.4 Applicaion 13.4.1 Survey deign 13.4.1.1 Survey deign (A) Ak Conumer i: wha did you hink of produc j? (B) ih conumer willing o anwer beween c i o c i queion. (C) For each produc j: a lea p j opinion, no more han p j opinion. (D) Full knowledge which conumer can be aked on which produc. (E) Problem: How o aign queion o conumer? 13.4.1. Survey deign... Conumer Produc Conumer 0, 1 Produc c i, c i p j, p j 13.4.1.3 Reul... Lemma 13.4.1. Given n conumer and u produc wih heir conrain c 1, c 1, c, c,..., c n, c n, p 1, p 1,..., p u, p u and a li of lengh m of which produc where ued by which conumer. An algorihm can compue a valid urvey under hee conrain, if uch a urvey exi, in ime O((n + u)m ). 7