Chapter 9

Complexity of Counting

How do I love thee? Let me count the ways.
I love thee to the depth and breadth and height
My soul can reach.

—Elizabeth Barrett Browning

Informally, the complexity class NP contains the decision problems in which an input instance is accepted if and only if there exists a good witness. The complexity classes PP and BPP contain the problems in which an input instance is accepted if and only if the majority of the witnesses are good. All these problems are just the restricted forms of a more general counting problem: for any input instance, count the number of good witnesses for it. Such counting problems occur very often in practical problems. For instance, for the HAMILTONIAN CIRCUIT problem, one is often interested not only in the existence of a Hamiltonian circuit in a graph but also interested in the total number of different Hamiltonian circuits. In this chapter, we study the complexity of these counting problems and its relation to the complexity of nondeterministic and probabilistic computation. We define two complexity classes, #P and c09-math-0002, of counting problems. The main result of this chapter shows that decision problems in the polynomial-time hierarchy are polynomial-time reducible to counting problems in these complexity classes. We also investigate the relation between the relativized #P and the relativized polynomial-time hierarchy.

9.1 Counting Class c09-math-0004

Almost all problems we studied so far are decision problems that for an input x ask for answers of a single bit (i.e., YES or NO). In practice, however, we often encounter search problems that for an input x ask for an output y that may be muchlonger than one bit. We have seen in Chapter 2 how to reduce some search problems, particularly the optimization problems, to the corresponding decision problems. Still complexity classes for decision problems, such as NP and BPP, are not adequate to characterize precisely the complexity of search problems. A particularly interesting class of search problems is the class of counting problems related to nondeterministic computation. A decision problem in NP asks, for each input x, whether there exists a witness (or a solution) to x. The corresponding counting problem asks, for any input x, the number of witnesses for x.

Example 9.1

The above example can be extended to other NP-complete problems such as VERTEX COVER and HAMILTONIAN CIRCUIT. In general, for each NP-complete decision problem, there is a corresponding counting problem that is not polynomial-time solvable if c09-math-0016.

Example 9.2

Formally, a counting problem is a function f mapping an input c09-math-0027 to an integer c09-math-0028. The computational model for counting problems is the DTM transducer. A counting problem c09-math-0029 is computable if there exists a DTM transducer M such that for each input c09-math-0031, M(x) outputs integer f(x) in the binary form; it is polynomial-time computable if it is computable by a polynomial-time DTM transducer. In other words, a counting problem f is polynomial-time computable if it is in FP. Note that a function c09-math-0035 must be polynomially length bounded, that is, for all x, c09-math-0037 for some polynomial p. Thus, if a counting problem f is in FP, then c09-math-0041 for some polynomial p.

Many counting problems such as #SAT and c09-math-0044 can easily be defined in terms of NTMs. For any polynomial-time NTM M, we define a counting problem φM as follows: For any c09-math-0047, c09-math-0048 is the number of accepting computation paths of M(x). As each computation path of M(x), with c09-math-0051, is of length c09-math-0052 for some polynomial p, we have the bounds c09-math-0054, where c is a constant bounding the number of nondeterministic choices of M in a nondeterministic move. Thus, all functions φM are polynomial-length bounded. Let c09-math-0058 denote the class of all polynomial-time NTMs.

Definition 9.3

It is easy to see that each counting function in FP is also in #P. The fundamental question concerning counting problems is whether c09-math-0062.

Proposition 9.4

Proof

To understand the power of the counting class #P, we first consider its relation with class NP. From the definition of φM, it is clear that M accepts x if and only if c09-math-0081. Thus, it follows that c09-math-0082 is at least as powerful as NP. Next we consider the relation between c09-math-0083 and PP. Assume that c09-math-0084 is computed by a polynomial-time PTM M in uniform time t(n), that is, every branch of the computation of M(x) halts in exactly c09-math-0088 moves. Define an NTM M1 that on input x guesses a string y of length c09-math-0092 and accepts x if and only if c09-math-0094 accepts. Then, it follows that c09-math-0095 if and only if c09-math-0096. Thus, c09-math-0097 is at least as powerful as PP.

In the following, we formalize these observations in terms of polynomial-time reducibilities to show that the classes c09-math-0098 and PP are equivalent under the polynomial-time Turing reducibility. The notions of function-oracle Turing machines and polynomial-time Turing reducibility on functions have been defined in Chapter 2. Recall that a set A is polynomial-time Turing reducible to a function f, written c09-math-0101 or c09-math-0102, if there is a polynomial-time function-oracle TM that computes the characteristic function χA of A when the function f is used as an oracle. Let c09-math-0106 be a class of functions. We let c09-math-0107 denote the class of all sets A that are c09-math-0109-reducible to some functions c09-math-0110.

