Computational Complexity: Counting Problems and the Permanent, Study notes of Computational Methods

A lecture note from cs221: computational complexity course by prof. Salil vadhan. The lecture focuses on counting problems, their formalization, and their relationship with decision problems. Various counting problems, such as #sat, network reliability, and ai uncertainty, and explains how they can be formalized as #p problems. It also introduces the concept of #p-completeness and provides examples of #p-complete counting problems, including #3sat, #3dnf, and #mon. The lecture concludes with the discussion of the permanent of a matrix and its connection to counting perfect matchings in a graph.

Typology: Study notes

2010/2011

Uploaded on 10/28/2011

thecoral
thecoral 🇺🇸

4.5

(30)

395 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS221: Computational Complexity Prof. Salil Vadhan
Lecture 24: Counting Problems
11/20 Scribe: Saurabh Sanghvi
Contents
1 What is counting? Who cares? 1
2 Formalizing the notion 2
3 Relating counting problems 2
1 What is counting? Who cares?
We have already discussed several types of “problems”–whether languages, functions, search prob-
lems, or optimization problems. One theoretically and practically interesting type of problem since
unmentioned is that of counting. For instance, we might ask:
#SAT Given ϕ, how many assignments satisfy ϕ?
#Cycles Given G, how many cycles are in G?
Why might we care about these sorts of problems?
Enumerative combinatorics: This is a field that tries to find different ways to count
things, but often runs into difficult walls. If we can say certain counting problems are hard,
then we will provide a complexity-theoretic explanation for the lack of nice formulas for these
problems.
Statistical physics: Lots of counting problems make their way into this field. A physical
system is described, which could be in various configurations. One often asks: how many
(possibly weighted) configurations are there? Several results in complexity theory counting
problems have actually come from work in the statistical physics community—the reverse
occurs as well.
Network reliability: Often counting problems arise when trying to compute the probability
of a network’s failure. Specifically, given a graph G= (V, E ) and s, t V, suppose each edge
of a graph fails with probability 1/2. In this case, we have that:
Pr[sand tremain connected] = # subgraphs of Gwith path fom sto t
2|E|
(A subgraph of Gis the graph defined by a subset of the graph’s edges (and same vertex set)).
Thus, counting can help determine whether a given network is reliable.
1
pf3
pf4
pf5

Partial preview of the text

Download Computational Complexity: Counting Problems and the Permanent and more Study notes Computational Methods in PDF only on Docsity!

CS221: Computational Complexity Prof. Salil Vadhan

Lecture 24: Counting Problems

11/20 Scribe: Saurabh Sanghvi

Contents

1 What is counting? Who cares? 1

2 Formalizing the notion 2

3 Relating counting problems 2

1 What is counting? Who cares?

We have already discussed several types of “problems”–whether languages, functions, search prob- lems, or optimization problems. One theoretically and practically interesting type of problem since unmentioned is that of counting. For instance, we might ask:

  • #SAT — Given ϕ, how many assignments satisfy ϕ?
  • #Cycles — Given G, how many cycles are in G?

Why might we care about these sorts of problems?

  • Enumerative combinatorics: This is a field that tries to find different ways to count things, but often runs into difficult walls. If we can say certain counting problems are hard, then we will provide a complexity-theoretic explanation for the lack of nice formulas for these problems.
  • Statistical physics: Lots of counting problems make their way into this field. A physical system is described, which could be in various configurations. One often asks: how many (possibly weighted) configurations are there? Several results in complexity theory counting problems have actually come from work in the statistical physics community—the reverse occurs as well.
  • Network reliability: Often counting problems arise when trying to compute the probability of a network’s failure. Specifically, given a graph G = (V, E) and s, t ∈ V , suppose each edge of a graph fails with probability 1/2. In this case, we have that:

Pr[s and t remain connected] = # subgraphs of^ G^ with path fom^ s^ to^ t 2 |E|

(A subgraph of G is the graph defined by a subset of the graph’s edges (and same vertex set)). Thus, counting can help determine whether a given network is reliable.

  • Artificial Intelligence In AI an agent may have uncertainty about the value of various variables. For instance, it might know that x 1 is true with probability p 1 , x 2 is true with probability p 2 , etc. Calculating the probability of some formula being true is essentially a counting problem. For example, if p 1 = p 2 = · · · = pn = 1/2, then

Pr[ϕ(x 1 ,... , xn)] =

satisfying assignments

2 n (The case of arbitrary pi’s amounts to a weighted counting problem.)

2 Formalizing the notion

In order to talk about counting formally, we need to be precise about what we mean by the concept. In this course we will deal with only one counting class: #P:

Definition 1 f : Σ∗^ → N is in #P iff ∃ NP relation R (i.e. polynomially balanced and polynomi- ally decidable) such that for all x, f (x) = #{y : (x, y) ∈ R}.

That is, the function basically counts the number of NP witnesses for the given input x. An example of this is

