{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

15 - NP-Completeness Design and Analysis of Algorithms...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
NP-Completeness Design and Analysis of Algorithms Andrei Bulatov
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Algorithms – NP-Completeness 15-2 NP-Completeness What are the most difficult problems in NP? A problem X is said to be NP-complete if (i) X NP (ii) for any Y NP, we have Y X Lemma If an NP-complete problem solvable in polynomial time then P = NP. Theorem (Cook, Levin) Circuit Satisfiability is NP-complete
Image of page 2
Algorithms – NP-Completeness 15-3 Proving NP-Completeness Remark. Once we establish first "natural" NP-complete problem, others are much easier Recipe to establish NP-completeness of problem Y. Step 1. Show that Y is in NP. Step 2. Choose an NP-complete problem X. Step 3. Prove that X Y.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Algorithms – NP-Completeness 15-4 Proving NP-Completeness Lemma If X is an NP-complete problem, and Y is a problem in NP with the property that X Y then Y is NP-complete. Proof Let W be any problem in NP. Then W X Y. By transitivity, W Y. Hence Y is NP-complete. QED
Image of page 4
Algorithms – NP-Completeness 15-5 3-SAT: NP-Completeness Proof Suffices to show that CIRCUIT-SAT 3-SAT since 3-SAT is in NP. Let C be any circuit. Create a 3-SAT variable for each circuit element i. Theorem 3-SAT is NP-complete ¬ 0 ? ? output x 0 x 2 x 1 x 3 x 4 x 5 i x
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Algorithms – NP-Completeness 15-6 3-SAT: NP-Completeness Make circuit compute correct values at each node: add 2 clauses: add 3 clauses: add 3 clauses: Hard-coded input values and output value. add 1 clause: add 1 clause: Final step: turn clauses of length < 3 into clauses of length exactly 3. QED 3 2 x x ¬ = 5 4 1 x x x = 2 1 0 x x x = 3 2 3 2 , x x x x 5 4 1 5 1 4 1 , , x x x x x x x 2 1 0 2 0 1 0 , , x x x x x x x 0 5 = x 1 0 = x 5 x 0 x ¬ 0 ? ? output x 0 x 2 x 1 x 3 x 4 x 5
Image of page 6
Algorithms – NP-Completeness 15-7 Hamiltonian Cycle The Hamiltonian Cycle Problem Instance: An undirected graph G = (V, E) Objective: Does there exist a simple cycle Γ that contains every node in V. YES: vertices and faces of a dodecahedron.
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Algorithms – NP-Completeness 15-8 Hamiltonian Cycle 1 3 5 1' 3' 2 4 2' 4' NO: bipartite graph with odd number of nodes .
Image of page 8
Algorithms – NP-Completeness 15-9 Directed Hamiltonian Cycle The Directed Hamiltonian Cycle Problem Instance: A directed graph G = (V, E) Objective: Does there exist a simple directed cycle Γ that contains every node in V.
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern