More NP-completeness Sipser 7.5 (pages )
CS 311 Fall NP’s hardest problems Definition 7.34: A language B is NP-complete if 1.B ∈ NP 2.A≤ p B, for all A ∈ NP NP A1A1 SAT A3A3 A2A2 CLIQUE
CS 311 Fall Hamiltonian paths HAMPATH = { | ∃ Hamiltonian path from s to t} Theorem 7.46: HAMPATH is NP-complete. s t
CS 311 Fall Hamiltonian paths HAMPATH = { | ∃ Hamiltonian path from s to t} Theorem 7.46: HAMPATH is NP-complete. s t
CS 311 Fall Remember… HAMPATH ∈ NP N = "On input : 1.Guess an orderings, p 1, p 2,..., p n, of the nodes of G 2.Check whether s = p 1 and t = p n 3.For each i=1 to n-1, check whether (p i, p i+1 ) is an edge of G. If any are not, reject. Otherwise, accept.”
CS 311 Fall SAT≤ p HAMPATH NP A1A1 3SAT A3A3 A2A2 HAMPATH
CS 311 Fall Proof outline Given a boolean formula φ, we convert it to a directed graph G such that φ has a valid truth assignment iff G has a Hamiltonian graph
CS 311 Fall SAT ’s main features Choice: Each variable has a choice between two truth values. Consistency: Different occurrences of the same variable have the same value. Constraints: Variable occurrences are organized into clauses that provide constraints that must be satisified. *We model each of these three features by a different a "gadget" in the graph G.
CS 311 Fall The choice gadget Modeling variable x i
CS 311 Fall Zig-zagging and zag-zigging Zig-zag (TRUE)Zag-zig (FALSE)
CS 311 Fall The consistency gadget
CS 311 Fall Clauses Modeling clause c j cjcj
CS 311 Fall The global structure
CS 311 Fall The constraint gadget Modeling when clause c j contains x i
CS 311 Fall The constraint gadget Modeling when clause c j contains x i
CS 311 Fall A situation that cannot occur
CS 311 Fall TSP is NP-complete TSP : Given n cities, 1, 2,..., n, together with a nonnegative distance d ij between any two cities, find the shortest tour.
CS 311 Fall HAMPATH ≤ p TSP NP A1A1 HAMPATH A3A3 A2A2 TSP
CS 311 Fall SUBSET-SUM is NP-complete SUBSET-SUM= { | S = {x 1,…,x k } and, for some {y 1,…,y l } ⊆ S, y i =t} Why is SUBSET-SUM in NP?
CS 311 Fall SAT ≤ p SUBSET-SUM
CS 311 Fall And…if that’s not enough There are more than 3000 known NP-complete problems!
CS 311 Fall Other types of complexity Space complexity Circuit complexity Descriptive complexity Randomized complexity Quantum complexity …