Sampling and Approximate Counting for Weighted Matchings Roy Cagan.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
1 Decomposing Hypergraphs with Hypertrees Raphael Yuster University of Haifa - Oranim.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
Gibbs sampler - simple properties It’s not hard to show that this MC chain is aperiodic. Often is reversible distribution. If in addition the chain is.
A Separator Theorem for Graphs with an Excluded Minor and its Applications Paul Seymour Noga Alon Robin Thomas Lecturer : Daniel Motil.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Graph Isomorphism Algorithms and networks. Graph Isomorphism 2 Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
GOLOMB RULERS AND GRACEFUL GRAPHS
1 The Monte Carlo method. 2 (0,0) (1,1) (-1,-1) (-1,1) (1,-1) 1 Z= 1 If  X 2 +Y 2  1 0 o/w (X,Y) is a point chosen uniformly at random in a 2  2 square.
Combinatorial Algorithms
Markov Chains 1.
Optimization of Pearl’s Method of Conditioning and Greedy-Like Approximation Algorithm for the Vertex Feedback Set Problem Authors: Ann Becker and Dan.
The number of edge-disjoint transitive triples in a tournament.
1 By Gil Kalai Institute of Mathematics and Center for Rationality, Hebrew University, Jerusalem, Israel presented by: Yair Cymbalista.
Entropy Rates of a Stochastic Process
Markov Chains Lecture #5
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Data Transmission and Base Station Placement for Optimizing Network Lifetime. E. Arkin, V. Polishchuk, A. Efrat, S. Ramasubramanian,V. PolishchukA. EfratS.
Approximation Algorithms
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
1 On the Computation of the Permanent Dana Moshkovitz.
Distributed Combinatorial Optimization
Approximating The Permanent Amit Kagan Seminar in Complexity 04/06/2001.
Phylogenetic Networks of SNPs with Constrained Recombination D. Gusfield, S. Eddhu, C. Langley.
GRAPH Learning Outcomes Students should be able to:
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Edge-disjoint induced subgraphs with given minimum degree Raphael Yuster 2012.
1 Rainbow Decompositions Raphael Yuster University of Haifa Proc. Amer. Math. Soc. (2008), to appear.
Markov Chains and Random Walks. Def: A stochastic process X={X(t),t ∈ T} is a collection of random variables. If T is a countable set, say T={0,1,2, …
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
Seminar on random walks on graphs Lecture No. 2 Mille Gandelsman,
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
Great Theoretical Ideas in Computer Science for Some.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. Fast.
12. Lecture WS 2012/13Bioinformatics III1 V12 Menger’s theorem Borrowing terminology from operations research consider certain primal-dual pairs of optimization.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Approximation Algorithms based on linear programming.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Theory of Computational Complexity Probability and Computing Lee Minseon Iwama and Ito lab M1 1.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
Theory of Computational Complexity M1 Takao Inoshita Iwama & Ito Lab Graduate School of Informatics, Kyoto University.
Unconstrained Submodular Maximization Moran Feldman The Open University of Israel Based On Maximizing Non-monotone Submodular Functions. Uriel Feige, Vahab.
Randomized Algorithms Hung Dang, Zheyuan Gao, Irvan Jahja, Loi Luu, Divya Sivasankaran.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Probabilistic Algorithms
Markov Chains and Random Walks
Path Coupling And Approximate Counting
Chapter 5. Optimal Matchings
ICS 353: Design and Analysis of Algorithms
Enumerating Distances Using Spanners of Bounded Degree
Hidden Markov Models Part 2: Algorithms
Instructor: Shengyu Zhang
Switching Lemmas and Proof Complexity
Locality In Distributed Graph Algorithms
Presentation transcript:

Sampling and Approximate Counting for Weighted Matchings Roy Cagan

2 Motivation – the permanent function The permanent of an n×n integer matrix is defined by: Evaluating the permanent of a 0,1-matrix is #P-complete [Valiant,1979] Target: finding FPRAS for the permanent

3 Matchings in a graph A matching in a graph G = (V,E) is any subset of edges that are pairwise vertex disjoint A matching is said to be perfect if it covers every vertex per A is equal to the number of perfect matchings in the bipartite graph G = (V 1,V 2,E), where V 1 =V 2 =[n], and iff a ij = 1. [Jerrum et al. 1986] So: approximation for the number of perfect matchings in a graph -> approximation for the Permanent function

4 Strategy Weighted matchings – w(M) = λ |M| (λ is a positive real parameter) – The partition function of (weighted) matchings in G (a general graph with 2n vertices) is: – is the number of k-matchings in G Sampling a weighted matching in a general graph Our Goal: building FPRAS for Z G

5 FPRAS for Z G Approach: simulate a suitable MC, M match (λ), parameterized on G and λ State space (Ω): the set of all matchings in G stationary distribution:

6 M match (λ) – transitions 1. With probability ½, let M′ = M 2. Otherwise: 1. select an edge u.a.r. and set 2. go to M′ with probability φ=min{1, π λ (M′)/π λ (M)} (note: this probability is λ −1, λ or 1) ↓ ↑ ↔

7 M match (λ) – transitions – Example ↔-transition φ=1 ↓-transition φ=min{1, λ -1 } ↑-transition φ=min{1, λ}

8 M match (λ) – continued Claim: M match (λ) is irreducible – all states communicate via the empty matching Claim: M match (λ) is aperiodic – by step 1, the self-loop probabilities P(M,M) are all non-zero

9 M match (λ) – continued Claim: M match (λ) is reversible Proof: for all we need to show – P(M,M’)=0 iff P(M’,M)=0 – Otherwise, there are 3 cases: 1. |M|=|M’|+1 2. |M|=|M’|-1 3. |M|=|M’|

10 M match (λ) – continued Assume w.l

11 Approximating Z(λ) Express Z(λ) as the product: Where – We will use – The length r of the sequence is taken to be minimal s.t: Goal: estimate Note:

12 Approximating Z(λ) – continued Define the random variable Then: Thus estimating can be done by sampling matchings from the distribution and computing the sample mean of

13 1.Compute the sequence Where r is the least integer s.t. 2.For each value in turn, compute an estimate of the ratio : Obtain an independent sample of size S from (close to) the distribution by performing S independent simulations of the Markov chain M match (λ i ), each of length T i, let be the sample mean of the quantity 3.Output the product The algorithm – MatchSample

14 MatchSample – Sample size S Proposition 1: If the simulation length T i in Step 2 is large enough that the variation distance of M match (λ i ) from its stationary distribution is at most δ=ε/(3er). Then for a sample size S = O(ln(r)∙r 2 ∙ε −2 ), the output random variable Y satisfies: Proof: – Let X ij be the value of Z i (M) for the j’th sample in round i So X i is the mean of X ij for j=1..S Note: e −1 ≤ X ij ≤ 1 (since Z i =(1+1/n) -|M| ) – Let. Then: – So, for we get – Therefore, with probability at least (union bound on the r variables X i ), we get:

15 MatchSample – Sample size S So, a modest sample size at each stage (polynomial in n and in ε −1 ) suffices to ensure a good final estimate Y, provided of course that the samples come from a distribution that is close enough to the stationary distribution We still need to show that in order to achieve a distribution which is close enough to the stationary distribution, we don’t need T i to be too big, i.e. that the mixing time of M match (λ i ) is not too big.

16 The mixing time of M match (λ i ) Proposition 2: The mixing time of the Markov chain M match (λ) satisfies So, we can sample from (close to) the complex distribution over the exponentially large space of weighted matchings in G, by performing a Markov chain simulation of length only a low-degree polynomial in the size of G.

17 MatchSample – FPRAS for Z(λ) Theorem: Algorithm MatchSample is an FPRAS for Z(λ) Proof: – Proposition 1 ensures that the output of Algorithm MatchSample satisfies the requirements of an FPRAS for Z – The running time is dominated by the number of Markov chain simulations steps, which is ; since T i increases with i, this is at most Substituting the upper bound for r, S and T r, we see that the overall running time of the algorithm is bounded by which grows only polynomially with n, λ′ and ε −1

18 Proof of proposition 2 Reminders (Ilan, Omri): – if M is reversible, then – Strategy: – choose a collection of canonical paths in the Markov chain M match (λ) for which the “bottleneck” measure is small Specifically, we shall show that our paths satisfy – Since the number of matchings in G is certainly bounded above by (2n)!, the stationary probability π λ (X) of any matching X is bounded below by π λ (X) ≥ 1/(2n)!λ′ n – Using the bound on and the fact that, we get the bound on the mixing time claimed in Proposition 2

19 Proof of proposition 2 – the paths For a pair of matchings X,Y in G, we define the canonical path as follows: – Consider the symmetric difference X  Y – This consists of a disjoint collection of paths in G (some of which may be closed cycles), each of which has edges that belong alternately to X and to Y. – Fix some arbitrary ordering on all simple paths in G, and designated in each of them a so-called “start vertex”, which is arbitrary if the path is a closed cycle but must be an endpoint otherwise. – This ordering induces a unique ordering P 1, P 2,..., P m on the paths appearing in X  Y. – The canonical path from X to Y involves “unwinding” each of the P i

20 Proof of proposition 2 – the paths There are two cases to consider: – P i is not a cycle If P i starts with a X-edge, remove it (↓-transition) Perform a sequence of ↔-transitions (removes X-edge, inserts Y-edge) If P i ’s length is odd (we remain with one Y-edge), insert it (↑-transition) – P i is a cycle Let P i =(v 0,v 1,...,v 2l+1 ) – V 0 is the start vertex,, Remove (v 0,v 1 ) – an X-edge (↓-transition) We are left with a path with endpoints v 0, v 1, one of which must be the start vertex Continue as above, but: – If v 0 is the start vertex, use v 1 as the start vertex – If v 1 is the start vertex, use v 0 as the start vertex – (This trick serves to distinguish paths from cycles)

21 Example X: Y: X  Y:

22 X X Y Unwinding a path X XX Y ↔-transition ↓-transition

23 Unwinding a cycle X X XX XX X X X Y X Y Y Y YY Y YY Y Y YY Y X X XX ↓-transition↔-transition ↑-transition

24 The full path

25 Bounding the bottleneck measure Let ε be an arbitrary edge in the Markov chain, i.e., a transition from M to M′≠M Let denote the set of all canonical paths that use ε Obtain a bound on the total weight of all paths that pass through ε by defining an injective mapping : More precisely, it will defined: e XYt is the edge of X adjacent to the start vertex of the path currently being unwound

26 Example

27 Example

28 Bounding the bottleneck measure Claim 1: is always a matching Proof: – Idea: show that no vertex degree exceeds 1 – Step 1: no vertex degree exceeds 2 Let Since it follows that and therefore, no vertex degree can exceed 2 – Step 2: Suppose that some vertex u has degree 2 in A Then A contains edges {u, v1}, {u, v2} and since, one of these edges must belong to X and the other to Y. Hence neither can belong to Since all edges of P 1 …P i-1 agree with Y and all edges of P i+1 …P m agree with X, these edges must belong to P i. Inside P i, again, they can’t be edges that have already been unwound, as they agree with Y and can’t be edges that were not unwound yet, as they agree with X The only option left is that they are the “first” and “last” edges of the circle and this is not possible since we removed eXYt from A

29 Bounding the bottleneck measure Claim 2: is injective Proof: – the symmetric difference can be recovered from using: Note: Once we have formed the set, it will be apparent whether the current path is a cycle from the sense of unwinding (did it start from the start vertex or from the end vertex) – Given, we can find the paths P 1,...,P m and ε tells us which of these, P i say, is the path currently being unwound – The partition of into X and Y is now straightforward: X equals on the wounded paths and equals M on the unwounded paths – this gives all the edges of X which don’t belong to Y Similarly, we can separate Y from – And to complete X and Y, we add – Hence X and Y can be uniquely recovered from, so is injective.

30 Bounding the bottleneck measure Claim 3: is “weight-preserving”: Proof: – First, note that - since – We now distinguish four cases: 1. ε is ↓-transition : Suppose M′=M−e. Then, so, viewed as multisets, and are identical. Hence we have: 2. ε is ↑-transition : The same as (1), with the roles of M and M′ interchanged

31 Bounding the bottleneck measure 3. ε is ↔-transition and the current path is a cycle : Suppose M′ = M +e−e′, and consider the multiset. Then, so the multiset differs from only in that e and e XYt are missing from it. Note that in this case,and therefore Thus we have: 4. ε is ↔-transition and the current path is not a cycle :This is identical with (3), except that the edge e XYt does not appear in the analysis. Accordingly, the bound is

32 Bounding the bottleneck measure The first inequality is claim 3 The second inequality follows from the fact that the length of any canonical path is bounded by 2n The last inequality follows from claim 2 and from the fact that is a probability distribution The can be easily improved to to reach the claimed bound

33 Summary (so far) The canonical paths and the bound on the bottleneck, lead to the prove of proposition 2 – bound on the mixing time of M Match Proposition 2, together with proposition 1, proved that the algorithm MatchSample is indeed an FPRAS for Z G So, until now, we showed that we can sample weighted matchings from and approximate Z G Now, we will use these results to approximate the number of perfect matchings in G

34 Perfect Matchings Let G = (V,E) be a graph with |V| = 2n Perfect-matchings: matchings which cover every vertex in the graph Near-perfect matching: matchings with exactly two unmatched vertices Note: – the number of perfect matchings is m n – the number of near-perfect matchings is m n−1 Theorem: There exists a randomized approximation scheme for the number of perfect matchings m n whose running time is polynomial in n, ε −1 and the ratio m n−1 /m n – This is not in general an FPRAS, since there exist 2n-vertex graphs for which the ratio m n−1 /m n is exponential in n – However, the probability that a randomly selected G on 2n vertices violates the inequality m n−1 /m n ≤ 4n tends to 0 as n → ∞. – Thus, the above algorithm constitutes an FPRAS for almost all graphs

35 Perfect Matchings – continued Idea: get a good estimator for m n by sampling matchings from the distribution π λ and computing the proportion X, between the perfect matchings’ weight m n λ n and the total weight Z G (λ) Suppose that we have computed a good estimate Z’ G (λ) of Z G (λ) – We showed this can be done in time polynomial in n and λ′ Since E[X] = m n λ n /Z G (λ), our estimator for m n will be Y = Xλ −n Z’ G (λ) The sample size required to ensure a good estimate depends on the variance of a single sample, or more precisely on the quantity (E[X]) −1 By making λ large enough, we can make this quantity small – Corresponds to placing very large weight on the perfect matchings We will next show that (E[X]) −1 ≤ n+1 and therefore, the sample size required grows only linearly with n

36 The log-concave lemma Definition: (a 0, a 1,..., a n ) is log-concave if a k−1 a k+1 ≤ (a k ) 2 for k = 1, 2,..., n−1 Note: if a sequence is log-concave, then: and therefore: Lemma: The sequence m 0,m 1,...,m n is log-concave As noted, it follows that This means that, if we take λ ≥ m n−1 /m n, we get:

37 Perfect Matchings – continued Using we get: So, the sample size required grows only linearly with n Since the time required to generate a single sample grows linearly with λ and ε −1 (proposition 2), the running time of the overall algorithm is polynomial in n, ε −1 and the ratio m n−1 /m n as claimed

38 The log-concave lemma – proof Let M k = M k (G) be the set of k-matchings of G – Thus m k = |M k (G)| We need to show that m k−1 m k+1 ≤ m k 2 and so we can assume that m k+1 > 0 Let A = M k+1 ×M k−1 and B = M k ×M k – so we need to show If M,M′ are matchings, we know that M  M’ consists of paths and cycles Let a path of M  M’ be an – M-path : if it contains more M-edges than M′-edges – M′-path : if the reverse is true For any pair the number of M-paths exceeds the number of M′- paths by exactly two

39 The log-concave lemma – proof We partition A into disjoint classes A r, (r = 1,2,...,k) where Similarly, we partition B into: We will now show that for all r>0, and therefore Let us call a pair reachable from iff and for some M-path P of M  M’ The number of elements of B r reachable from a given is r+1 Conversely, any given element of B r is reachable from precisely r elements of A r Hence if |A r | > 0 we have

40 Summary We showed that we can sample weighted matchings from and approximate Z G We used these results to show that there exists a randomized approximation scheme for the number of perfect matchings, whose running time is polynomial in n, ε −1 and the ratio m n−1 /m n