1. 2 lecture outline basic definitions: basic definitions: p, np complexity classes p, np complexity...

Download 1. 2 Lecture outline Basic definitions: Basic definitions: P, NP complexity classes P, NP complexity classes the notion of a certificate. the notion of

Post on 13-Dec-2015

214 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Slide 1

1 Slide 2 2 Lecture outline Basic definitions: Basic definitions: P, NP complexity classes P, NP complexity classes the notion of a certificate. the notion of a certificate. reductions, various types: reductions, various types: Karp, Cook and Levin. Karp, Cook and Levin. Search vs Decision problems Search vs Decision problems self-reducibility. self-reducibility. NP-Complete languages and relations NP-Complete languages and relations NP Complete relation and self-reducibility. NP Complete relation and self-reducibility. Introducing some NP-Complete problems. Introducing some NP-Complete problems. Showing R SAT is NP-hard. Showing R SAT is NP-hard. Slide 3 3 The P, NP complexity classes Def: A Decision problem for a language L {0,1} * is to decide whether a given string x belongs to the language L. Def: P is the class of languages (decision problems) that can be recognized by a deterministic polynomial time Turing machine. Def: NP is the class of languages that can be recognized by a non-deterministic polynomial- time Turing-machine. Slide 4 4 Polynomially Verifiable Relations Def: A binary relation R is polynomially bounded if: (x,y) R |y| |x| o(1) Def: R is polynomial-time-decidable if the corresponding language L R = { (x,y) : (x,y) R } is in P. Def: A relation that is both polynomially- bounded & polynomial-time-decidable is polynomially-verifiable. Slide 5 5 NP Alternative Definition Def: L is an NP language if there is a polynomially-verifiable relation R L s.t. X L w for which (x,w) R L Def: L is an NP language if there is a polynomially-verifiable relation R L s.t. X L w for which (x,w) R L w is a witness or a certificate. w is a witness or a certificate. Given a witness, membership can be verified in polynomial time. P=NP implies: witness can be found efficiently Slide 6 6 The NP game The notion of a certificate can be thought of a game between a prover and a verifier proverprover verifierverifier Given input X The all powerful prover sends a certificate for membership of X Which the verifier can validate efficiently Slide 7 7 NDTM PolyVerRel Assume M L is a non-deterministic TM that decides L within P L ( |x| ) steps Assume M L is a non-deterministic TM that decides L within P L ( |x| ) steps Let R L be the set of all pairs (x,y) s.t. Let R L be the set of all pairs (x,y) s.t. x is an input to M L Y is an accepting, legal computation of M L on x R L is polynomially-verifiable R L is polynomially-verifiable X L a computation y s.t. (x,y) R L X L a computation y s.t. (x,y) R L 1.2.1 Slide 8 8 PolyVerRel NDTM Let R L be the relation for L, decided by a deterministic TM M * L Let R L be the relation for L, decided by a deterministic TM M * L Def a non-deterministic TM M L : Def a non-deterministic TM M L : Guess y of proper polynomial size Call M * L to check if (x,y) R L Accept x if M * L accepts (x,y) M L is a non-deterministic TM for L M L is a non-deterministic TM for L Slide 9 9 Search Problems Def: A search problem over a binary relation R finds, given x, a string y s.t. (x,y) R. Def: A search problem over a binary relation R finds, given x, a string y s.t. (x,y) R. Given a polynomially - verifiable relation R, define: L(R) = { x : y s.t. (x,y) R } Given a polynomially - verifiable relation R, define: L(R) = { x : y s.t. (x,y) R } Clearly, finding a solution can only be harder than just deciding whether it exists. Note: NP = { L(R) : R is polynomially-verifiable } Slide 10 10 Problem: 3-coloring graphs Instance: An undirected graph G=(V,E) Corresponding relation: R 3COL = { (G, ) : is a legal 3-coloring of G } Decision problem: decide the language L(R 3COL ), namely whether G is 3-colorable. Search problem: find a 3-coloring of G. Example Slide 11 11 Reductions The purpose of a reduction is to show that some problem is at least as hard as some other problem. The purpose of a reduction is to show that some problem is at least as hard as some other problem. If problem A reduces to problem B, then solving B implies solving A. If problem A reduces to problem B, then solving B implies solving A. 2.1 B is at least as hard as A, denoted A B Slide 12 12 Cook Reduction Def: An oracle for a problem is a magical apparatus that, given an input x to , returns (x) in a single step. Def: A Cook reduction from problem 1 to problem 2 is a polynomial-time TM for solving 1 on input x utilizing an oracle for 2. Denoted 1 cook 2. Slide 13 13 Karp Reduction Def: A Karp reduction of L 1 to L 2 is a polynomial-time--computable function f s.t. x L 1 f(x) L 2 f L2L2 f(x) L1L1 L2L2 x L1L1 L2L2 Slide 14 14 Karp vs. Cook reductions Cook reduction allows calling the oracle polynomially many times Karp reduction allows only one call to the oracle, and only at the end of the computation. Cook reduction is stronger: given Karp reduction f, Cook reduction is stronger: given Karp reduction f, On input x compute the value f(x). Present f(x) to the oracle, and output its answer. There are (few) examples where a Cook reduction is known, while a Karp reduction is unknown. There are (few) examples where a Cook reduction is known, while a Karp reduction is unknown. Solve 1 2 oracle I/o Slide 15 15 Levin Reduction Def: a Levin reduction from R 1 to R 2 is 3 poly-time-computable functions f,g,h s.t. x L(R 1 ) f(x) L(R 2 ) (x,y) R 1 ( f(x), g(x,y) ) R 2 ( f(x),z ) R 2 ( x, h(x,z) ) R 1 f translates inputs of the first problem to inputs of the second problem, g & h transform certificates of one to the other. Note: A Levin reduction implies Cook / Karp reductions of the corresponding search / decision problems. 2.1 Slide 16 16 Properties of Reductions Claim: All reductions are transitive: A reduces to B, B to C A reduces to C Claim: Cook reduction preserves poly - time - computability Proof: assume 1 Cook-reduces to the poly- time-comp problem 2, and M is the reduction algorithm. 2 -oracle can be simulated by a poly-time TM Replacing oracle queries in M by the simulation - we get a poly-time TM that solves 1. So do Karp & Levin reductions 2.1 Slide 17 17 Search vs. Decision Problems Recall: for poly-time verifiable relation R, L(R) = { x : y s.t. (x,y) R } Def: A relation R is called self-reducible if solving the search problem for R is Cook-reducible to deciding the language L(R). 1.4 The search problem can be solved using the decision problem Slide 18 18 Input: A CNF formula with n variables. Task: find : {1,..,N} {0,1} such that ( (1), , (n) ) = True Corresponding relation: R SAT = { ( , ) : ( (1), , (n) ) = T } SAT = L(R SAT ) An Example: 3-SAT Note: Self-reducibility is a property of a relation, not a language. [There are many relations R for which SAT = L(R).] Slide 19 19 R SAT Thm: R sat is Self-Reducible. Proof: Assuming an oracle O for the language SAT = L(R SAT ). solving the search problem: Query O whether SAT. If not - stop. For k := 1 to n: For k := 1 to n: K (x k+1,.., x n ) := ( 1,.., k-1,1, x k+1,.., x n ) If k SAT (Query O), k = 1 else k = 0. (1)= 1, , (n)= n satisfies ! (1)= 1, , (n)= n satisfies ! 1.4.1 formula obtained by replacing x 1,..,x k with 1,.., k-1,1 Slide 20 20 y = 1: ( 1 1) ( 1 z) Self-reducibility of SAT Given: ( x y) ( x z) SAT oracle x = 1: ( 1 y) ( 1 z) Yes y = 0: ( 1 0) ( 1 z) z = 1: ( 1 0) ( 1 1) ( x y) ( x z) No Slide 21 21 Another Example: GI Graph Isomorphism: given two ( simple ) graphs, are they isomorphic? Natural relation: R GI contains all ( (G1,G2), ) s.t. is an isomorphism between G 1 and G 2. Unlike SAT, GI is not known to be NP-Complete in fact GI is unlikely to be NP-hard, as well see later in the course Slide 22 22 Thm: R GI is Self-Reducible. Proof: construct piecemeal, 1 vertex at a time check if u G 1 can be mapped by to v G 2 : Connect both v and u to new n leaf-vertices to obtain 2 new graphs, G 1 & G 2 Connect both v and u to new n leaf-vertices to obtain 2 new graphs, G 1 & G 2 If G 1 isomorphic to G 2 - u must be mapped to v If G 1 isomorphic to G 2 - u must be mapped to v Iterating this - deleting matching vertices - determines the isomorphism, a vertex at a time Iterating this - deleting matching vertices - determines the isomorphism, a vertex at a time R GI 1.4.2 u and v are distinguished from other vertices so any isomorphism must map u to v Slide 23 23 Graph Isomorphism Slide 24 24 Non Self-Reducibility There are many non-self - reducible relations, but it is hard to find an NP language, whose natural relation is non-self-reducible. There are many non-self - reducible relations, but it is hard to find an NP language, whose natural relation is non-self-reducible. L COMP = { N : N = n1 n2 } is poly- time decidable via a randomized algorithm. L COMP = { N : N = n1 n2 } is poly- time decidable via a randomized algorithm. The natural choice is R COMP = { ( N, (n1,n2) ) : N = n1 n2 } The natural choice is R COMP = { ( N, (n1,n2) ) : N = n1 n2 } It is widely believed the search of R COMP is not poly-time-comp (factoring), which would imply it is not self-reducible (by a random algorithm) It is widely believed the search of R COMP is not poly-time-comp (factoring), which would imply it is not self-reducible (by a random algorithm) deterministic! Slide 25 25 NP-completeness Def: A language L is NP-Complete if: 1. L NP. 2. L NP: L Karp L. Def: A relation R is NP-Complete if: 1. L(R) NP. 2. R s.t. L(R) NP: R Levin R. Generalize: L Cook L Slide 26 26 NP-completeness & Self-Reducibility Thm: For every relation R, R is NP-Complete R is self-reducible. Proof : Let R be an NP-complete relation. Proof : Let R be an NP-complete relation. R SAT is NP-hard under Levin reduction (to be proven later), namely, there is a Levin reduction (f,g,h) from R to R SAT Since R is NP-complete, there exists a Karp reduction k from SAT to L(R). 2.2 Slide 27 27 Proof (con

Recommended

View more >