♯P-completeness of 01-permanent

From HandWiki
Short description: Mathematical proof about the permanent of matrices

The #P-completeness of 01-permanent, sometimes known as Valiant's theorem,[1] is a mathematical proof about the permanent of matrices, considered a seminal result in computational complexity theory.[2][3] In a 1979 scholarly paper, Leslie Valiant proved that the computational problem of computing the permanent of a matrix is #P-hard, even if the matrix is restricted to have entries that are all 0 or 1.[4] In this restricted case, computing the permanent is even #P-complete, because it corresponds to the #P problem of counting the number of permutation matrices one can get by changing ones into zeroes.

Valiant's 1979 paper also introduced #P as a complexity class.[5]

Valiant's definition of completeness, and his proof of completeness of 01-permanent, both used polynomial-time Turing reductions. In this kind of reduction, a single hard instance of some other problem in #P is reduced to computing the permanent of a sequence of multiple graphs, each of which could potentially depend on the results of previous permanent computations. A later simplification by (Ben-Dor Halevi) showed that it is possible to use a weaker notion of reduction, a polynomial-time counting reduction, that translates the other problem into a single instance of the permanent problem.

Significance

One reason for interest in the computational complexity of the permanent is that it provides an example of a problem where constructing a single solution can be done efficiently but where counting all solutions is hard.[6] As Papadimitriou writes in his book Computational Complexity:

