Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMPLEXITY THEORY CSci 5403 LECTURE XVI: COUNTING PROBLEMS AND RANDOMIZED REDUCTIONS.

Similar presentations


Presentation on theme: "COMPLEXITY THEORY CSci 5403 LECTURE XVI: COUNTING PROBLEMS AND RANDOMIZED REDUCTIONS."— Presentation transcript:

1 COMPLEXITY THEORY CSci 5403 LECTURE XVI: COUNTING PROBLEMS AND RANDOMIZED REDUCTIONS

2 Definition. #P is the class of functions ƒ such that there exists a polytime TM M where ƒ(x) = |{ y : M(x,y) accepts }| Example. #SAT( ) = # satisfying assignments to. Definition. ƒ is #P-hard iff #P µ FP ƒ. Definition. ƒ is #P-complete iff #P µ FP ƒ and ƒ 2 #P. Theorem. (Shocking!) #SAT is #P-complete.

3 Theorem. The following counting problems are parsimoniously equivalent: #PERFECT BPMATCH: Given: bipartite graph G = (U,V,E) where E µ U £ V Output: # of perfect matchings in G. #CYCLE COVER: Given: directed graph G Output: the number of cycle covers in G. MATRIX PERMANENT: Given: n£n 0-1 matrix A Output: the permanent of A, i n a i, (i).

4 Theorem. PERMANENT is #P-Complete. Proof. We show that #3SAT µ FP #CYCLE COVER. The reduction has 3 gadget types: choice, clause, and XOR.

5 CLAUSE GADGETS For each clause (x Ç y Ç z) include the subgraph: No cycle cover can include all three outer edges. For each subset of the outer edges, exactly one cycle cover includes that subset. x y z

6 CHOICE GADGETS For each variable x i include the subgraph: There are exactly two cycle covers, one per outer edge. They correspond to the choices of x i.

7 XOR GADGETS A clause gadget outer edge is connected to its choice gadget outer edge by an XOR gadget: An XOR gadget is a clever device that forces any cycle cover to use exactly one of the edges. If P NP, can we implement an XOR gadget?

8 XOR GADGETS II A clause gadget outer edge is connected to its choice gadget outer edge by an XOR gadget: An XOR gadget is a clever device that multiplies the number of cycle covers using exactly one of the edges by 4, and the number using both edges by M. #SAT( ϕ ) = #CYCLE-COVER(G) mod M / 4 m

9 WEIGHTED XOR GADGETS For a weighted graph G and cycle cover C, the weight of C is the product of the edge weights. 1 1 2 2 1 2 1 2 a b d c 2 3 Define # WCYCLE-COVER (G) = C weight(C).

10 Removing negative weights: Let m = # of XOR gadgets in the resulting graph. Each satisfying assignment corresponds to 4 m total weight, and there are 2 m assignments. So the total weight is 2 3m. Set M = 2 4m +1. Then 2 4m -1 (mod M). Replace each -1 with 2 4m and take the result mod M. = 3 × # clauses

11 Simulating weights: 2 u v 3 u v 2 4m u v u v u v … u v 4m

12 Recap: We showed how to transform a 3cnf into a graph G such that #3SAT ( ) = ( #CYCLE-COVER (G) mod 2 4m +1)/4 m Thus #3SAT FP #CYCLE-COVER. Since #3SAT is #P-Complete, so is #CYCLE-COVER. Also #P-complete: PERMANENT, #PERFECT BPMATCH, #IMPERFECT BPMATCH, and #MONOTONE 2SAT

13 TODAS THEOREM Theorem. PH P #P. Proof Outline. 1.Define the class P, prove the Valiant- Vazirani theorem: NP RP P. 2. Extend the proof idea to show that PH RP P. 3. Use a #P oracle to derandomize. (Not hard)

14 Two related problems, and a complexity class: Definition. USAT is the promise problem given by: USAT YES = { : !x. (x) = 1 } USAT NO = { : x. (x) = 0 } There is exactly one x Definition. ©SAT = { Á | © x Á(x) = 1 } Definition. L 2 ©P iff 9 polytime NTM M such that x 2 L, © y M(x,y) = 1. Proposition. ©P P #P. Proposition. ©SAT is ©P-Complete. Proposition. USAT YES ©SAT.

15 Theorem (Valiant-Vazirani). SAT RP USAT. (Note we then have NP RP P.) Proof. We show how to transform a formula Á Ã where: Á 2 3SAT ) Pr[Ã 2 USAT] ¸ 1/8n Á 3SAT ) Pr[Ã 2 USAT] = 0 Querying the USAT oracle on the resulting formula and returning its result gives the RP algorithm. Given Á how do we construct Ã?

