summary of what we know
play

Summary of What We Know Definition (Polynomial Time Reducibility) We - PDF document

Summary of What We Know Definition (Polynomial Time Reducibility) We write A P B iff there is a polynomial time computable Computability and Complexity function f such that for any input w we have w A iff f ( w ) B . Definition


  1. Summary of What We Know Definition (Polynomial Time Reducibility) We write A ≤ P B iff there is a polynomial time computable Computability and Complexity function f such that for any input w we have w ∈ A iff f ( w ) ∈ B . Definition (NP-Completeness) Lecture 13 A language B is NP-complete iff B ∈ NP (containment in NP) and for every A ∈ NP we have A ≤ P B (NP-hardness). More NP-complete Problems Facts: SAT and CNF-SAT are NP-complete (last lecture). given by Jiri Srba Theorem If A is NP-complete, A ≤ P B , and B ∈ NP, then B is NP-complete. Lecture 13 Computability and Complexity 1/13 Lecture 13 Computability and Complexity 2/13 Proof: CNF-SAT ≤ P 3SAT NP-Completeness of 3SAT Boolean Formula in cnf Assume a given formula φ = C 1 ∧ C 2 ∧ . . . ∧ C k in cnf. We construct in poly-time a formula φ ′ = C ′ φ = C 1 ∧ C 2 ∧ . . . ∧ C k where every C i , 1 ≤ i ≤ k is a disjunction 1 ∧ C ′ 2 ∧ . . . ∧ C ′ k of number of literals in 3-cnf such that φ is satisfiable if and only if φ ′ is satisfiable. Every clause C i = Boolean Formula in 3-cnf φ = C 1 ∧ C 2 ∧ . . . ∧ C k where every C i , 1 ≤ i ≤ k is a disjunction ( ℓ 1 ∨ ℓ 2 ∨ . . . ∨ ℓ m ) of exactly 3 literals is transformed into conjunction of clauses C ′ i = CNF-SAT def = {� φ � | φ is a satisfiable Boolean formula in cnf } 3SAT def ( ℓ 1 ∨ ℓ 2 ∨ z 1 ) ∧ ( z 1 ∨ ℓ 3 ∨ z 2 ) ∧ ( z 2 ∨ ℓ 4 ∨ z 3 ) ∧ ( z 3 ∨ ℓ 5 ∨ z 4 ) ∧ . . . = {� φ � | φ is a satisfiable Boolean formula in 3-cnf } . . . ( z m − 3 ∨ ℓ m − 1 ∨ ℓ m ) Theorem where z 1 , . . . , z m − 3 are new (fresh) variables. CNF-SAT ≤ P 3SAT i is satisfiable, the formula φ ′ is in Clearly, C i is satisfiable iff C ′ Corollary 3-cnf (if fewer variables than 3 in a clause then repeat some literal), and the reduction works in polynomial time. 3SAT in NP-complete. Lecture 13 Computability and Complexity 3/13 Lecture 13 Computability and Complexity 4/13 NP-Completeness of CLIQUE NP-Completeness of VERTEX-COVER Vertex-Cover Problem: Given an undirected graph G and a number k , is there a subset of nodes of size k s.t. every edge touches at least one of these nodes? Theorem We call such a subset a k -node vertex cover. CLIQUE is NP-complete. Definition of the Language VERTEX-COVER Proof: We already know (from previous lectures) that VERTEX-COVER def = {� G , k � | G is a graph with k -vertex cover } CLIQUE is in NP, and 3SAT ≤ P CLIQUE . Clearly, VERTEX-COVER is in NP. Because 3SAT is NP-complete, we conclude that CLIQUE is Theorem NP-complete too. 3SAT ≤ P VERTEX-COVER Corollary VERTEX-COVER is NP-complete. Lecture 13 Computability and Complexity 5/13 Lecture 13 Computability and Complexity 6/13

  2. Proof: 3SAT ≤ P VERTEX-COVER NP-Completeness of HAMPATH Theorem Let φ be a 3-cnf formula with m variables and p clauses. 3SAT ≤ P HAMPATH We construct in poly-time an instance � G , k � of VERTEX-COVER where k = m + 2 p and G is given by: Corollary HAMPATH is NP-complete. For every variable x in φ add two nodes labelled with x and x and connect them by an edge (variable gadget). Proof ( 3SAT ≤ P HAMPATH ): For a given 3-cnf formula For every clause ( ℓ 1 ∨ ℓ 2 ∨ ℓ 3 ) in φ add three nodes labelled with ℓ 1 , ℓ 2 and ℓ 3 and connect them by 3 edges so that they form a triangle φ = ( a 1 ∨ b 1 ∨ c 1 ) ∧ ( a 2 ∨ b 2 ∨ c 2 ) ∧ . . . ∧ ( a k ∨ b k ∨ c k ) (clause gadget). � �� � � �� � � �� � C 1 C 2 C k Add an edge between any two identically labelled nodes, one from a variable gadget and one from a clause gadget. over the variables x 1 , x 2 , . . . , x m construct in poly-time a digraph G and nodes s and t such that Note that the reduction works in polynomial time and that φ is satisfiable iff G has a k -vertex cover. φ is satisfiable if and only if G has a Hamiltonian path from s to t . Lecture 13 Computability and Complexity 7/13 Lecture 13 Computability and Complexity 8/13 Proof: 3SAT ≤ P HAMPATH NP-Completeness of UHAMPATH Definition UHAMPATH def = {� G , s , t � | G is undirected graph with a Hamiltonian path from s to t } Theorem UHAMPATH is NP-complete. Proof: By poly-time reduction from HAMPATH . In the reduction from a directed graph to an undirected one, we replace every node with an undirected path of length 2: Lecture 13 Computability and Complexity 9/13 Lecture 13 Computability and Complexity 10/13 NP-Completeness of SUBSET-SUM Proof: 3SAT ≤ P SUBSET-SUM C 1 C 2 . . . C k SUBSET-SUM def = {� S , t � | x 1 1 0 0 0 . . . 0 1 0 . . . 0 S = { x 1 , . . . , x k } ⊆ N is a multiset, t ∈ N , and there is a multiset X ⊆ S s.t. � X = t } 1 0 0 0 . . . 0 0 0 . . . 1 x 1 1 0 0 . . . 0 0 0 . . . 1 x 2 1 0 0 . . . 0 1 0 . . . 0 Theorem x 2 x 3 1 0 . . . 0 0 0 . . . 0 SUBSET-SUM is NP-complete. x 3 1 0 . . . 0 1 0 . . . 0 . . . Proof: By poly-time reduction from 3SAT . For a given 3-cnf x m . . . 1 0 0 . . . 0 formula x m . . . 1 0 1 . . . 0 1 0 . . . 0 φ = ( a 1 ∨ b 1 ∨ c 1 ) ∧ ( a 2 ∨ b 2 ∨ c 2 ) ∧ . . . ∧ ( a k ∨ b k ∨ c k ) 1 0 . . . 0 � �� � � �� � � �� � C 1 C 2 C k 1 . . . 0 1 . . . 0 . over the variables x 1 , x 2 , . . . , x m construct in poly-time a set of . . numbers S and a number t such that 1 1 φ is satisfiable iff from S we can select numbers that add up to t . t 1 1 1 1 . . . 1 3 3 . . . 3 Lecture 13 Computability and Complexity 11/13 Lecture 13 Computability and Complexity 12/13

  3. Summary Cook-Levin Theorem: SAT is NP-complete. Because poly-time reducibility ( ≤ P ) is transitive, all languages below are NP-hard. All languages below belong to NP, so they are NP-complete. Lecture 13 Computability and Complexity 13/13

Recommend


More recommend