A Polynomial-Time Approximation Algorithm for the Permanent of A
Total Page:16
File Type:pdf, Size:1020Kb
A polynomialtime approximation algorithm for the permanent of a matrix with nonnegative entries∗ Mark Jerrum Alistair Sinclair Eric Vigoda Division of Informatics Computer Science Division Division of Informatics University of Edinburgh Univ. of California, Berkeley University of Edinburgh The King’s Buildings Soda Hall The King’s Buildings Edinburgh EH9 3JZ Berkeley, CA 94720•1776 Edinburgh EH9 3JZ United Kingdom USA United Kingdom [email protected] [email protected] [email protected] ABSTRACT for counting perfect matchings in planar graphs [9], which 3 We present a fully-polynomial randomized approximation uses just O(n ) arithmetic operations. scheme for computing the permanent of an arbitrary matrix This lack of progress was explained in 1979 by Valiant [15], with non-negative entries. who proved that exact computation of the permanent is #P- complete, even for 0,1 matrices, and hence (under standard complexity-theoretic assumptions) not possible in polyno- 1. PROBLEM DESCRIPTION mial time. Since then the focus has shifted to efficient AND HISTORY approximation algorithms with precise performance guar- The permanent of an n n matrix A =(a(i, j)) is defined antees. Essentially the best one can wish for is a fully- as × polynomial randomized approximation scheme (fpras), which Y X provides an arbitrarily close approximation in time that de- per(A)= a(i, π(i)), pends only polynomially on the input size and the desired π i error. (For precise definitions of this and other notions, see where the sum is over all permutations π of 1, 2,... ,n . the next section.) When A is a 0,1 matrix, we can view it as the{ adjacency} Of the several approaches to designing an fpras that have matrix of a bipartite graph GA = (V1,V2,E). It is clear been proposed, perhaps the most promising was the “Markov that the permanent of A is then equal to the number of chain Monte Carlo” approach. This takes as its starting perfect matchings in GA. point the observation that the existence of an fpras for the The evaluation of the permanent has attracted the atten- 0,1 permanent is computationally equivalent to the exis- tion of researchers for almost two centuries, beginning with tence of a polynomial time algorithm for sampling perfect the memoirs of Binet and Cauchy in 1812 (see [12] for a com- matchings from a bipartite graph (almost) uniformly at ran- prehensive history). Despite many attempts, an efficient dom [7]. algorithm for general matrices remained elusive. Indeed, Broder [3] proposed a Markov chain Monte Carlo method Ryser’s algorithm [12] remains the most efficient for com- for sampling perfect matchings. This was based on sim- puting the permanent exactly, even though it uses as many ulation of a Markov chain whose state space consisted of as Θ(n2n) arithmetic operations. A notable breakthrough all perfect and “near-perfect” matchings (i.e., matchings was achieved about 40 years ago with Kasteleyn’s algorithm with two uncovered vertices, or “holes”) in the graph, and whose stationary distribution was uniform. Evidently, this ∗This work was partially supported by the EPSRC Research approach can be effective only when the near-perfect match- Grant “Sharper Analysis of Randomised Algorithms: a ings do not outnumber the perfect matchings by more than Computational Approach” and by NSF grants CCR-982095 a polynomial factor. By analyzing the convergence rate of and ECS-9873086. Part of the work was done while the first Broder’s Markov chain, Jerrum and Sinclair [4] showed that and third authors were guests of the Forschungsinstitut f¨ur Mathematik, ETH, Z¨urich, Switzerland. A preliminary ver- the method works in polynomial time whenever this condi- sion of this paper appears in the Electronic Colloquium on tion is satisfied. This led to an fpras for the permanent of Computational Complexity, Report TR00-079, September several interesting classes of 0,1 matrices, including all dense 2000. matrices and a.e. random matrix. For the past decade, an fpras for the permanent of ar- bitrary 0,1 matrices has resisted the efforts of researchers. There has been similarly little progress on proving the con- Permission to make digital or hard copies of all or part of this work for verse conjecture, that the permanent is hard to approximate personal or classroom use is granted without fee provided that copies are in the worst case. Attention has switched to two complemen- not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to tary questions: how quickly can the permanent be approx- republish, to post on servers or to redistribute to lists, requires prior specific imated within an arbitrary close multiplicative factor; and permission and/or a fee. what is the best approximation factor achievable in poly- STOC’01, July 6•8, 2001, Hersonissos, Crete, Greece. nomial time? Jerrum and Vazirani [8], building upon the Copyright 2001 ACM 1•58113•349•9/01/0007 ...$5.00. work of Jerrum and Sinclair, presented an approximation exposition, we make no attempt to optimize the exponents scheme whose running time was exp(O(√n)) in the worst in our polynomial running times. case, which though substantially better than Ryser’s ex- act algorithm is still exponential time. In the complemen- 2. RANDOM SAMPLING tary direction, there are several polynomial time algorithms that achieve an approximation factor of cn, for various con- AND MARKOV CHAINS stants c (see, e.g., [10, 2]). To date the best of these is due to Barvinok [2], and gives c 1.31. 2.1 Random sampling ∼ In this paper, we resolve the question of the existence of As stated in the Introduction, our goal is a fully-polynom- an fpras for the permanent of a general 0,1 matrix (and in- ial randomized approximation scheme (fpras) for the perma- deed, of a general matrix with non-negative entries) in the nent. This is a randomized algorithm which, when given as affirmative. Our algorithm is based on a refinement of the input an n n non-negative matrix A together with an ac- Markov chain Monte Carlo method mentioned above. The curacy parameter× ε (0, 1], outputs a number Z (a random key ingredient is the weighting of near-perfect matchings variable of the coins∈ tossed by the algorithm) such that in the stationary distribution so as to take account of the Pr[(1 ε) per(A) Z (1 + ε) per(A)] 3 , positions of the holes. With this device, it is possible to − ≤ ≤ ≥ 4 arrange that each hole pattern has equal aggregated weight, and runs in time polynomial in n and ε−1. The probabil- and hence that the perfect matchings are not dominated too ity 3/4 can be increased to 1 δ for any desired δ > 0 by much. The resulting Markov chain is a variant of Broder’s outputting the median of O(log−δ−1) independent trials [7]. earlier one, with a Metropolis rule that handles the weights. To construct an fpras, we will follow a well-trodden path The analysis of the mixing time follows the earlier argu- via random sampling. We focus on the 0,1 case; see section 5 ment of Jerrum and Sinclair [4], except that the presence of for an extension to the case of matrices with general non- the weights necessitates a combinatorially more delicate ap- negative entries. Recall that when A is a 0,1 matrix, per(A) plication of the path-counting technology introduced in [4]. is equal to the number of perfect matchings in the corre- The computation of the required hole weights presents an sponding bipartite graph G . Now it is well known—see for additional challenge which is handled by starting with the A example [6]—that for this and most other natural combina- complete graph (in which everything is trivial) and slowly re- torial counting problems, an fpras can be built quite easily ducing the presence of matchings containing non-edges of G, from an algorithm that generates the same combinatorial computing the required hole weights as this process evolves. objects, in this case perfect matchings, (almost) uniformly We conclude this introductory section with a statement at random. It will therefore be sufficient for us to construct a of the main result of the paper. fully-polynomial almost uniform sampler for perfect match- Theorem 1. There exists a fully-polynomial randomized ings, namely a randomized algorithm which, given as inputs approximation scheme for the permanent of an arbitrary n an n n 0,1 matrix A and a bias parameter δ (0, 1], out- × × ∈ ′ n matrix A with non-negative entries. puts a random perfect matching in GA from a distribution that satisfies U The condition in the theorem that all entries be non-negative ′ d ( , ) δ, cannot be dropped. One way to appreciate this is to consider tv U U ≤ what happens if we replace matrix entry a(1, 1) by a(1, 1) α where is the uniform distribution on perfect matchings where α is a parameter that can be varied. Call the result-− U 1 in GA and dtv denotes (total) variation distance. The ing matrix Aα. Note that per(Aα) = per(A) α per(A1,1), algorithm is required to run in time polynomial in n and − − where A1,1 denotes the submatrix of A obtained by deleting log δ 1. the first row and column. On input Aα, an approximation This paper will be devoted mainly to the construction of a scheme would have at least to identify correctly the sign of fully-polynomial almost uniform sampler for perfect match- per(Aα); then the root of per(A) α per(A1,1) = 0 could be − ings in an arbitrary bipartite graph.