Computing the permanent


In linear algebra, the computation of the permanent of a matrix is a problem that is thought to be more difficult than the computation of the determinant of a matrix despite the apparent similarity of the definitions.
The permanent is defined similarly to the determinant, as a sum of products of sets of matrix entries that lie in distinct rows and columns. However, where the determinant weights each of these products with a ±1 sign based on the parity of the set, the permanent weights them all with a +1 sign.
While the determinant can be computed in polynomial time by Gaussian elimination, it is generally believed that the permanent cannot be computed in polynomial time. In computational complexity theory, a theorem of Valiant states that computing permanents is #P-hard, and even #P-complete for matrices in which all entries are 0 or 1. This puts the computation of the permanent in a class of problems believed to be even more difficult to compute than NP. It is known that computing the permanent is impossible for logspace-uniform ACC0 circuits.
The development of both exact and approximate algorithms for computing the permanent of a matrix is an active area of research.

Definition and naive algorithm

The permanent of an n-by-n matrix A = is defined as
The sum here extends over all elements σ of the symmetric group Sn, i.e. over all permutations of the numbers 1, 2,..., n. This formula differs from the corresponding formula for the determinant only in that, in the determinant, each product is multiplied by the sign of the permutation σ while in this formula each product is unsigned. The formula may be directly translated into an algorithm that naively expands the formula, summing over all permutations and within the sum multiplying out each matrix entry. This requires n! n arithmetic operations.

Ryser formula

The best known general exact algorithm is due to.
Ryser’s method is based on an inclusion–exclusion formula that can be given as follows: Let be obtained from A by deleting k columns, let be the product of the row-sums of, and let be the sum of the values of over all possible. Then
It may be rewritten in terms of the matrix entries as follows
Ryser’s formula can be evaluated using arithmetic operations, or by processing the sets in Gray code order.

Balasubramanian–Bax–Franklin–Glynn formula

Another formula that appears to be as fast as Ryser's is to be found in the two Ph.D. theses; see, ; also
. The methods to find the formula are quite different, being related to the combinatorics of the Muir algebra, and to finite difference theory respectively. Another way, connected with invariant theory is via the polarization identity for a symmetric tensor. The formula generalizes to infinitely many others, as found by all these authors, although it is not clear if they are any faster than the basic one. See.
The simplest known formula of this type is
where the outer sum is over all vectors.

Special cases

Planar and ''K''3,3-free

The number of perfect matchings in a bipartite graph is counted by the permanent of the graph's biadjacency matrix, and the permanent of any 0-1 matrix can be interpreted in this way as the number of perfect matchings in a graph. For planar graphs, the FKT algorithm computes the number of perfect matchings in polynomial time by changing the signs of a carefully chosen subset of the entries in the Tutte matrix of the graph, so that the Pfaffian of the resulting skew-symmetric matrix is the number of perfect matchings. This technique can be generalized to graphs that contain no subgraph homeomorphic to the complete bipartite graph K3,3.
George Pólya had asked the question of when it is possible to change the signs of some of the entries of a 01 matrix A so that the determinant of the new matrix is the permanent of A. Not all 01 matrices are "convertible" in this manner; in fact it is known that
there is no linear map such that for all matrices. The characterization of "convertible" matrices was given by who showed that such matrices are precisely those that are the biadjacency matrix of bipartite graphs that have a Pfaffian orientation: an orientation of the edges such that for every even cycle for which has a perfect matching, there are an odd number of edges directed along C. It was also shown that these graphs are exactly those that do not contain a subgraph homeomorphic to, as above.

Computation modulo a number

