1 / 22

More NP-completeness

More NP-completeness. Sipser 7.5 (pages 283-294). NP’s hardest problems. Definition 7.34: A language B is NP-complete if B∈NP A≤ p B , for all A∈NP. NP. A 2. A 1. CLIQUE. SAT. A 3. Hamiltonian paths. HAMPATH = {< G,s,t > | ∃ Hamiltonian path from s to t }

graceland
Download Presentation

More NP-completeness

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More NP-completeness Sipser 7.5 (pages 283-294)

  2. NP’s hardest problems • Definition 7.34: A language B is NP-complete if • B∈NP • A≤pB, for all A∈NP NP A2 A1 CLIQUE SAT A3

  3. Hamiltonian paths • HAMPATH = {<G,s,t> | ∃ Hamiltonian path from s to t} • Theorem 7.46: HAMPATH is NP-complete. s t

  4. Hamiltonian paths • HAMPATH = {<G,s,t> | ∃ Hamiltonian path from s to t} • Theorem 7.46: HAMPATH is NP-complete. s t

  5. Remember… HAMPATH∈NP • N = "On input <G,s,t>: • Guess an orderings, p1, p2,..., pn, of the nodes of G • Check whether s = p1 and t = pn • For each i=1 to n-1, check whether (pi, pi+1) is an edge of G. If any are not, reject. Otherwise, accept.”

  6. 3SAT≤pHAMPATH NP A2 A1 HAMPATH 3SAT A3

  7. Proof outline • Given a boolean formulaφ, we convert it to a directed graph G such that φ has a valid truth assignment iffG has a Hamiltonian graph

  8. 3SAT’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.

  9. The choice gadget • Modeling variable xi

  10. Zig-zagging and zag-zigging Zig-zag (TRUE) Zag-zig (FALSE)

  11. The consistency gadget

  12. Clauses • Modeling clause cj cj

  13. The global structure

  14. The constraint gadget • Modeling when clause cj contains xi

  15. The constraint gadget • Modeling when clause cj contains xi

  16. A situation that cannot occur

  17. TSP is NP-complete • TSP: Given n cities, 1, 2, ..., n, together with a nonnegative distance dijbetween any two cities, find the shortest tour.

  18. HAMPATH ≤pTSP NP A2 A1 TSP HAMPATH A3

  19. SUBSET-SUM is NP-complete • SUBSET-SUM= {<S,t> | S = {x1,…,xk} and, for some {y1,…,yl} ⊆ S, yi=t} • Why is SUBSET-SUM in NP?

  20. 3SAT ≤pSUBSET-SUM

  21. And…if that’s not enough • There are more than 3000 known NP-complete problems! http://en.wikipedia.org/wiki/List_of_NP-complete_problems

  22. Other types of complexity • Space complexity • Circuit complexity • Descriptive complexity • Randomized complexity • Quantum complexity • …

More Related