C&O 750 Randomized Algorithms Winter 2011 Lecture 24 Nicholas Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:

Slides:



Advertisements
Similar presentations
The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Advertisements

Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Planar Graphs: Coloring and Drawing
Determinant Sums (and Labeled Walks) for Undirected Hamiltonicity
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
C&O 355 Mathematical Programming Fall 2010 Lecture 22 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
C&O 355 Mathematical Programming Fall 2010 Lecture 20 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
C&O 355 Mathematical Programming Fall 2010 Lecture 21 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
Agrawal-Kayal-Saxena Presented by: Xiaosi Zhou
1 Maximum matching in graphs with an excluded minor Raphael Yuster University of Haifa Uri Zwick Tel Aviv University TexPoint fonts used in EMF. Read the.
Matrix sparsification (for rank and determinant computations) Raphael Yuster University of Haifa.
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph Sparsifiers by Edge-Connectivity and Random Spanning Trees Nick Harvey U. Waterloo Department of Combinatorics and Optimization Joint work with Isaac.
Graph Sparsifiers by Edge-Connectivity and Random Spanning Trees Nick Harvey University of Waterloo Department of Combinatorics and Optimization Joint.
Graph Sparsifiers by Edge-Connectivity and Random Spanning Trees Nick Harvey U. Waterloo C&O Joint work with Isaac Fung TexPoint fonts used in EMF. Read.
The Complexity of Matrix Completion Nick Harvey David Karger Sergey Yekhanin.
Great Theoretical Ideas in Computer Science.
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
Michael Bender - SUNY Stony Brook Dana Ron - Tel Aviv University Testing Acyclicity of Directed Graphs in Sublinear Time.
Deterministic Network Coding by Matrix Completion Nick Harvey David Karger Kazuo Murota.
Message Passing for the Coloring Problem: Gallager Meets Alon and Kahale Sonny Ben-Shimon and Dan Vilenchik Tel Aviv University AofA June, 2007 TexPoint.
1 On the Benefits of Adaptivity in Property Testing of Dense Graphs Joint work with Mira Gonen Dana Ron Tel-Aviv University.
Algebraic Structures and Algorithms for Matching and Matroid Problems Nick Harvey.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
Approximation Algorithms: Bristol Summer School 2008 Seffi Naor Computer Science Dept. Technion Haifa, Israel TexPoint fonts used in EMF. Read the TexPoint.
Theory of Computing Lecture 7 MAS 714 Hartmut Klauck.
C&O 355 Mathematical Programming Fall 2010 Lecture 17 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
C&O 355 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
C&O 355 Mathematical Programming Fall 2010 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A.
1 A fast algorithm for Maximum Subset Matching Noga Alon & Raphael Yuster.
Graph Sparsifiers Nick Harvey University of British Columbia Based on joint work with Isaac Fung, and independent work of Ramesh Hariharan & Debmalya Panigrahi.
The Best Algorithms are Randomized Algorithms N. Harvey C&O Dept TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Distributed Coloring Discrete Mathematics and Algorithms Seminar Melih Onus November
C&O 355 Mathematical Programming Fall 2010 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
C&O 355 Mathematical Programming Fall 2010 Lecture 4 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
An Algorithmic Proof of the Lopsided Lovasz Local Lemma Nick Harvey University of British Columbia Jan Vondrak IBM Almaden TexPoint fonts used in EMF.
Graph Sparsifiers Nick Harvey Joint work with Isaac Fung TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
PRIMES is in P Manindra Agrawal NUS Singapore / IIT Kanpur.
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A A A A A Image:
Greedy Algorithms and Matroids Andreas Klappenecker.
Introduction to Algorithms Jiafen Liu Sept
Testing the independence number of hypergraphs
C&O 355 Mathematical Programming Fall 2010 Lecture 16 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
1 Decomposition into bipartite graphs with minimum degree 1. Raphael Yuster.
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.
C&O 355 Lecture 24 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A A A A A.
10/11/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 21 Network.
Analysis of Algorithms Spring semester 2002 Uri Zwick
Great Theoretical Ideas in Computer Science for Some.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Generating Random Spanning Trees via Fast Matrix Multiplication Keyulu Xu University of British Columbia Joint work with Nick Harvey TexPoint fonts used.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
An algorithmic proof of the Lovasz Local Lemma via resampling oracles Jan Vondrak IBM Almaden TexPoint fonts used in EMF. Read the TexPoint manual before.
PRIMES is in P Manindra Agrawal Neeraj Kayal Nitin Saxena Dept of CSE, IIT Kanpur.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Algorithms and Complexity
NP-Completeness Yin Tat Lee
Parameterised Complexity
Instructor: Shengyu Zhang
Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Trevor Brown DC 2338, Office hour M3-4pm
Presentation transcript:

