ArticleslgStudy

computer science

Computing the permanent

Computing the permanent is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Computing the permanent rather than just read about it. In short: 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.

Key takeaways

  • Computing the permanent belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Computing the permanent to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Computing the permanent from memory before moving on to harder problems.

Reference excerpt

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 Valiant (1979). 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.(Allender & Gore 1994) 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 = (ai,j) is defined as

perm⁡(A)=∑σ∈Sn∏i=1nai,σ(i). 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 H. J. Ryser (1963). Ryser's method is based on an inclusion–exclusion formula that can be given as follows: Let Ak be obtained from A by deleting k columns, let P(Ak) be the product of the row-sums of Ak, and let Σk be the sum of the values of P(Ak) over all possible Ak. Then

perm⁡(A)=∑k=0n−1(−1)kΣk. It may be rewritten in terms of the matrix entries as follows

perm⁡(A)=(−1)n∑S⊆{1,…,n}(−1)|S|∏i=1n∑j∈Saij. Ryser's formula can be evaluated using O(2nn2) arithmetic operations, or O(2nn) by processing the sets S in Gray code order.

Balasubramanian–Bax–Franklin–Glynn formula Another formula that appears to be as fast as Ryser's (or perhaps even twice as fast) is to be found in the two Ph.D. theses; see (Balasubramanian 1980), (Bax 1998); also (Bax & Franklin 1996). 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 (Glynn 2010). 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 (Glynn 2013). The simplest known formula of this type (when the characteristic of the field is not two) is

perm⁡(A)=12n−1[∑δ(∏k=1nδk)∏j=1n∑i=1nδiaij], where the outer sum is over all 2n−1 vectors δ=(δ1=1,δ2,…,δn)∈{±1}n.

Special cases

Planar and K3,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 (regardless of bipartiteness), 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 (the square root of its determinant) 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 (Marcus & Minc (1961)) that there is no linear map T such that per⁡T(A)=det⁡A for all n×n matrices A. The characterization of "convertible" matrices was given by Little (1975) 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 C for which G∖C has a perfect matching, there are an odd number of edges directed along C (and thus an odd number with the opposite orientation). It was also shown that these graphs are exactly those that do not contain a subgraph homeomorphic to K3,3, as above.

Computation modulo a number Modulo 2, the permanent is the same as the determinant, as (−1)≡1(mod2). It can also be computed modulo 2k in time O(n4k−3) for k≥2. However, it is UP-hard to compute the permanent modulo any number that is not a power of 2. Valiant (1979) There are various formulae given by Glynn (2010) for the computation modulo a prime p. First, there is one using symbolic calculations with partial derivatives. Second, for p = 3 there is the following formula for an n×n-matrix A, involving the matrix's principal minors (Kogan (1996)):

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Computing the permanent

Start with the simplest possible case. Write down what Computing the permanent claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Computing the permanent before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Computing the permanent ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Computing the permanent

In research
Computing the permanent appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Computing the permanent in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Computing the permanent is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computational complexity theory, Computational problems, Linear algebra, so understanding it makes those chapters shorter.
In everyday life
Look for Computing the permanent outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Computing the permanent” →

How to study Computing the permanent in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Computing the permanent means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Computing the permanent out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Computing the permanent in simple terms?

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 se…

Why does Computing the permanent matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Computing the permanent?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Computing the permanent.

Tags

  • Computational complexity theory
  • Computational problems
  • Linear algebra
  • Matrix theory
  • Permutations

Keep exploring