0/0/204 Ma/CS 6a Cla 4: Variou (Flow) Execie Reminder: 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/204 Reminder: 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/204 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/204 Warm-up: Ani-Parallel Edge Two direced edge are aid o be aniparallel if hey are beween he ame pair of verice, bu 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 hey remain equivalen. 4
0/0/204 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 European ide.
0/0/204 The boleneck They alo udied he minimum cu. Problem. In hi cenario here are everal ource and everal 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/204 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 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. 7
0/0/204 The capaciie are even. Every cu ha an even ize. The minimum cu ha an even ize. Max flow min cu The maximum cu ha an even ize. 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. 8
0/0/204 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 \ \ \ \ \ \ \ 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. 9
0/0/204 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 a lea m. By inducion hypohei, here are a lea m edge-dijoin pah in hi nework. Bring back he pah ha wa removed, obaining a lea m edge-dijoin pah. Perhap RAND were alo udying he minimum number of rain rack ha are needed o be deroyed o preven any ranporaion from he Aian ide o he European ide? 0
0/0/204 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 from G o ha here would be no pah from o. 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.
0/0/204 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: If we remove he min cu i a e of diconnecing edge. By he max flow min cu heorem, here are k edge in he min cu. 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 2
0/0/204 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. Soluion: Verex-dijoin Pah We pli every verex of V, a follow: v v in vou In he reuling graph, wo pah are edge dijoin if and only if hey are verex dijoin. A before, we add capaciie of, o obain a 0- nework.
0/0/204 Soluion: Verex-dijoin Pah (2) Algorihm: We build a flow nework a decribed in he previou lide. Find max flow in he reuling nework. I remain o prove: There i a one-o-one correpondence beween he e of verex-dijoin pah in he original graph and he edge-dijoin one in he new nework. 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 verex-dijoin e of pah in he new nework, and hee are edgedijoin. In he new nework, a e of edge-dijoin pah are alo verex-dijoin, and o alo he correponding pah in he original graph. 4
0/0/204 Problem 7, If Time Permi Problem. Given an undireced graph G = V, E and verice, V, decribe an algorihm ha find he maximum number of edge-dijoin pah from o. The End How deailed hould my homework oluion be?