C&O 750 Randomized Algorithms Winter 2011 Lecture 24 Nicholas Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A A A A A

Matchings Perfect matching Set of edges hitting each vertex once History –Tutte ’47: Characterized graphs with a perfect matching, implying Matching 2 NP Å coNP –Edmonds ’65: Defined the notion of polynomial time algorithms and proved Matching 2 P.

Birth of Computational Complexity , Aussois, France

Birth of Computational Complexity Richard Karp 2008, Aussois, France 1965

This means “polynomial time”. So Edmonds is defining the complexity class P. Efficient algorithm for matching, even in non-bipartite graphs

Edmonds ’65O(n 2 m) Micali-Vazirani ’80-’90O( √ n m) Mucha-Sankowski ’04O(n  ) Matching Algorithms All are intricate Mucha ’05: “ [Our] algorithm is quite complicated and heavily relies on graph theoretic results and techniques. It would be nice to have a strictly algebraic, and possibly simpler, matching algorithm ”. O(n 4 ) O(n 2.5 ) n = # vertices m = # edges O(n 2.38 )  <2.38 is exponent for matrix multiplication Dense Graphs m=  (n 2 )

Edmonds ’65O(n 4 ) Micali-Vazirani ’80-’90O(n 2.5 ) Mucha-Sankowski ’04O(n 2.38 ) Harvey ’06O(n 2.38 ) * * Randomized, Las Vegas (like QuickSort) * Dense Graphs m=  (n 2 ) Advantages Simple divide-and-conquer Self-contained Easily implementable (60 lines in MATLAB) Matching Algorithms

Complete Matlab Code

Matching & Tutte Matrix Let G=(V,E) be a graph Define variable x {u,v}  {u,v} ∈ E Define a skew-symmetric matrix T s.t. T u,v = ± x {u,v} 0 cb a 0-x {a,b} -x {a,c} x {a,b} 0-x {b,c} x {a,c} x {b,c} 0 if {u,v} ∈ E otherwise

Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Formally, let M = { all matchings of G }. Define It was previously known that det T = Pf(T) 2. Since the T u,v (=x u,v ) are distinct variables, the monomial for matching ¹ cannot cancel out the monomial for another matching ¹’. So, if one matching exists, det T = Pf(T) 2  0. Properties of Tutte Matrix

Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. {u,v} is contained in a perfect matching  (T -1 ) u,v  0 Properties of Tutte Matrix

v u (T -1 ) u,v  0 Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. Properties of Tutte Matrix {u,v} is contained in a perfect matching  (T -1 ) u,v  0

(T -1 ) u,v  0 G[ V\{u,v} ] has perfect matching Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. Properties of Tutte Matrix {u,v} is contained in a perfect matching  (T -1 ) u,v  0

Properties of Tutte Matrix Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. (T -1 ) u,v  0 G[ V\{u,v} ] has perfect matching {u,v} is contained in a perfect matching  (T -1 ) u,v  0

(T -1 ) u,v  0 G[ V\{u,v} ] has perfect matching v u Properties of Tutte Matrix Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. {u,v} is contained in a perfect matching  (T -1 ) u,v  0

