
Lecture Counting Problems and P In this lecture we discuss the complexity of counting problems Instead of just determining whether a solution to a given problem exists wewillbeinterested in counting the number of dierent solutions to a given problem Counting problems are naturally asso ciated with many of the decision problems wehave already discussed The notion of a witness function formalizes this asso ciation Denition Let w P where P denotes the power set of and let x We refer to the elements of w x as witnesses for x We asso ciate a decision problem A with w w A fx j w x g w In other words A is the set of strings that have witnesses w Example Let x b e an enco ding of a Bo olean formula and y an enco ding of a truth assignment If w x ftruth assignments satisfying xg then A fsatisable Bo olean formulasg w Lecture Counting Problems and P It is p ossible for a counting problem to be harder than the asso ciated decision problem In order to characterize the additional diculty of these problems Valiant prop osed a new class of problems called P His def inition is essentially equivalent to the following Denition The class P is the class of witness functions w such that i there is a p olynomialtime algorithm to determine for a given x and y whether y w x k ii there exists a constant k N such that for all y w x jy j jxj The constant k can dep end on w The following theorem relates counting problems in this new class to their asso ciated decision problems Theorem The fol lowing relationships hold between witness functions in P and decision problems in NP i if w P then A NP w ii if A NP then there exists a w P such that A A w Proof i Guess a witness y in p olynomial time using Denition ii and verify in p olynomial time that y is indeed a witness using Denition i ii Let M be a nondeterministic Turing machine accepting A Take w x to b e the set of accepting computation paths of M on input x It is interesting to observe how counting problems v and w are related under the pro cess of reduction For this purp ose we intro duce the notion of counting reductions and parsimonious reductions Denition Let w P v P be counting problems A polynomialtime manyone counting reduction from w to v consists of a pair of p olynomialtime computable functions N N Lecture Counting Problems and P such that jw xj jv xj When such a reduction exists we say that w reduces to v Intuitively if one can easily count the number of witnesses of v y then one can easily count the number of witnesses of w x Some reductions preserve the number of solutions to a problem exactly We call such reductions parsimonious Formally Denition Acounting reduction is parsimonious if is the identity function Example Here are a number of examples of parsimonious and non parsimonious reductions Co oks Theorem is parsimonious in the sense that the numb er of satisfy ing assignments to the Bo olean formula constructed in the pro of of the theorem corresp onds exactly to the number of accepting computations of the nondeterministic Turing machine b eing simulated p The reduction Clique Vertex Cover as presented in a previous lecture m is parsimonious the numb er of cliques of G V E ofsize k is the same as the number of vertex covers of G V E ofsize n k p The reduction CNFSat CNFSat as presented in a previous lecture m is not parsimonious but it can easily b e made so p The reduction CNFSat Clique as presented in a previous lecture is m not parsimonious but again can easily be made so p Example Weshowhow the reduction CNFSat Clique can b e made m parsimonious Recall that we constructed from a given CNF formula B a graph G with a vertex for each o ccurrence of a literal in B and edges between oc currences of literals in dierent clauses if the literals were not complementary The problem with this construction is that one truth assignment might corre sp ond to several cliques For example the formula y x y x has two satisfying assignments but three cliques We can remedy this by rst replacing each clause x y z Lecture Counting Problems and P in B by the equivalent subformula xy z xy z x yz x y z xy z xy z x yz with seven terms The numb er of satisfying assignments is the same since the formulas are equivalent Now we construct G with one vertex for each of the seven terms in each of these subformulas and edges connecting terms xy z and uv w in dierent clauses if the two terms contain no complementary literals One can show that there is exactly one clique of size k the numb er of clauses for each satisfying assignment As with the NP complete problems we can dene the class of P complete problems that represent the hardest problems in the class P All the counting problems we have mentioned so far are P complete One P complete problem is that of computing the permanent of a matrix t of an n n matrix is the number of ways to Intuitively the p ermanen place n ro oks on the matrix so that every ro ok sits on a and no ro ok can capture another Ocially Denition Given an n n matrix A not necessarily the permanent of A is the quantity n X Y perm A A i i i S n where the are p ermutations of the set f ng and S is the set of all n such p erm utations The denition of the p ermanent of a matrix is very similar to the denition of determinant n X Y sign det A A i i i S n The only dierence is that the sign of the p ermutation even or odd is included in the determinant It is thus quite surprising that the p ermanent should be P complete since the determinant is computable in p olynomial time by Gaussian elimination That the p ermanent is P complete is even more surprising in light of its relationship to the bipartite matc hing problem Given a bipartite graph G U V E with jU j jV j n the p ermanent of the n n bipartite adjacency matrix of G gives the number of p erfect matchings Thus despite the fact that a p erfect matching can b e found in p olynomial time counting the number of them is as hard as counting the number of satisfying assignments to a Bo olean formula The sign of a p ermutation of f ng is the numb er mo d of pairs that are out of order Lecture Counting Problems and P Theorem Valiant The problem of counting the number of perfect matchings in a bipartite graph is P complete Actually this problem is P complete with resp ect to a slightly more general reducibility than the one dened in Denition We will discuss this later on Example Consider the following bipartite graph and its asso ciated bipartite adjacency matrix a b c s s a H H H H H H s s b H H H H H H s s c This graph has exactly three p erfect matchings corresp onding to the three p ossible legal ro ok placements s s s s s s H H H H H H H H H H s s s s s s H H H H H H H s s s s s s H For nonbipartite directed graphs wemight ask what the p ermanentofthe adjacency matrix represents Here a legal ro ok placement corresp onds to a cycle cover or a collection of vertexdisjoint cycles containing all vertices The permanentthus computes the numb er of cycle covers The picture b elow illus trates the relationship between cycle covers and p ermutations corresp onding to nonzero terms in the denition of the p ermanent Lecture Counting Problems and P s s s s s s Lecture Counting Bipartite Matchings In this lecture we prove that computing the numb er of p erfect matchings in a bipartite graph is P complete making it at least as dicult as computing the number of satisfying truth assignments for a Bo olean expression We noted last time that the number of perfect matchings in a bipartite graph with the same number of vertices on each side is equal to the permanent of its adjacency matrix given by n Y X A p erm A i i i S n where S is the set of p ermutations of the set f ng For a general n directed graph with n vertices and its n n nonbipartite adjacency matrix the p ermanent gives the number of cycle covers Our pro of b egins using the same construction that we used to reduce Vertex Cover to Hamiltonian Circuit Recall that we constructed a graph H from G built from a set of widgets one for each edge in G v s s s s u Lecture Counting Bipartite Matchings For each vertex u in G the sides of the widgets corresp onding to u are con nected endtoend to form a u loop The ends of each u lo op are connected to each element of a set K of k new vertices as shown here k is the size of the vertex cover in G we are lo oking for v v v v R R s s R s s R s s s s s s s s s s s s I AK u u u u A A A to vertices in K from vertices in K Weshowed in Lecture that H contains a Hamiltonian circuit if and only if G contains a vertex cover of size k However although every Hamiltonian circuit in H determines a unique vertex cover in G there are in general many dierent Hamiltonian circuits giving the same vertex cover How many For each vertex cover C each Hamiltonian circuit corresp onding to C is deter mined by the connections b etween K and the lo ops corresp onding to C thus we are essentially lo oking at the numb er of Hamiltonian circuits in a complete bipartite graph on two sets of k vertices This number is k k since for each of the k cyclic orderings of the vertices in one of the sets of the bipartition there are k ways to insert the vertices in the other set so that the two sets alternate Similar thinking leads to the conclusion that there are exactly k cycle covers in H corresp onding
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages13 Page
-
File Size-