R = {((G = (V, E), s, t), S) : S ⊆ E subgraph such that s and t are connected in S}.

This is the network reliability problem seen before.

Note: An equivalent way to formalize #P is that it is the set of functions f such that f (x) = # accepting computations of a nondeterministic polynomial time TM on x.

A reasonable question to ask at this point is the following: which functions in #P are in (F)P = { functions computable in polynomial time}? That the question might be resolvable any time soon is quickly put down by the following observation:

Observation 2 L ∈ NP iff ∃f ∈ #P such that x ∈ L ⇔ f (x) 6 = 0 (where f is not necessarily unique).

It follows immediately that counting is harder than decision. Indeed, if R defines an NP-complete language L, then the counting problem defined by R is NP-hard. As a result, counting is really most interesting when the language in question is easy, but the corresponding counting problem is hard. We’ll see a couple examples of this shortly.

3 Relating counting problems

There are two types of reductions one might try to use when considering counting problems:

  1. Parsimonious reductions: f reduces to g iff there exists a logspace-computable function h : Σ∗^ → Σ∗^ such that for all x, g(h(x)) = f (x). That is, the reduction preserves the number of solutions.
  2. Cook reductions: f reduces to g iff g ∈ FPf^.

Proof: Once again, membership in #P is trivial in the same way as before. We will show #SAT ∈ FP#MON^ (note that the fact that #SAT is #P-complete follows trivially from the #P-completeness of #3SAT). Given ϕ(x 1 ,... , xn), map it to ψ as follows:

ϕ(x 1 ,... , xn) 7 → ψ(x 1 ,... , xn, y 1 ,... , yn) = ϕ where ¬xi replaced by yi.

This gives

#ϕ(x) = #

[

ψ(x, y) ∧

( (^) n ∧

i=

(xi ∨ yi)

∨^ n

i=

(xi ∧ yi)

]

= # [α(x, y) ∧ ¬β(x, y] , where α, β are monotone formulae (2) = #α − #(α ∧ β) (3)

For (1), basically just note the satisfying assignments of ϕ are the “same” as assignments satisfying ψ such that either xi or yi is true, and it is not the case that both are true, for all i (since this simulates yi = ¬xi).

For (2), just let α(x, y) , ψ(x, y) ∧

∧n i=

(xi ∨ yi) and β(x, y) ,

∨n i=

(xi ∧ yi).

For (3), a simple Venn diagram makes this pretty clear: in words, if an assignment satisfies α, but does not satisfy α ∧ β, it must not satisfy β, so it satisfies α ∧ ¬β. Conversely, if something satisfies α ∧ ¬β, it must satisfy α, and it can’t satisfy β, so it can’t satisfy α ∧ β.

An important problem in mathematics studied since the 1800’s is that of the permanent. It turns out that the problem of calculating it is #P-complete, which has interesting implications for the class #P, given the algebraic structure of the permanent.

Definition 7 The permanent of an n × n matrix A is Perm(A) ,

π

A 1 π(1)A 2 π(2)... Anπ(n), where the sum is over all permutations π : [n] → [n].

This definition bears striking similarities to that of the determinant–indeed, the determinant differs only in multiplying each term of the sum by the sign of the permutation π. Computing the determinant is easy—it can be done in polynomial time using Gaussian elimination. Thus, it is quite surprising that computing the permanent, which seems all the simpler without the complexity of the signs, is in fact hard.

As of now it is not clear why we would talk about computing the permanent as a counting problem. To change this, assume that A has 0/1 entries. Now we can think of A as the adjacency matrix of a bipartite graph G. Thus, G would look like the following:

1 2 3 4

n

n

(where we put an edge between i and j iff Aij = 1)

We first need the following definition:

Definition 8 A perfect matching in a graph is a subset of edges such that each vertex touches exactly one edge. (In particular, in a bipartite graph, the edges give a one-to-one correspondence between left and right vertices.)

Now, we may assert a connection between counting and the permanent:

Proposition 9 Perm(A) = # perfect matchings in G.

To prove the proposition, one would first show the following lemma:

A term in Perm(A) is nonzero ⇔ {(i, π(i))} is a “perfect matching” in G

From here, the result follows, because a term in the permanent is nonzero iff all the terms Aiπ(i) = 1, which corresponds exactly to a perfect matching in G, since this means that there are edges from each left vertex to some right vertex (π is a bijection). So the number of nonzero terms equal the number of perfect matchings, but the number of nonzero terms is simply the permanent, since each nonzero term is 1.

This proposition thus shows why computing the permanent can be seen as a counting problem. As indicated before, however, we know much more than just this:

Theorem 10 (Valiant) : The problem of computing the permanent of 0 / 1 matrices is #P- complete.

We won’t prove this theorem in class, but it’s in Papadimitriou (Ch. 18).It’s worth noting that the decision problem corresponding to the permanent—that of finding a perfect matching—is in P. This is shown in AM 107 (via alternating paths) and CS 226r (via max flow).