Algorihm Deign and Analyi LECTURE 0 Nework Flow Applicaion Biparie maching Edge-dijoin pah Adam Smih 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne
La ime: Ford-Fulkeron Find max - flow & min - cu in O(mnC) ime All capaciie are ineger C (We will dicu how o remove hi aumpion) Dualiy: Max flow value = min cu capaciy Inegraliy: if capaciie are ineger, hen FF algorihm produce an inegral max flow 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne
Today: Applicaion when C= Maximum biparie maching Reducing MBM o max-flow Hall heorem Edge-dijoin pah anoher reducion Coming up: faer algorihm for large C and applicaion 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne
Maching Maching. Inpu: undireced graph G = (V, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching.
Biparie Maching Biparie maching. Inpu: undireced, biparie graph G = (L R, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching. ' ' ' maching -', -', -' ' L ' R
Biparie Maching Biparie maching. Inpu: undireced, biparie graph G = (L R, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching. ' ' ' max maching -', -', -' -' ' L ' R
Reducion Roughly: Problem A reduce o problem B if here i a imple algorihm for A ha ue an algorihm for problem B a a ubrouine. Uually: Given inance x of problem A we find a inance x of problem B Solve x Ue he oluion o build a oluion o x Ueful kill: quickly idenifying problem where exiing oluion may be applied. Good programmer do hi all he ime
Reducing Biparie Maching o Maximum Flow Reducion o Max flow. Creae digraph G' = (L R {, }, E' ). Direc all edge from L o R, and aign capaciy. Add ource, and capaciy edge from o each node in L. Add ink, and capaciy edge from each node in R o. G' ' ' ' ' L ' R
Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G. Proof: We need wo aemen max. maching in G max flow in G max. maching in G max flow in G
Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G'. Pf. Given max maching M of cardinaliy k. Conider flow f ha end uni along each of k pah. f i a flow, and ha cardinaliy k. ' ' ' ' ' ' ' ' G ' ' G'
Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G'. Pf. Le f be a max flow in G' of value k. Inegraliy heorem f i inegral; all capaciie are f i 0-. Conider M = e of edge from L o R wih f(e) =. each node in L and R paricipae in a mo one edge in M M = k: conider cu (L, R ) ' ' ' ' ' ' ' ' G' ' ' G
Exercie Give an example where he greedy algorihm for MBM fail. How bad can he greedy algorihm be, i.e. how far can he ize of he maximum maching (global max) be from he ize of he greedy maching (local max)? Wha do augmening pah look like in hi max-flow inance?
Perfec Maching Def. A maching M E i perfec if each node appear in exacly one edge in M. Q. When doe a biparie graph have a perfec maching? Srucure of biparie graph wih perfec maching. Clearly we mu have L = R. Wha oher condiion are neceary? Wha condiion are ufficien?
Perfec Maching Noaion. Le S be a ube of node, and le N(S) be he e of node adjacen o node in S. Obervaion. If a biparie graph G = (L R, E), ha a perfec maching, hen N(S) S for all ube S L. Pf. Each node in S ha o be mached o a differen node in N(S). ' ' ' No perfec maching: S = {,, } N(S) = { ', ' }. ' L ' R
Marriage Theorem Marriage Theorem. [Frobeniu 97, Hall 9] Le G = (L R, E) be a biparie graph wih L = R. Then, G ha a perfec maching iff N(S) S for all ube S L. Pf. Thi wa he previou obervaion. ' ' ' No perfec maching: S = {,, } N(S) = { ', ' }. ' L ' R
Proof of Marriage Theorem Pf. Suppoe G doe no have a perfec maching. Formulae a a max flow problem wih conrain on edge from L o R and le (A, B) be min cu in G'. Key propery #: of hi graph: min-cu canno ue edge. So cap(a, B) = L B + R A Key propery #: inegral flow i ill a maching By max-flow min-cu, cap(a, B) < L. Chooe S = L A. Since min cu can' ue edge: N(S) R A. N(S ) R A = cap(a, B) - L B < L - L B = S. G' A ' ' S = {,, } L B = {, } ' ' ' R A = {', '} N(S) = {', '}
Biparie Maching: Running Time Which max flow algorihm o ue for biparie maching? Generic augmening pah: O(m val(f*) ) = O(mn). Capaciy caling: O(m log C ) = O(m ). Shore augmening pah (no covered in cla): O(m n / ). Non-biparie maching. Srucure of non-biparie graph i more complicaed, bu well-underood. [Tue-Berge, Edmond-Galai] Bloom algorihm: O(n ). [Edmond 96] Be known: O(m n / ). [Micali-Vazirani 980] Recenly: beer algorihm for dene graph, e.g. O(n.8 ) [Harvey, 006]
Exercie A biparie graph i k-regular if L = R and every verex (regardle of which ide i i on) ha exacly k neighbor Prove or diprove: every k-regular biparie graph ha a perfec maching
7.6 Dijoin Pah 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne
Edge Dijoin Pah Dijoin pah problem. Given a digraph G = (V, E) and wo node and, find he max number of edge-dijoin - pah. Def. Two pah are edge-dijoin if hey have no edge in common. Ex: communicaion nework. 6 7
Edge Dijoin Pah Dijoin pah problem. Given a digraph G = (V, E) and wo node and, find he max number of edge-dijoin - pah. Def. Two pah are edge-dijoin if hey have no edge in common. Ex: communicaion nework. 6 7
Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value.
Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value. Pf. Suppoe here are k edge-dijoin pah P,..., P k. Se f(e) = if e paricipae in ome pah P i ; ele e f(e) = 0. Since pah are edge-dijoin, f i a flow of value k.
Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value. Pf. Suppoe max flow value i k. Inegraliy heorem here exi 0- flow f of value k. Conider edge (, u) wih f(, u) =. by conervaion, here exi an edge (u, v) wih f(u, v) = coninue unil reach, alway chooing a new edge Produce k (no necearily imple) edge-dijoin pah. can eliminae cycle o ge imple pah if deired
Nework Conneciviy Nework conneciviy. Given a digraph G = (V, E) and wo node and, find min number of edge whoe removal diconnec from. Def. A e of edge F E diconnec from if all - pah ue a lea one edge in F. (Tha i, removing F would make unreachable from.) 6 7
Edge Dijoin Pah and Nework Conneciviy Theorem. [Menger 97] The max number of edge-dijoin - pah i equal o he min number of edge whoe removal diconnec from. Pf. Suppoe he removal of F E diconnec from, and F = k. All - pah ue a lea one edge of F. Hence, he number of edgedijoin pah i a mo k. 6 6 7 7
Dijoin Pah and Nework Conneciviy Theorem. [Menger 97] The max number of edge-dijoin - pah i equal o he min number of edge whoe removal diconnec from. Pf. Suppoe max number of edge-dijoin pah i k. Then max flow value i k. Max-flow min-cu cu (A, B) of capaciy k. Le F be e of edge going from A o B. F = k and diconnec from. A 6 6 7 7