0/0/206 Ma/CS 6a Cla 4: Flow Exercie Flow Nework A flow nework i a digraph G = V, E, ogeher wih a ource verex V, a ink verex V, and a capaciy funcion c: E N. Capaciy Source 7 a b c d e Sink
0/0/206 Flow in a Nework Given a flow nework G = (V, E,,, c), a flow in G i a funcion f: E N ha aifie Every e E aifie f e c e. Every v V, aifie u,v E Toal flow enering v. f u, v = v,w E f v, w Toal flow exiing v. Example: Flow The capaciie are in red. The flow i in blue. 2/7 2/ 0/ a 2/ c 0/ b 2/ d / / e / / 2
0/0/206 Reminder: Cu A cu i a pariioning of he verice of he flow nework ino wo e S, T uch ha S and T. The ize of a cu i he um of he capaciie of he edge from S o T. 7 a b c d e Reminder: Max Flow Min Cu Max flow min cu heorem. In every flow nework, he ize of he minimum cu i equal o he ize of he maximum flow. 7 a b c d e
0/0/206 Warm-up: Ani-Parallel Edge Two direced edge are aid o be aniparallel if hey have he ame endpoin, bu are in oppoie direcion. Problem. Conider a flow nework (V, E,,, c), and le e, e E be ani-parallel edge. Prove ha here exi a maximum flow in which a lea one of e, e ha no flow hrough i. a b Soluion Conider a maximum flow f. If eiher e or e ha no flow hrough i in f, we are done. Aume, WLOG, ha f e f(e ). By decreaing f(e ) by f e and hen eing f e = 0, we obain a valid flow of he ame ize. Le e = v, u. Boh he incoming and he ougoing flow of v and u were decreaed by he ame amoun, o he conrain are ill aified. 4
0/0/206 An Illuraion u v u v Recall: The Rand corporaion udied he Sovie rain yem. They udied he Sovie abiliy o ranpor hing from he Aian ide o he European ide.
0/0/206 The boleneck They alo udied he minimum cu. Problem. In hi cenario here are everal ource and ink! Problem 2: Several Source and Sink Problem. We are given a flow nework wih everal ource and everal ink. Explain how o ue an algorihm for finding a maximum flow (in a andard flow nework) for hi cae. 2 a b c 2 6
0/0/206 Soluion We add a uper ource S, and add an edge from i o each of he ource. Each of hee edge ha an infinie capaciy. We ymmerically add a uper ink T. Run he original algorihm from S o T. 2 a b c 2 Correcne There i a bijecion beween he flow of he original nework and he flow of he new nework (and he original edge have he ame flow in boh cae). A flow in he new nework yield a flow in he original one by removing he ource and he ink, and vice vera. Two correponding flow have he ame ize. A max flow in he new nework correpond o a max flow in he original one. 7
0/0/206 Problem : Even Flow Problem. Given a flow nework V, E,,, c uch ha all of he capaciie are even, prove ha he ize of he maximum flow i even. The capaciie are even. Every cu ha an even ize. The minimum cu ha an even ize. Max flow min cu The maximum flow ha an even ize. 8
0/0/206 Problem 4: Edge-dijoin Pah Problem. Given a digraph G = V, E and verice, V, decribe an algorihm ha find he maximum number of edge-dijoin pah from o. Soluion: Edge-dijoin Pah We give every edge a capaciy of. A nework wih only -capaciie i called a 0- nework (max flow can be compued more efficienly in uch nework). Find a max flow in he reuling 0- nework. \ \ \ \ \ \ 0\ 0\ \ \ \ \ \ \ 9
0/0/206 Correcne of Soluion Given a 0- flow nework wih a max flow f and maximum number of edge-dijoin pah k, we need o prove f = k. f k: By having a flow of hrough every dijoin pah, we obain a flow of ize k. f k: Proof by inducion on f. Inducion bai: obviou when f = 0. Correcne of Soluion (2) Inducion ep (how ha m = f k). Conider a maximum flow (of ize m). Remove every edge wih 0 flow hrough i. Find a pah from o (i exi ince f > 0). Remove he edge of he pah, o obain a nework wih a flow of ize m. By he inducion hypohei, here are m edge-dijoin pah in hi nework. Bring back he removed pah, o obain a lea m edge-dijoin pah. 0
0/0/206 Perhap RAND were alo udying he minimum number of rain rack needed o be deroyed o preven any ranporaion from he Aian ide o he European ide? Problem : Diconnecing Edge Problem. Given a digraph G = V, E and verice, V, decribe an algorihm ha find he minimum number of edge needed o be removed o ha no pah from o remain.
0/0/206 Soluion: Diconnecing Edge A before, we give every edge a capaciy of, o obain a 0- nework. Find a max flow in he nework. We already proved ha he max flow equal he maximum number of edgedijoin pah. I remain o prove ha he max number of edge-dijoin pah equal he min number of edge needed o diconnec from. Proof k maximum number of edge dijoin pah. l minimum number of diconnecing edge. l k: There are k edge-dijoin pah, and we need o remove a lea one edge from each. l k: The min cu i a e of diconnecing edge. By he max flow min cu heorem, here are k edge in he min cu. 2
0/0/206 Menger Theorem The idea ha he min number of diconnecing edge i equal o he max number of edge-dijoin pah i called Menger Theorem, and i from 927. Ich heie Karl und ich mag Flüe in Nezwerken Problem 6: Verex-dijoin Pah Problem. Given a digraph G = V, E and verice, V, decribe an algorihm ha find he maximum number of verex-dijoin pah from o.
0/0/206 Soluion: Verex-dijoin Pah We pli every verex of V, a follow: v v in vou In he reuling graph, pah are edge dijoin if and only if hey are verex dijoin. A before, we add capaciie of, o obain a 0- nework. Soluion: Verex-dijoin Pah (2) Algorihm: We build a 0- nework a decribed in he previou lide. Find max flow in he reuling nework. I remain o prove: There i a bijecion beween e of verexdijoin pah in he original graph and e of edge-dijoin pah in he new nework. 4
0/0/206 Proof Every pah in he new nework i of he form v in v ou u in w in w ou. I correpond o he pah in he original graph: v u w. A e of verex-dijoin pah in he original graph correpond o a e of verex-dijoin pah in he new nework, and hee are edgedijoin. In he new nework, a e of edge-dijoin pah are alo verex-dijoin, and hu alo he correponding pah in he original graph. The End