16 Lemma. Let H be a pairwise-independent family of hash functions h : {0,1} n {0,1} k and S {0,1} n, with 2 k-2 |S| 2 k-1. Then Pr h H [ !x S. h(x)=0 k ] 1/8. Proof. For any fixed xx S, we have: Pr[h(x) = 0] = 1/2 k and Pr[h(x)=0 h(x)=0] = 1/2 2k. Thus Pr[ xx. h(x)=0 h(x)=0] |S| 2 /2 2k+1 And Pr[ x.h(x)=0] |S|/2 k - |S| 2 /2 2k+1 So Pr[ !x S. h(x)=0] |S|/2 k - |S| 2 /2 2k 1/8. h isolates x

17 Lemma. Let x 1 x 2 {0,1} n, y 1,y 2 {0,1} k and pick M R {0,1} n×k, z R {0,1} k. Then Pr[Mx 1 +z=y 1 mod 2 Mx 2 +z=y 2 mod 2] = 1/2 2k. Proof. Let x 1 and x 2 be different in row i. Then Pr[Mx 1 +z=y 1 Mx 2 +z=y 2 ] = Pr[M i +z=y 1 z=y 2 ]=1/2 2k. Lemma. Given M,z, there is a cnf  M,z (x,y) of size O(kn) that has one satisfying assignment for each x such Mx+z = 0 mod 2. Proof. Convert a tree of XORs circuit to a CNF.

18 Returning to Valiant-Vazirani, the RP algorithm is: 1.Pick k R {2,…,n+1}. 2.Pick M,z R {0,1} (n+1)×k. 3.Accept iff Á Æ Â M,z (x,y) USAT. If Á is unsatisfiable, we never accept. If Á is satisfiable, then let S = {x : Á(x)=1}; for some k {2,…,n+1}, 2 k-2 |S| 2 k-1. We pick this k with probability 1/n. If we pick the right k, we have probability at least 1/8 of picking M,z that isolate a satisfying x. Then Á Æ Â M,z (x,y) has one satisfying assignment.

19 Theorem. PH RP P. Proof. Recall that QSAT i = {Á | 9x 1 8x 2 …Q i x i.Á(x 1,x 2,…,x i ) } is Σ i complete. We will give a randomized algorithm to convert Á into a formula à such that Á 2 QSAT i ) Pr[à 2 ©SAT ] ¸ 1-δ Á QSAT i ) Pr[à 2 ©SAT ] = 0 The algorithm works in i stages; each stage removes a quantifier correctly with probability at least 1-δ/i.

20 Suppose we are at stage j and have the formula © z 9x j 8x j+1... Q i x i Á. This is wlog, since we can replace x.P(x) by ¬ x.¬P(x). We produce a formula à such that © z,x 8y j+1 9y j+2...Q i y i.Ã, © z 9x j 8x j+1...Q i x i.Á Idea: the Valiant-Vazirani reduction takes sentence σ = 9x.Á(x) and outputs a sentence τ = © x,y Ã(x,y) that is equivalent with probability at least 1/8n. repeat m = 8n ln(2 |z| × i/δ) times to get τ 1 …τ m. Then Pr[ k. τ k (z) σ(z)] 1 – δ/i2 |z|.

21 Since for any z, Pr[( i τ i (z)) σ(z)] δ/i2 |z|, we have Pr[ z ( i τ i (z)) z σ(z)] δ/i. To finish the proof, we need to convert a sentence z (τ 1 (z) τ 2 (z) … τ m (z)) where each τ i has the form x (x) y.Á(x,y,z), to an equivalent prenex form, x,z y. ϑ (x,y,z) Since x (x) y.Á(x,y,z) x y. (x) Á(x,y,z), we only consider the form z (( x α(z,x)) ( x β(z,x))

22 Lemma. For any formulae α(x),β(x), there exist formulae (α×β) and (α+β) such that ( x α(x)) ( x β(x)) x,y (α×β)(x,y) ( x α(x)) ( x β(x)) x,y ((α+1)×(β+1)+1)(x,y) For a partially quantified formula γ, let #γ be the number of assignments to free variables where γ=1. Proof. Let (α×β)(x,y) = (α(x) β(y)), (α+β)(x,y) = (y=0 α(x)) (y=1 β(x)) Then #(α×β) = #α #β and #(α+β) = #α + #β. Thus the final expression is z (x …x m ) ((τ 1 +1)×(τ 2 +1)×…×(τ m +1) + 1)(x 1,…,x m )

23 CS5403.info


Download ppt "COMPLEXITY THEORY CSci 5403 LECTURE XVI: COUNTING PROBLEMS AND RANDOMIZED REDUCTIONS."

Similar presentations


Ads by Google