Specifically, computing the permanent (shown to be difficult by Valiant's results) is closely connected with finding a perfect matching in a bipartite graph, which is solvable in polynomial time by the Hopcroft–Karp algorithm.[7][8] For a bipartite graph with 2n vertices partitioned into two parts with n vertices each, the number of perfect matchings equals the permanent of its biadjacency matrix and the square of the number of perfect matchings is equal to the permanent of its adjacency matrix.[9] Since any 0–1 matrix is the biadjacency matrix of some bipartite graph, Valiant's theorem implies[9] that the problem of counting the number of perfect matchings in a bipartite graph is #P-complete, and in conjunction with Toda's theorem this implies that it is hard for the entire polynomial hierarchy.[10][11]

The computational complexity of the permanent also has some significance in other aspects of complexity theory: it is not known whether NC equals P (informally, whether every polynomially-solvable problem can be solved by a polylogarithmic-time parallel algorithm) and Ketan Mulmuley has suggested an approach to resolving this question that relies on writing the permanent as the determinant of a matrix.[12]

Hartmann [13] proved a generalization of Valiant's theorem concerning the complexity of computing immanants of matrices that generalize both the determinant and the permanent.

Ben-Dor and Halevi's proof

Below, the proof that computing the permanent of a 01-matrix is #P-complete is described. It mainly follows the proof by (Ben-Dor Halevi).[14]

Overview

Any square matrix [math]\displaystyle{ A = (a_{ij}) }[/math] can be viewed as the adjacency matrix of a directed graph, with [math]\displaystyle{ a_{ij} }[/math] representing the weight of the edge from vertex i to vertex j. Then, the permanent of A is equal to the sum of the weights of all cycle-covers of the graph; this is a graph-theoretic interpretation of the permanent.

#SAT, a function problem related to the Boolean satisfiability problem, is the problem of counting the number of satisfying assignments of a given Boolean formula. It is a #P-complete problem (by definition), as any NP machine can be encoded into a Boolean formula by a process similar to that in Cook's theorem, such that the number of satisfying assignments of the Boolean formula is equal to the number of accepting paths of the NP machine. Any formula in SAT can be rewritten as a formula in 3-CNF form preserving the number of satisfying assignments, and so #SAT and #3SAT are equivalent and #3SAT is #P-complete as well.

In order to prove that 01-Permanent is #P-hard, it is therefore sufficient to show that the number of satisfying assignments for a 3-CNF formula can be expressed succinctly as a function of the permanent of a matrix that contains only the values 0 and 1. This is usually accomplished in two steps:

  1. Given a 3-CNF formula φ, construct a directed integer-weighted graph [math]\displaystyle{ G_\phi }[/math], such that the sum of the weights of cycle covers of [math]\displaystyle{ G_\phi }[/math] (or equivalently, the permanent of its adjacency matrix) is equal to the number of satisfying assignments of φ. This establishes that Permanent is #P-hard.
  2. Through a series of reductions, reduce Permanent to 01-Permanent, the problem of computing the permanent of a matrix all entries 0 or 1. This establishes that 01-permanent is #P-hard as well.

Constructing the integer graph

Given a 3CNF-formula [math]\displaystyle{ \phi }[/math] with m clauses and n variables, one can construct a weighted, directed graph [math]\displaystyle{ G_\phi }[/math] such that

  1. each satisfying assignment for [math]\displaystyle{ \phi }[/math] will have a corresponding set of cycle covers in [math]\displaystyle{ G_\phi }[/math] where the sum of the weights of cycle covers in this set will be [math]\displaystyle{ 12^m }[/math] ; and
  2. all other cycle covers in [math]\displaystyle{ G_\phi }[/math] will have weights summing to 0.

Thus if [math]\displaystyle{ (\#\phi) }[/math] is the number of satisfying assignments for [math]\displaystyle{ \phi }[/math], the permanent of this graph will be [math]\displaystyle{ 12^m \cdot (\#\phi) }[/math]. (Valiant's original proof constructs a graph with entries in [math]\displaystyle{ \{-1,0,1,2,3\} }[/math] whose permanent is [math]\displaystyle{ 4^{t(\phi)}\cdot(\#\phi) }[/math] where [math]\displaystyle{ t(\phi) }[/math] is "twice the number of occurrences of literals in [math]\displaystyle{ \phi }[/math]" – [math]\displaystyle{ m }[/math].)

The graph construction makes use of a component that is treated as a "black box." To keep the explanation simple, the properties of this component are given without actually defining the structure of the component.

To specify Gφ, one first constructs a variable node in Gφ for each of the n variables in φ. Additionally, for each of the m clauses in φ, one constructs a clause component Cj in Gφ that functions as a sort of "black box." All that needs to be noted about Cj is that it has three input edges and three output edges. The input edges come either from variable nodes or from previous clause components (e.g., Co for some o < j) and the output edges go either to variable nodes or to later clause components (e.g., Co for some [math]\displaystyle{ o\gt j }[/math]). The first input and output edges correspond with the first variable of the clause j, and so on. Thus far, all of the nodes that will appear in the graph Gφ have been specified.

Next, one would consider the edges. For each variable [math]\displaystyle{ x_i }[/math] of [math]\displaystyle{ \phi }[/math], one makes a true cycle (T-cycle) and a false cycle (F-cycle) in [math]\displaystyle{ G_\phi }[/math]. To create the T-cycle, one starts at the variable node for [math]\displaystyle{ x_i }[/math] and draw an edge to the clause component [math]\displaystyle{ C_j }[/math] that corresponds to the first clause in which [math]\displaystyle{ x_i }[/math] appears. If [math]\displaystyle{ x_i }[/math] is the first variable in the clause of [math]\displaystyle{ \phi }[/math] corresponding to [math]\displaystyle{ C_j }[/math], this edge will be the first input edge of [math]\displaystyle{ C_j }[/math], and so on. Thence, draw an edge to the next clause component corresponding to the next clause of [math]\displaystyle{ \phi }[/math] in which [math]\displaystyle{ x_i }[/math] appears, connecting it from the appropriate output edge of [math]\displaystyle{ C_j }[/math] to the appropriate input edge of the next clause component, and so on. After the last clause in which [math]\displaystyle{ x_i }[/math] appears, we connect the appropriate output edge of the corresponding clause component back to [math]\displaystyle{ x_i }[/math]'s variable node. Of course, this completes the cycle. To create the F-cycle, one would follow the same procedure, but connect [math]\displaystyle{ x_i }[/math]'s variable node to those clause components in which ~[math]\displaystyle{ x_i }[/math] appears, and finally back to [math]\displaystyle{ x_i }[/math]'s variable node. All of these edges outside the clause components are termed external edges, all of which have weight 1. Inside the clause components, the edges are termed internal edges. Every external edge is part of a T-cycle or an F-cycle (but not both—that would force inconsistency).

Note that the graph [math]\displaystyle{ G_\phi }[/math] is of size linear in [math]\displaystyle{ |\phi| }[/math], so the construction can be done in polytime (assuming that the clause components do not cause trouble).

Notable properties of the graph

A useful property of [math]\displaystyle{ G_\phi }[/math] is that its cycle covers correspond to variable assignments for [math]\displaystyle{ \phi }[/math]. For a cycle cover Z of [math]\displaystyle{ G_\phi }[/math], one can say that Z induces an assignment of values for the variables in [math]\displaystyle{ \phi }[/math] just in case Z contains all of the external edges in [math]\displaystyle{ x_i }[/math]'s T-cycle and none of the external edges in [math]\displaystyle{ x_i }[/math]'s F-cycle for all variables [math]\displaystyle{ x_i }[/math] that the assignment makes true, and vice versa for all variables [math]\displaystyle{ x_i }[/math] that the assignment makes false. Although any given cycle cover Z need not induce an assignment for [math]\displaystyle{ \phi }[/math], any one that does induces exactly one assignment, and the same assignment induced depends only on the external edges of Z. The term Z is considered an incomplete cycle cover at this stage, because one talks only about its external edges, M. In the section below, one considers M-completions to show that one has a set of cycle covers corresponding to each M that have the necessary properties.

The sort of Z's that don't induce assignments are the ones with cycles that "jump" inside the clause components. That is, if for every [math]\displaystyle{ C_j }[/math], at least one of [math]\displaystyle{ C_j }[/math]'s input edges is in Z, and every output edge of the clause components is in Z when the corresponding input edge is in Z, then Z is proper with respect to each clause component, and Z will produce a satisfying assignment for [math]\displaystyle{ \phi }[/math]. This is because proper Z's contain either the complete T-cycle or the complete F-cycle of every variable [math]\displaystyle{ x_i }[/math] in [math]\displaystyle{ \phi }[/math] as well as each including edges going into and coming out of each clause component. Thus, these Z's assign either true or false (but never both) to each [math]\displaystyle{ x_i }[/math] and ensure that each clause is satisfied. Further, the sets of cycle covers corresponding to all such Z's have weight [math]\displaystyle{ 12^m }[/math], and any other Z's have weight [math]\displaystyle{ 0 }[/math]. The reasons for this depend on the construction of the clause components, and are outlined below.

The clause component

To understand the relevant properties of the clause components [math]\displaystyle{ C_j }[/math], one needs the notion of an M-completion. A cycle cover Z induces a satisfying assignment just in case its external edges satisfy certain properties. For any cycle cover of [math]\displaystyle{ G_\phi }[/math], consider only its external edges, the subset M. Let M be a set of external edges. A set of internal edges L is an M-completion just in case [math]\displaystyle{ M\cup L }[/math] is a cycle cover of [math]\displaystyle{ G_\phi }[/math]. Further, denote the set of all M-completions by [math]\displaystyle{ L^M }[/math] and the set of all resulting cycle covers of [math]\displaystyle{ G_\phi }[/math] by [math]\displaystyle{ Z^M }[/math].

Recall that construction of [math]\displaystyle{ G_\phi }[/math] was such that each external edge had weight 1, so the weight of [math]\displaystyle{ Z^M }[/math], the cycle covers resulting from any M, depends only on the internal edges involved. We add here the premise that the construction of the clause components is such that the sum over possible M-completions of the weight of the internal edges in each clause component, where M is proper relative to the clause component, is 12. Otherwise the weight of the internal edges is 0. Since there are m clause components, and the selection of sets of internal edges, L, within each clause component is independent of the selection of sets of internal edges in other clause components, so one can multiply everything to get the weight of [math]\displaystyle{ Z^M }[/math]. So, the weight of each [math]\displaystyle{ Z^M }[/math], where M induces a satisfying assignment, is [math]\displaystyle{ 12^m }[/math]. Further, where M does not induce a satisfying assignment, M is not proper with respect to some [math]\displaystyle{ C_j }[/math], so the product of the weights of internal edges in [math]\displaystyle{ Z^M }[/math] will be [math]\displaystyle{ 0 }[/math].

The clause component is a weighted, directed graph with 7 nodes with edges weighted and nodes arranged to yield the properties specified above, and is given in Appendix A of Ben-Dor and Halevi (1993). Note that the internal edges here have weights drawn from the set [math]\displaystyle{ \{-1,0,1,2,3\} }[/math]; not all edges have 0–1 weights.

Finally, since the sum of weights of all the sets of cycle covers inducing any particular satisfying assignment is 12m, and the sum of weights of all other sets of cycle covers is 0, one has Perm(Gφ) = 12m·(). The following section reduces computing Perm([math]\displaystyle{ G_\phi }[/math]) to the permanent of a 01 matrix.

01-Matrix

The above section has shown that Permanent is #P-hard. Through a series of reductions, any permanent can be reduced to the permanent of a matrix with entries only 0 or 1. This will prove that 01-Permanent is #P-hard as well.

Reduction to a non-negative matrix

Using modular arithmetic, convert an integer matrix A into an equivalent non-negative matrix [math]\displaystyle{ A' }[/math] so that the permanent of [math]\displaystyle{ A }[/math] can be computed easily from the permanent of [math]\displaystyle{ A' }[/math], as follows:

Let [math]\displaystyle{ A }[/math] be an [math]\displaystyle{ n \times n }[/math] integer matrix where no entry has a magnitude larger than [math]\displaystyle{ \mu }[/math].

  • Compute [math]\displaystyle{ Q = 2 \cdot n! \cdot \mu^n + 1 }[/math]. The choice of Q is due to the fact that [math]\displaystyle{ |\operatorname{Perm}(A)| \le n! \cdot \mu^n }[/math]
  • Compute [math]\displaystyle{ A' = A\,\bmod\,Q }[/math]
  • Compute [math]\displaystyle{ P = \operatorname{Perm}(A') \bmod Q }[/math]
  • If [math]\displaystyle{ P \lt Q/2 }[/math] then Perm(A) = P. Otherwise [math]\displaystyle{ \operatorname{Perm}(A) = P - Q }[/math]

The transformation of [math]\displaystyle{ A }[/math] into [math]\displaystyle{ A' }[/math] is polynomial in [math]\displaystyle{ n }[/math] and [math]\displaystyle{ \log (\mu) }[/math], since the number of bits required to represent [math]\displaystyle{ Q }[/math] is polynomial in [math]\displaystyle{ n }[/math] and [math]\displaystyle{ \log (\mu) }[/math]

An example of the transformation and why it works is given below.

[math]\displaystyle{ A = \begin{bmatrix}2 & -2 \\ -2 & 1\end{bmatrix} }[/math]
[math]\displaystyle{ \operatorname{Perm}(A) = 2 \cdot 1 + (-2) \cdot (-2) = 6. }[/math]

Here, [math]\displaystyle{ n = 2 }[/math], [math]\displaystyle{ \mu = 2 }[/math], and [math]\displaystyle{ \mu^n = 4 }[/math], so [math]\displaystyle{ Q = 17 }[/math]. Thus

[math]\displaystyle{ A' = A \bmod 17 = \begin{bmatrix}2 & 15 \\ 15 & 1\end{bmatrix}. }[/math]

Note how the elements are non-negative because of the modular arithmetic. It is simple to compute the permanent

[math]\displaystyle{ \operatorname{Perm}(A') = 2 \cdot 1 + 15 \cdot 15 = 227 }[/math]

so [math]\displaystyle{ P = 227 \bmod 17 = 6 }[/math]. Then [math]\displaystyle{ P \lt Q/2 }[/math], so [math]\displaystyle{ \operatorname{Perm}(A) = P = 6. }[/math]

Reduction to powers of 2

Figure 1: Construction of 2Power from NonNeg

Note that any number can be decomposed into a sum of powers of 2. For example,

[math]\displaystyle{ 13 = 2^3 + 2^2 + 2^0 }[/math]

This fact is used to convert a non-negative matrix into an equivalent matrix whose entries are all powers of 2. The reduction can be expressed in terms of graphs equivalent to the matrices.

Let [math]\displaystyle{ G }[/math] be a [math]\displaystyle{ n }[/math]-node weighted directed graph with non-negative weights, where largest weight is [math]\displaystyle{ W }[/math]. Every edge [math]\displaystyle{ e }[/math] with weight [math]\displaystyle{ w }[/math] is converted into an equivalent edge with weights in powers of 2 as follows:

[math]\displaystyle{ w = 2^{x_1} + 2^{x_2} + \cdots + 2^{x_r} }[/math], [math]\displaystyle{ 0 \le x_1 \le x_2 \le \cdots \le x_r \le \log (w) }[/math]

This can be seen graphically in the Figure 1. The subgraph that replaces the existing edge contains [math]\displaystyle{ r }[/math] nodes and [math]\displaystyle{ 3r }[/math] edges.

To prove that this produces an equivalent graph [math]\displaystyle{ G' }[/math] that has the same permanent as the original, one must show the correspondence between the cycle covers of [math]\displaystyle{ G }[/math] and [math]\displaystyle{ G' }[/math].

Consider some cycle-cover [math]\displaystyle{ R }[/math] in [math]\displaystyle{ G }[/math].

  • If an edge [math]\displaystyle{ e }[/math] is not in [math]\displaystyle{ R }[/math], then to cover all the nodes in the new sub graph, one must use the self-loops. Since all self-loops have a weight of 1, the weight of cycle-covers in [math]\displaystyle{ R }[/math] and [math]\displaystyle{ R' }[/math] match.
  • If [math]\displaystyle{ e }[/math] is in [math]\displaystyle{ R }[/math], then in all the corresponding cycle-covers in [math]\displaystyle{ G' }[/math], there must be a path from [math]\displaystyle{ u }[/math] to [math]\displaystyle{ v }[/math], where u and v are the nodes of edge e. From the construction, one can see that there are [math]\displaystyle{ r }[/math] different paths and sum of all these paths equal to the weight of the edge in the original graph [math]\displaystyle{ G }[/math]. So the weight of corresponding cycle-covers in [math]\displaystyle{ G }[/math] and [math]\displaystyle{ G' }[/math] match.

Note that the size of [math]\displaystyle{ G' }[/math] is polynomial in [math]\displaystyle{ n }[/math] and [math]\displaystyle{ \log W }[/math].

Reduction to 0–1

Figure 2: Construction of a 01-matrix from 2Power

The objective here is to reduce a matrix whose entries are powers of 2 into an equivalent matrix containing only zeros and ones (i.e. a directed graph where each edge has a weight of 1).

Let G be a [math]\displaystyle{ n }[/math]-node directed graph where all the weights on edges are powers of two. Construct a graph, [math]\displaystyle{ G' }[/math], where the weight of each edge is 1 and Perm(G) = Perm(G'). The size of this new graph, G', is polynomial in [math]\displaystyle{ n }[/math] and [math]\displaystyle{ p }[/math] where the maximal weight of any edge in graph G is [math]\displaystyle{ 2^p }[/math].

This reduction is done locally at each edge in G that has a weight larger than 1. Let [math]\displaystyle{ e = (u, v) }[/math] be an edge in G with a weight [math]\displaystyle{ w = 2^r \gt 1 }[/math]. It is replaced by a subgraph [math]\displaystyle{ J_e }[/math] that is made up of [math]\displaystyle{ 2r }[/math] nodes and [math]\displaystyle{ 6r }[/math] edges as seen in Figure 2. Each edge in [math]\displaystyle{ J_e }[/math] has a weight of 1. Thus, the resulting graph G' contains only edges with a weight of 1.

Consider some cycle-cover [math]\displaystyle{ R }[/math] in [math]\displaystyle{ G }[/math].

  • If an original edge [math]\displaystyle{ e }[/math] from graph G is not in [math]\displaystyle{ R }[/math], one cannot create a path through the new subgraph [math]\displaystyle{ J_e }[/math]. The only way to form a cycle cover over [math]\displaystyle{ J_e }[/math] in such a case is for each node in the subgraph to take its self-loop. As each edge has a weight of one, the weight of the resulting cycle cover is equal to that of the original cycle cover.
  • However, if the edge in G is a part of the cycle cover then in any cycle cover of [math]\displaystyle{ G' }[/math] there must be a path from [math]\displaystyle{ u }[/math] to [math]\displaystyle{ v }[/math] in the subgraph. At each step down the subgraph there are two choices one can make to form such a path. One must make this choice [math]\displaystyle{ r }[/math] times, resulting in [math]\displaystyle{ 2^r }[/math] possible paths from [math]\displaystyle{ u }[/math] to [math]\displaystyle{ v }[/math]. Thus, there are [math]\displaystyle{ 2^r }[/math] possible cycle covers and since each path has a weight of 1, the sum of the weights of all these cycle covers equals the weight of the original cycle cover.

Aaronson's proof

In 2011, quantum computer scientist Scott Aaronson proved that the permanent is #P-hard using quantum methods.[15]

References

  1. 1.0 1.1 Christos H. Papadimitriou. Computational Complexity. Addison-Wesley, 1994. ISBN 0-201-53082-1. Page 443
  2. Allen Kent, James G. Williams, Rosalind Kent and Carolyn M. Hall (editors). Encyclopedia of microcomputers.Marcel Dekker, 1999. ISBN 978-0-8247-2722-2; p. 34
  3. Jin-Yi Cai, A. Pavan and D. Sivakumar, On the Hardness of Permanent. In: STACS, '99: 16th Annual Symposium on Theoretical Aspects of Computer Science, Trier, Germany, March 4–6, 1999 Proceedings. pp. 90–99. Springer-Verlag, New York, LLC Pub. Date: October 2007. ISBN 978-3-540-65691-3; p. 90.
  4. Leslie G. Valiant (1979). "The Complexity of Computing the Permanent". Theoretical Computer Science (Elsevier) 8 (2): 189–201. doi:10.1016/0304-3975(79)90044-6. 
  5. Lance Fortnow. My Favorite Ten Complexity Theorems of the Past Decade. Foundations of Software Technology and Theoretical Computer Science: Proceedings of the 14th Conference, Madras, India, December 15–17, 1994. P. S. Thiagarajan (editor), pp. 256–275, Springer-Verlag, New York, 2007. ISBN 978-3-540-58715-6; p. 265
  6. Bürgisser, Peter (2000). Completeness and reduction in algebraic complexity theory. Algorithms and Computation in Mathematics. 7. Berlin: Springer-Verlag. p. 2. ISBN 978-3-540-66752-0. https://books.google.com/books?id=XBlnjSW1VekC&q=permanent+Valiant&pg=PA2. 
  7. John E. Hopcroft, Richard M. Karp: An [math]\displaystyle{ n^{5/2} }[/math] Algorithm for Maximum Matchings in Bipartite Graphs. SIAM J. Comput. 2(4), 225–231 (1973)
  8. Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2001) [1990]. "26.5: The relabel-to-front algorithm". Introduction to Algorithms (2nd ed.). MIT Press and McGraw-Hill. pp. 696–697. ISBN 0-262-03293-7. 
  9. 9.0 9.1 Dexter Kozen. The Design and Analysis of Algorithms. Springer-Verlag, New York, 1991. ISBN 978-0-387-97687-7; pp. 141–142
  10. Seinosuke Toda. PP is as Hard as the Polynomial-Time Hierarchy. SIAM Journal on Computing, Volume 20 (1991), Issue 5, pp. 865–877.
  11. "1998 Gödel Prize. Seinosuke Toda". http://www.sigact.org/Prizes/Godel/1998.html. 
  12. Ketan Mulmuley. Lower Bounds in a Parallel Model without Bit Operations. SIAM Journal on Computing, Volume 28 (1999), Issue 4, pp. 1460–1509.
  13. W. Hartmann. On the complexity of immanants. Linear and Multilinear Algebra 18 (1985), no. 2, pp. 127–140.
  14. Ben-Dor, Amir; Halevi, Shai (1993). "Zero-one permanent is #P-complete, a simpler proof". Proceedings of the 2nd Israel Symposium on the Theory and Computing Systems. pp. 108–117. http://people.csail.mit.edu/shaih/pubs/01perm.pdf. 
  15. S. Aaronson, A Linear-Optical Proof that the Permanent is #P-Hard