Approximating permanents and hafnians
Alexander Barvinok
Main results: permanents
We discuss analytic methods of efficient approximation of permanents and hafnians of real and complex matrices as well as of their multi-dimensional versions, objects of considerable interest in connection with problems in combinatorics , , quantum physics , , and computational complexity , .
Let be an real or complex matrix. The permanent of is defined as
where is the symmetric group of permutations of the set . It is a -hard problem to compute the permanent of a given 0-1 matrix exactly , although a fully polynomial randomized approximation scheme is constructed for non-negative matrices . The permanent of an non-negative matrix can be approximated within a factor of in deterministic polynomial time and the factor was improved to in (with a conjectured improvement to ). If one assumes that
More precisely, we prove the following result.
For any there exists such that for any positive integer and any there exists a polynomial in the entries of an matrix such that and
for all real matrices satisfying
We show that the polynomial can be computed in quasi-polynomial time , where the implied constant in the “” notation depends on alone.
Our approach continues a line of work started in and continued in , and . The main idea is to relate approximability of a polynomial with its complex zeros. For a complex number , we denote by and , the real and imaginary parts of correspondingly. In what follows, we always choose the standard branch of , and for real , so that
We deduce Theorem 1.1 from the following result.
Let be an complex matrix such that
In this paper, we prove the following results.
Let be an complex matrix such that
For every there exists a constant such that for every positive integer and every real there exists a polynomial in the entries of an complex matrix such that and
for complex matrices satisfying
Moreover, the polynomial can be computed in time, where the implied constant in the “” notation depends on alone.
A version of Theorem 1.3 with a weaker bound of instead of and a more complicated proof was obtained in . Theorem 1.4 is also implicit in . We present its proof here since it serves as a stepping stone for the proof of Theorem 1.1.
It is not known whether the bound in Theorems 1.3 and 1.4 can be increased, although one can show (see Section 4) that it cannot be increased to .
Let be the real solution of the equation . Let be an complex matrix such that
For every , where is the constant in Theorem 1.5, there exists a constant such that for every positive integer and every real there exists a polynomial in the entries of an matrix such that and
for complex matrices satisfying
Again, the polynomial can be constructed in time, where the implied constant in the “” notation depends on only. Note that Theorem 1.6 is applicable to 0-1 matrices having not too many (not more than ) zeros in every row and column as well as to real matrices with some positive and some negative entries. It is not known whether the bound in Theorems 1.5 and 1.6 are optimal.
Main results: hafnians
Some of our results immediately extend from permanents to hafnians.
Let be a symmetric real or complex matrix. The hafnian of is defined as
where the sum is taken over unordered partitions of the set into pairwise disjoint unordered pairs , see for example, Section 8.2 of . Just as the permanent of the biadjacency matrix of a bipartite graph enumerates the perfect matchings in the graph, the hafnian of the adjacency matrix of a graph enumerates the perfect matchings in the graph. In fact, for any matrix we have
and hence computing the permanent of an matrix reduces to computing the hafnian of a symmetric matrix.
In this paper, we prove the following versions of Theorem 1.1 and 1.2.
For any there exists such that for any positive integer and any there exists a polynomial in the entries of a symmetric matrix such that and
for all real symmetric matrices satisfying
The polynomial can be computed in time, where the implied constant in the “” notation depends on alone. Consequently, we obtain a deterministic quasi-polynomial algorithm to approximate the hafnian of a positive matrix satisfying (1.1.1) within any given relative error .
As is the case with permanents, we deduce Theorem 2.1 from a result on the complex zeros of the hafnian.
Let us fix a real and and let
Let be an symmetric complex matrix such that
We also obtain the following versions of Theorems 1.3 and 1.4.
Let be an symmetric complex matrix such that
For any there exists and for any positive integer and real there exists a polynomial in the entries of complex symmetric matrix such that and
As before, the polynomial can be computed in time, where the implied constant in the “” notation depends on alone.
Our approach can be extended to a variety of partition functions , . In Section 3, we show how to extend it to multi-dimensional permanents of tensors.
Main results: multi-dimensional permanents
Let be a -dimensional array (tensor) filled with real or complex matrices. We define the permanent of by
We define a slice of as the array of entries of with one of the indices fixed to a particular value and the remaining indices varying arbitrarily. Hence has altogether slices. If and is a matrix then a slice is a row or a column.
We note that for there are several different notions of the permanent of a tensor, cf., for example, .
We obtain the following extension of Theorem 1.3.
for some such that . Hence and we can choose , , and .
Let be a -dimensional complex array such that
A version of Theorem 3.1 with weaker bounds , and and a more complicated proof was obtained in .
For an integer , let us choose , where is the constant in Theorem 3.1. Then there exists and for every integer and real there exists a polynomial in the entries of a -dimensional complex tensor such that and
The polynomial can be computed in time, where the implied constant in the “” notation depends only on and .
While we were unable to obtain exact equivalents of Theorems 1.1 and 2.1, our approach produces the following approximation result for multi-dimensional permanents.
so that , , , etc.
For any there is a constant and for any positive integer and real there is a polynomial is the entries of a -dimensional tensor such that and
for any -dimensional real tensor satisfying
For an integer , let be the constant of Theorem 3.3. Let us fix a real and let
Let be a -dimensional tensor of complex numbers such that
for all .
Finally, we obtain multi-dimensional versions of Theorems 1.5 and 1.6.
Let be the real solution of the equation . For an integer , let
Let be a -dimensional complex array such that the sum of over each slice of does not exceed .
For every integer and every , where is the constant of Theorem 3.5, there exists a constant such that for any positive integer and real there is a polynomial in the entries of a -dimensional tensor such that and
for any -dimensional tensor for which the sum of over each slice of does not exceed .
Again, the polynomial can be computed in time, where the implied constant in the “” notation depends on and alone. Theorem 3.6 is applicable to 0-1 tensors , which contain a small (and exponentially decreasing with ) fraction of 0s in each slice.
In Section 4, we prove Theorems 1.3, 2.3 and 3.1.
In Section 5, we prove Theorems 1.2, 2.2 and 3.3.
In Section 6, we prove Theorems 1.5 and 3.5.
In Section 7, we prove Theorems 1.4, 1.6, 2.4, 3.2 and 3.6.
In Section 8, we prove Theorems 1.1, 2.1 and 3.3.
Finally, in Section 9, we discuss possible ramifications and open questions.
Proofs of Theorems 1.3, 2.3 and 3.1
and by the corresponding Euclidean norm (the modulus of a complex number).
Let and be complex numbers such that
Then , and the angle between and does not exceed
Let us consider the orthogonal projection of each vector onto the bisector of . Then the length of the projection of is at least and hence the length of the orthogonal projection of onto the bisector of is at least
Since the length of is at least as large as the length of its orthogonal projection, the proof of Part (1) follows.
From Part (1), we conclude that . Therefore, and the angle between and does not exceed
Similarly, and the angle between and does not exceed
Therefore, the angle between and does not exceed
and the proof of Part (2) follows.
For a positive integer , let be the set of complex matrices such that
We prove by induction on the following statement:
The statement obviously holds for . Assuming that the statement holds for matrices in with , let us consider two matrices that differ in one row or in one column only. Since the permanent of a matrix does not change when the rows or columns of the matrix are permuted or when the matrix is transposed, without loss of generality we assume that is obtained from by replacing the entries of the first row by complex numbers for . Let be the matrix obtained from by crossing out the first row and the -th column. Then
which concludes the induction step.
One can observe that is the largest value of for which the equation
has a solution and hence the induction in Section 4.1 can proceed. It is not known whether the constant in Theorem 1.3 can be increased. Since
the value of in Theorem 1.3 cannot be replaced by . Moreover, as Boris Bukh noticed , we have
where is a matrix as above, is odd and is an matrix filled with 1s.
2 Proof of Theorem 2.3
The statement obviously holds for . Suppose that . Since the hafnian of the matrix does not change under a simultaneous permutation of rows and columns, without loss of generality we may assume that and differ in the first row and first column only. Instead of the Laplace expansion (4.1.2), we use the recurrence
where is the matrix obtained from by crossing out the first row and the first column and the -th row and the -th column. We observe that, up to a simultaneous permutation of rows and columns, any two matrices and differ only in the -th row and -th column for some and the induction proceeds as in Section 4.1.
3 Proof of Theorem 3.1
By and large, the proof proceeds as in Section 4.1. For a positive integer , we define as the set of complex arrays such that
We prove by induction on the following statement:
and the statement holds. Assuming that , let us consider two tensors that differ in one slice only. Without loss of generality, we assume that is obtained from by replacing the “top slice” numbers with numbers . We use a -dimensional version of the Laplace expansion:
Proofs of Theorems 1.2, 2.2 and 3.4
As in Section 4, we start with a simple geometric lemma.
for some complex numbers and .
Suppose that are non-negative real and that are real such that
Suppose that and are real such that
for some . Then , and the angle between and does not exceed .
for some and some . Then , and the angle between and does not exceed
It follows that , and that the angle between and is
with the equality attained when and is orthogonal to . Hence for given and the largest angle of
between and is attained when is orthogonal to and is equal to
By Part (2), , and the angle between and does not exceed . Since
Since , we have , and the angle between and and the angle between and do not exceed
Therefore the angle between and does not exceed and the proof of Part (3) follows.
For a positive integer , let be the set of complex matrices such that
We prove by induction on the following statement:
2 Proof of Theorem 2.2
Since , the statement holds for . Suppose that . As in Section 4.2, without loss of generality we assume that and differ in the first row and column only. Let be the matrix obtained from by crossing out the first row and the first column and the -th row and the -th column. As in Section 4.2, we observe that, up to a simultaneous permutation of rows and columns (which does not change the hafnian), any two matrices and differ only in the -th row and -th column for some . Using the expansion (4.2.1), we complete the induction as in Section 5.1.
3 Proof of Theorem 3.4
By and large, the proof proceeds as in Section 5.1. For a positive integer , we define as the set of complex arrays such that
for all . We prove by induction on the following statement:
Proofs of Theorems 1.5 and 3.5
Since Theorem 1.5 is a particular case of Theorem 3.5 for , we prove the latter theorem. We use a combinatorial interpretation of the multi-dimensional permanent in terms of matchings in a hypergraph.
If then has no edges and hence . Suppose now that . We observe the following recurrence:
where the accounts for the matchings in not containing and the sum accounts for the matchings of containing . By the induction hypothesis, , so we rewrite (6.1.2) as
If there are no edges containing then and (6.1.1) follows. Otherwise, let be an edge containing . Telescoping, we obtain
By the induction hypothesis, each ratio in the right hand side of (6.1.4) does not exceed in the absolute value, and hence
from which it follows that . Denoting
from (6.1.5) we have a chain of implications
The bound of Lemma 6.1 and to some extent its proof agrees with those of for the roots of the matching polynomial of a graph.
Next, we need a weaker version on an estimate from .
Let be the constant of Theorem 3.5, so that . For a positive integer , let
Proof. We observe that if then
Finally, we need a theorem of Szegő, see for example, Chapter IV of and also for generalizations.
be complex polynomials. We define the Schur product by
Suppose that whenever and whenever for some .
Then whenever .
2 Proof of Theorem 3.5
Let be the complete -partite hypergraph with set of vertices, split into parts and vertices in each part numbered through . Each edge of consist of exactly one vertex from each part and we let the weight of edge equal to . For , let be the total weight of all matchings in consisting of exactly edges. We write
Then is the value of the matching polynomial on the scaled weights and from Lemma 6.1 we conclude that
Let be the polynomial of Lemma 6.2. Applying Lemma 6.2 and Theorem 6.1 to the Schur product of and polynomials , we conclude from (6.2.1) that
Proofs of Theorems 1.4, 1.6, 2.4, 3.2 and 3.6
We need the following simple result first obtained in . For completeness, we give its proof here.
be the Taylor polynomial of of degree computed at . Then
Using the Taylor series expansion for the logarithm, we obtain
It follows from Lemma 7.1 that as long as the roots of a polynomial stay at distance at least away from for some fixed , then to approximate within an additive error , we can use the Taylor polynomial of at of degree , where the implied constant in the “” notation depends on only.
As is discussed in , the computation of the first derivatives of reduces to the computation of the first derivatives of . Indeed,
where . Writing equations (7.1.1) for we obtain a non-singular triangular system of linear equations in with numbers on the diagonal from which the values of can be computed in time from the values of . Thus
and, generally, is a linear combination of expressions of the type
Note that computing from is akin to computing cumulants of a distribution from its moments.
2 Proof of Theorem 1.4
Let be the matrix filled with 1s and let be an complex matrix satisfying the conditions of the theorem. We define a univariate polynomial
be the Taylor polynomial of degree computed at . It follows from Lemma 7.1 that for some constant and integer we have
It remains to show that is a polynomial in the entries of the matrix of degree at most . In view of Section 7.1 and the fact that , it suffices to check that is a polynomial in the entries of the matrix of degree at most which can be computed in time, where the implied constant in the “” notation is absolute. We have
where the last sum is taken over all ordered sets of distinct numbers between and . By symmetry, we can further write
where the last sum is taken over all pairs of ordered sets and of distinct numbers between and .
It follows that the polynomial of Theorem 1.4 can be computed in time , where the implied constant in the “” notation depends on alone.
3 Proof of Theorem 2.4
The proof is very similar to that of Section 7.2. Let be the matrix filled with 1s and let be a symmetric complex matrix satisfying the conditions of theorem. We define a univariate polynomial
where the sum is taken over all unordered partitions of the set into pairwise disjoint unordered pairs . Hence for we have
where the sum is taken over all unordered collections of pairwise disjoint unordered pairs.
The proof then proceeds as in Section 7.2.
It follows that the polynomial of Theorem 2.4 can be computed in time , where the implied constant in the “” notation depends on alone.
4 Proof of Theorem 3.2
Let be the -dimensional tensor filled with 1s and let be the tensor satisfying the conditions of the theorem. We introduce a univariate polynomial
where the last sum is taken over all ordered -tuples of distinct indices . By symmetry we can write
where the last sum is taken over all collections of ordered -tuples for of distinct indices . The proof then proceeds as in Section 7.2.
The polynomial can be computed in time, where the implied constant in the “” notation depends on and only.
5 Proof of Theorems 1.6 and 3.6
As Theorem 1.6 is a particular case of Theorem 3.6, we prove the latter theorem only. As in Section 7.4, we define the univariate polynomial (7.4.1). By Theorem 3.5, we have
and the proof follows as in Section 7.4.
Proofs of Theorems 1.1, 2.1 and 3.3
Lemma 7.1 allows us to approximate the value of by a low degree Taylor polynomial of at provided the polynomial does not have zeros in a disc of radius centered at . In view of Theorems 1.2, 2.2 and 3.4, we would like to construct a similar approximation under a weaker assumption that for in some neighborhood of the interval $\phi\phi(0)=0\phi(1)=1\phi|z|\leq\beta\beta>1g(\phi(z))\phi$.
Then is a polynomial of degree such that , ,
Proof. Clearly, is a polynomial of degree such that and . It remains to prove that maps the disc into the strip , .
the function is well-defined by the choice of a branch of the logarithm, which we choose so that
Combining (8.0.1), (8.0.2) and (8.0.3), we conclude that for we have
Substituting in (8.0.3) and using (8.0.2), we conclude that
where is positive real, which by (8.0.5) satisfies
Let be an real matrix satisfying the conditions of the theorem and let be the matrix filled with 1s. As in Section 7.2, we define a univariate polynomial
for some and . Then the entries of the matrix satisfy
and then choose such that
By Theorem 1.2, we have for satisfying (8.1.1).
Using Lemma 8.1, we construct a univariate polynomial of some degree such that , and maps the disc inside the strip (8.1.1), where . Let
Then is a univariate polynomial such that ,
where we chose the branch of the logarithm such that is real. Let be the Taylor polynomial of of degree computed at . By Lemma 7.1, we have
for some where is a constant depending on alone. It remains to show that is a polynomial in the entries of of degree not exceeding .
For a univariate polynomial , let be the polynomial obtained from by discarding all monomials of degree higher than . Since , the constant term of of is and therefore
In words: to compute the polynomial obtained from by discarding the monomials of degree higher than , it suffices to compute the polynomials and obtained from and respectively by discarding the monomials of degree higher than , and then discard the monomials of degree higher than in the composition .
From Section 7.2, it follows that is a polynomial of degree in the entries of the matrix . It follows then that is a polynomial in the entries of of degree at most that can be computed in time (the implied constant in the “” notation is absolute). From Section 7.1 it follows then that is a polynomial in the entries of of degree at most , which completes the proof.
2 Proof of Theorem 2.1
Given a real symmetric matrix satisfying the conditions of the theorem, we define the univariate polynomial by
where is the matrix filled with 1s and the proof then proceeds as in Section 8.1, only that the reference to Theorem 1.2 is replaced by the reference to Theorem 2.2 and the reference to Section 7.2 is replaced by the reference to Section 7.3.
3 Proof of Theorem 3.3
Given a -dimensional tensor satisfying the conditions of the theorem, we define the univariate polynomial by
where is the -dimensional tensor filled with 1s. Suppose that (8.1.1) holds for some and . Then the entries of the tensor satisfy
and then choose such that
By Theorem 3.4, we have for satisfying (8.1.1) with and so chosen. The proof then proceeds as in Section 8.1, only that the reference to Section 7.2 is replaced by the reference to Section 7.4.
Concluding remarks
2 Connections to the Szegő curve
Kontorovich and Wu noticed that the location of the complex zeros of , which is crucial for our analysis of the approximation of the permanent, for can be determined from a result of Szegő, who showed in 1922 that as , the zeros of the polynomial
3 Connections to the mixed characteristic polynomial
In their solution of the Kadison - Singer problem, Marcus, Spielman and Srivastava introduced and studied the mixed characteristic polynomial of Hermitian matrices ,
where is the sum of permanents of the submatrices of , so up to a sign and a substitution , the polynomial is the matching polynomial of Section 6 (and the fact that the roots of are non-negative real is a particular case of the Heilmann - Lieb Theorem ). On the other hand,
The relation between and is essentially used in the proof of Theorem 3.5, which was absent in the version of the paper the referee commented on, but was obtained before the author received the comment.
On the other hand, the general mixed characteristic polynomial may appear useful for approximating the mixed discriminant of , which, up to a sign is just the constant term of .
4 Approximation of general polynomials
As another example, we consider the independence polynomial of graph. Let be a graph (undirected, without loops or multiple edges) with set of vertices and set of edges. A set is called independent if no two vertices in span an edge of (the empty set is considered independent). The independence polynomial of is defined as
Then is the number of all independent sets in , a quantity of considerable combinatorial interest. On the other hand, the value of the derivative can be computed in time by a direct inspection of all -subsets .
Suppose we know that provided for some (for example, can be the Dobrushin bound, see and ). Lemma 7.1 then implies that for any , fixed in advance, the value of can be approximated within a relative error in quasi-polynomial time provided , see for many examples of this nature and also and for algorithms based on the “correlation decay” idea.
On the other hand, for a general graph there cannot be such a sleeve unless NP-complete problems admit a quasi-polynomial time algorithm. Indeed, generally, it is an NP-hard problem to approximate for a real , where is some absolute constant and is the Dobrushin lower bound on the absolute value of the roots of . This means that for a general graph one can expect the complex roots of to “surround” the origin, so that there is no possibility to squeeze a sleeve between them to connect 0 and 1.
Since the first version of this paper appeared as a preprint, this general direction was pursued further in .
5 Approximating multi-dimensional permanents better
It would be interesting to extend the class of polynomials for which a version of Theorems 1.1 and 2.1 can be obtained. While we failed to obtain such a version for the multi-dimensional permanent (see Section 3), there does not seem to be a computational complexity obstacle for such an extension to exist. In it is shown that the -dimensional permanent of a tensor with positive entries between an arbitrarily small , fixed in advance, and 1 can be approximated within an factor in polynomial time, where the implicit constant in the “” notation depends only on and , which can be viewed as an indirect evidence that Theorem 1.1 can indeed be extended to multi-dimensional permanents.
Acknowledgments
I am grateful to anonymous referees for their careful reading of the paper and suggestions and to Max Kontorovich and Han Wu for conducting numerical experiments on the approximation of permanents and pointing out to connections with the Szegő curve.