2, the permanent is the same as the determinant, as It can also be computed modulo in time for. However, it is UP-hard to compute the permanent modulo any number that is not a power of 2.
There are various formulae given by for the computation modulo a prime.
Firstly, there is one using symbolic calculations with partial derivatives.
Secondly, for = 3 there is the following formula for an nxn-matrix, involving the matrix's principal
minors :
where is the submatrix of induced by the rows and columns of
indexed by, and is the complement of in, while the determinant of the empty submatrix is defined to be 1.
-tuples that are partitions of the set into p-1 subsets, some of them possibly empty.
The former formula possesses an analog for the hafnian of a symmetric and an odd p:
with the sum taken over the same set of indexes. Moreover, in characteristic zero a similar convolution sum expression involving both the permanent and the determinant yields the Hamiltonian cycle polynomial :
. In characteristic 2 the latter equality turns into what therefore provides an opportunity to polynomial-time calculate the Hamiltonian cycle polynomial of any unitary
This formula implies the following identities over fields of characteristic 3:
for any invertible
for any unitary , i.e. a square matrix such that where is the identity matrix of the corresponding size,
where is the matrix whose entries are the cubes of the corresponding entries of.
It was also shown that, if we define a square matrix as k-semi-unitary when =,
the permanent of a 1-semi-unitary matrix is computable in polynomial time over fields of characteristic 3, while for > 1
the problem becomes #3-P-complete.. The latter result was essentially extended in 2017 and it was proven that in characteristic 3 there is a simple formula relating the permanents of a square matrix and its partial inverse :
and it allows to polynomial-time reduce the computation of the permanent of an nxn-matrix with a subset of k or k-1 rows expressible as linear combinations of another subset of k rows to the computation of the permanent of an x- or x-matrix correspondingly, hence having introduced a compression operator that "preserves" the permanent in characteristic 3. The closure of that operator defined as the limit of its sequential application together with the transpose transformation is also an operator mapping, when applied to classes of matrices, one class to another. While the compression operator maps the class of 1-semi-unitary matrices into itself and the classes of unitary and 2-semi-unitary ones, the compression-closure of the 1-semi-unitary class is yet unknown and tensely related to the general problem of the permanent's computational complexity in characteristic 3 and the chief question of P versus NP: as it was shown in, if such a compression-closure is the set of all square matrices over a field of characteristic 3 or, at least, contains a matrix class the permanent's computation on is #3-P-complete then the permanent is computable in polynomial time in this characteristic.
Besides, the problem of finding and classifying any possible analogs of the permanent-preserving compressions existing in characteristic 3 for other prime characteristics was formulated, while giving the following identity for an nxn matrix and two n-vectors and such that, valid in an arbitrary prime characteristic p:
where for an nxm-matrix, an n-vector and an m-vector, both vectors having all their entries from the set, denotes the matrix received from via repeating times its i-th row for i = 1,...,n and times its j-th column for j = 1,...,m, and denotes the n-vector all whose entries equal unity. This identity is an exact analog of the classical formula expressing a matrix's minor through a minor of its inverse and hence demonstrates a kind of duality between the determinant and the permanent as relative immanants.
.
And, as an even wider generalization for the partial inverse case in a prime characteristic p, for, being square, being invertible and of size x, and, there holds also the identity
where the common row/column multiplicity vectors and for the matrix generate the corresponding row/column multiplicity vectors and, s,t = 1,2, for its blocks.

Approximate computation

When the entries of A are nonnegative, the permanent can be computed approximately in probabilistic polynomial time, up to an error of εM, where M is the value of the permanent and ε > 0 is arbitrary. In other words, there exists a fully polynomial-time randomized approximation scheme .
The most difficult step in the computation is the construction of an algorithm to sample almost uniformly from the set of all perfect matchings in a given bipartite graph: in other words, a fully polynomial almost uniform sampler. This can be done using a Markov chain Monte Carlo algorithm that uses a Metropolis rule to define and run a Markov chain whose distribution is close to uniform, and whose mixing time is polynomial.
It is possible to approximately count the number of perfect matchings in a graph via the self-reducibility of the permanent, by using the FPAUS in combination with a well-known reduction from sampling to counting due to. Let denote the number of perfect matchings in. Roughly, for any particular edge in, by sampling many matchings in and counting how many of them are matchings in, one can obtain an estimate of the ratio. The number is then, where can be approximated by applying the same method recursively.
Another class of matrices for which the permanent can be computed approximately, is the set of positive-semidefinite matrices. The corresponding randomized algorithm is based on the model of boson sampling and it uses the tools proper to quantum optics, to represent the permanent of positive-semidefinite matrices as the expected value of a specific random variable. The latter is then approximated by its sample mean. This algorithm, for a certain set of positive-semidefinite matrices, approximates their permanent in polynomial time up to an additive error, which is more reliable than that of the standard classical polynomial-time algorithm by Gurvits.