Lemma [Tutte ’47] : G has a perfect matching iff T is non-singular. Lemma [Rabin, Vazirani ’89] : G[ V\{u,v} ] has a perfect matching iff (T -1 ) u,v  0. Computing T -1 very slow: Contains variables! Lemma [Lovász ’79] : These results hold w.h.p. if we randomly choose values for T u,v ’s. Properties of Tutte Matrix {u,v} is contained in a perfect matching  (T -1 ) u,v  0

Lemma [Lovász ’79] : These results hold w.h.p. if we randomly choose values for T u,v ’s. Consequence of the Schwartz-Zippel Lemma: Let p(x 1,…,x m ) be a non-zero polynomial of total degree d over a field F. Let S µ F. Choose r 1,…,r m independently and uniformly from S. Then: Pr[ p(r 1,…,r m ) = 0 ] · d/|S|. Implies randomized alg to test if graph has p.m. How can we construct a p.m.? Properties of Tutte Matrix

Algorithm #1: Self-Reducibility Randomly choose values for T u,v ’s If det T=0 then Error (test if has p.m.) For each {u,v}  E Set T=T; T u,v =T v,u =0; (temporarily delete edge) If det T  0 (test if still has p.m.) Set T=T (permanently delete edge) Total time: O(n  +2 ) time Can we compute det T more quickly? [Rabin, Vazirani ’89] ~~~ ~ ~ If G has no p.m. then Error For each {u,v}  E Temporarily delete edge {u,v} If G still has p.m. Permanently delete edge {u,v} ~ O(n  ) time

Updating Submatrices (Sherman-Morrison-Woodbury Formula)

Claim: M is non-sing  det(I +  ∙N A,A )  0 Claim: N = N - N *,A ∙(I +  ∙N A,A ) -1 ∙  ∙N A, * ~ ~ Matrix Inverse M = ~ N = A A ~  := M A,A -M A,A ~ - ∙∙∙ = rank-|A| update

Algorithm #2: Matrix Updates Total time: O(n 4 ) time Can we improve running time further? Compute N=T -1 For each {u,v}  E If T still non-singular after deleting {u,v} (i.e., G still has p.m. after deleting {u,v}) Delete edge {u,v} Update N O(n 2 ) time By Sherman-Morrison-Woodbury, can do this by examining N Can also do this using Sherman-Morrison-Woodbury

Algorithm #2: Matrix Updates Compute N=T -1 For each {u,v}  E If T still non-singular after deleting {u,v} (i.e., G still has p.m. after deleting {u,v}) Delete edge {u,v} Update N Iteratively delete edges Total time: O(n 4 ) time Can we improve running time further? Key idea: make algorithm recursive instead of iterative!

Recursive Decomposition of Graph Define: E[S] = { {u,v} : u,v ∈ S and {u,v} ∈ E } “within” E[S 1,S 2 ] = { {u,v} : u ∈ S 1, v ∈ S 2, and {u,v} ∈ E } “crossing” Claim: Let S=S 1 ⋃ S 2. Then E[S] = E[S 1 ] ⋃ E[S 2 ] ⋃ E[S 1,S 2 ] E[S] S1S1 S2S2 E[S 1 ] E[S 2 ] E[S 1,S 2 ]

Recursive Decomposition of Graph Define: E[S] = { {u,v} : u,v ∈ S and {u,v} ∈ E } “within” E[R,S] = { {u,v} : u ∈ R, v ∈ S, and {u,v} ∈ E } “crossing” Claim: Let R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2. Then E[R,S] = E[R 1,S 1 ] ⋃ E[R 1,S 2 ] ⋃ E[R 2,S 1 ] ⋃ E[R 2,S 2 ] RS

Recursive Decomposition of Graph Define: E[S] = { {u,v} : u,v ∈ S and {u,v} ∈ E } “within” E[R,S] = { {u,v} : u ∈ R, v ∈ S, and {u,v} ∈ E } “crossing” Claim: Let R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2. Then E[R,S] = E[R 1,S 1 ] ⋃ E[R 1,S 2 ] ⋃ E[R 2,S 1 ] ⋃ E[R 2,S 2 ] RS R1R1 S2S2 R2R2 S1S1

