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

Slides:



Advertisements
Similar presentations
Complexity Theory Lecture 6
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Complexity Theory Lecture 8
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Isolation Technique April 16, 2001 Jason Ku Tao Li.
Complexity Theory Lecture 7
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
NP-Completeness: Reductions
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
CS151 Complexity Theory Lecture 7 April 20, 2004.
Graphs 4/16/2017 8:41 PM NP-Completeness.
The Counting Class #P Slides by Vera Asodi & Tomer Naveh
1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect.
–Def: A language L is in BPP c,s ( 0  s(n)  c(n)  1,  n  N) if there exists a probabilistic poly-time TM M s.t. : 1.  w  L, Pr[M accepts w]  c(|w|),
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
1 On the Computation of the Permanent Dana Moshkovitz.
CS151 Complexity Theory Lecture 6 April 15, 2004.
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
1 Hardness Result for MAX-3SAT This lecture is given by: Limor Ben Efraim.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
May 9, New Topic The complexity of counting.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
CS151 Complexity Theory Lecture 12 May 6, QSAT is PSPACE-complete Theorem: QSAT is PSPACE-complete. Proof: 8 x 1 9 x 2 8 x 3 … Qx n φ(x 1, x 2,
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
28.
NPC.
CSC 413/513: Intro to Algorithms
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Complexity 24-1 Complexity Andrei Bulatov Counting Problems.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
Perfect Matchings in Bipartite Graphs
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
Where Can We Draw The Line?
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
Richard Anderson Lecture 28 NP-Completeness
CS21 Decidability and Tractability
Lecture 4-4 #P-complete Problems
Umans Complexity Theory Lectures
CS151 Complexity Theory Lecture 7 April 23, 2019.
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

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

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.

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).

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

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

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.

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?

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

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

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

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

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

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)

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.

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 Ã?

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

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.

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.

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.

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|.

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))

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 )

CS5403.info