To prepare for this result, we first show that we can restrict c09-math-0111 to contain only functions φM that correspond to NTMs that run in polynomial time in uniform time complexity.

Proposition 9.5

Proof

Theorem 9.6

Proof

From the above theorem and Theorem 8.16, we have immediately the following relation between c09-math-0198 and the polynomial-time hierarchy.

Corollary 9.7

In Section 9.4, we will extend this result to show that the whole polynomial-time hierarchy is contained in c09-math-0200.

9.2 c09-math-0201-Complete Problems

Similar to the notion of NP-completeness, the notion of c09-math-0202-completeness can be used to characterize precisely the complexity of certain counting problems. In this section, we present some c09-math-0203-complete problems.

Definition 9.8

We establish the first c09-math-0209-complete problem #SAT from the generic reduction of Cook's theorem.

Theorem 9.9

Proof

Let c09-math-0219-SAT be the problem #SAT restricted to 3-CNF Boolean formulas.

Corollary 9.10

Proof
Figure 9.1

Figure 9.1 The subgraph Gj.

We observe that most reductions used to prove NP-completeness in Section 2.3 either preserve a simple relation between the number of solutions of the two problems or can be easily modified to have this property. Thus, these reductions can be extended into reductions for the corresponding counting problems. In the following, we show that the counting problem for VERTEX COVER is #P-complete. Other #P-complete problems are included in exercises. We let c09-math-0227 denote the problem of counting the number of vertex covers of a given size K for a given graph G.

Theorem 9.11

Proof

From the above theorem and other similar results (see Exercise 9.1), one might suspect that c09-math-0335-completeness is just a routine extension from NP-complete decision problems to their corresponding counting problems. The following result shows that this is not true: there exist some decision problems in P whose corresponding counting problems are nevertheless c09-math-0336-complete.

We first show that the problem PERM, of computing the permanent of an integer matrix, is c09-math-0337-complete. The permanent of an c09-math-0338 integer matrix A is

equation

where Sn is the set of all permutations on c09-math-0342. Note that the determinant of a matrix A has a similar form except that a factor of c09-math-0344 is multiplied to each odd permutation. It is well known that determinants of integer matrices are computable in polynomial time (indeed in NC2). However, no polynomial-time algorithms for permanents are known, despite the similarity between the two problems. The c09-math-0346-completeness of the function perm shows that the two problems are really quite different as far as their complexity is concerned (assuming c09-math-0347).

The problem PERM has a number of equivalent formulation. One of them is the problem c09-math-0348 of counting the number of perfect matchings (Example 9.2). Another one is the cycle covering problem. Letc09-math-0349 be a directed graph and c09-math-0350 a weight function on the edges of G, where c09-math-0352 denotes the set of integers. A collection C of node-disjoint cycles that cover all nodes in G is called a cycle cover of G. The weight of a cycle cover C is the product of the weights of all edges in C. The cycle covering problem is the following:

#CC: Given a directed graph G with a weight function w on edges of G, find the sum of the weights of all cycle covers of G.

For any c09-math-0362 integer matrix A, define GA to be the directed graph that has n vertices c09-math-0366 and has a weight function c09-math-0367, that is, the adjacency matrix of GA is A. The following lemma shows a simple relation between the problems c09-math-0370 and PERM.

Lemma 9.12

Proof

bsqu

Theorem 9.13

Proof

Theorem 9.14

Proof

Claim 1. A route Q that is not good has weight 0.

Proof

Claim 2. A good route Q has weight c09-math-0509.

Proof

Claim 3. Each interchange Rj has the following properties:

  1. There is no good route for Rj.
  2. Let c09-math-0537 be Rj with at least one of c09-math-0539 removed, c09-math-0540. Then, there is a unique good route for c09-math-0541.
Proof

The following claim finishes the proof of the theorem.

Claim 4. There are exactly s(F) good routes for G.

Proof
Figure 9.2

Figure 9.2 The track Ti.

Figure 9.3

Figure 9.3 The interchange Rj.

Figure 9.4

Figure 9.4 Graph Hk.

Now we apply the above result to show that the perfect matching problem is c09-math-0598-complete. As the problem of determining whether a given bipartite graph G has a perfect matching is polynomial-time solvable, this result demonstrates the first c09-math-0600-complete problem whose corresponding decision problem is in P.

Let c09-math-0601 be a bipartite graph in which c09-math-0602. Define an c09-math-0603 (0,1)-matrix MG as follows:

equation

Then, it is clear that c09-math-0606 is exactly the number of perfect matchings in G. Thus, it suffices to prove that the problem of computing the permanents of c09-math-0608-matrices is c09-math-0609-complete.

Theorem 9.15

Proof
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.182.107