Algorithm #2: Matrix Updates Compute N=T -1 For each {u,v}  E If T still non-singular after deleting {u,v} (i.e., G still has p.m. after deleting {u,v}) Delete edge {u,v} Update N Iteratively delete edges Key idea: make algorithm recursive instead of iterative!

DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N V S1S1 S2S2 E[S 1 ] E[S 2 ] E[S 1,S 2 ] DeleteWithin(S 1 ) DeleteWithin(S 2 ) DeleteCrossing(S 1,S 2 ) Recursively delete edges

DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N S1S1 S2S2 DeleteWithin(S 1 ) DeleteWithin(S 2 ) DeleteCrossing(S 1,S 2 ) FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Recursively delete edges

DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N DeleteWithin(S 1 ) DeleteWithin(S 2 ) DeleteCrossing(S 1,S 2 ) S1S1 S2S2 FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Recursively delete edges

DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N DeleteWithin(S 1 ) DeleteWithin(S 2 ) DeleteCrossing(S 1,S 2 ) S1S1 S2S2 Try to delete R-S edge; Return FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Recursively delete edges

Correctness DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Invariants: 1.T always non-singular 2.In DeleteWithin(S), N[S,S] = T -1 [S,S] 3.In DeleteCrossing(R,S), N[R ⋃ S,R ⋃ S] = T -1 [R ⋃ S,R ⋃ S] To make correct decision here, need N R [ S,R [ S = T -1 R [ S,R [ S Update N S,S Update N R [ S,R [ S

- ∙∙∙ = Updates DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Let u ∈ R and v ∈ S If T u,v  0 and T u,v  -1/N u,v T {u,v},{u,v} := 0 Update N Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Invariants: 1.T always non-singular 2.In DeleteWithin(S), N[S,S] = T -1 [S,S] 3.In DeleteCrossing(R,S), N[R ⋃ S,R ⋃ S] = T -1 [R ⋃ S,R ⋃ S] T = S S1S1 S2S2 S S1S1 S2S2 ~  := T S 1,S 1 -T S 1,S 1 N := N-N *, S 1 ∙(I+  ∙N S 1, S 1 ) -1 ∙  ∙N S 1, * N := T -1 ~ ~~ Time required: O(|S|  ) N S,S := N S,S -N S, S 1 ∙(I+  ∙N S 1, S 1 ) -1 ∙  ∙N S 1, S ~

Runtime Analysis g(n) = 4∙g(n/2) + O(n  )f(n) = 2∙f(n/2)+g(n)+O(n  )  g(n) = O(n  )  f(n) = O(n  ) DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N S,S DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N R [ S,R [ S By Sherman-Morrison-Woodbury Formula, can do each update in O(n  ) time Runtime: f(n), where n=|S|Runtime: g(n), where n=|R|=|S| Total runtime of algorithm is O(n  ) time

DeleteWithin(S) If |S|=1 then Return Partition S=S 1 ⋃ S 2 For i ∈ {1,2} DeleteWithin(S i ) Update N S,S DeleteCrossing(S 1,S 2 ) DeleteCrossing(R,S) If |R|=|S|=1 Try to delete R-S edge; Return Partition R=R 1 ⋃ R 2 and S=S 1 ⋃ S 2 For i ∈ {1,2} and j ∈ {1,2} DeleteCrossing(R i,S j ) Update N R [ S,R [ S FindMatching( G=(V,E) ) Construct T and N=T -1 DeleteWithin(V) Conclusion: The remaining edges form a perfect matching The total running time is O(n  ) time

A ZPP Algorithm Cheriyan ‘97: Gave an RP algorithm for the dual of the matching problem. Its running time is O(n ). So run both the matching algorithm and Cheriyan’s algorithm until one succeeds. (i.e., we get a perfect matching, or a dual proving there is no perfect matching) This is an ZPP algorithm.