15 - NP-CompletenessDesign and Analysis of AlgorithmsAndrei...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NP-CompletenessDesign and Analysis of AlgorithmsAndrei BulatovAlgorithms NP-Completeness15-2NP-CompletenessWhat are the most difficult problems in NP?A problem X is said to be NP-completeif(i) X NP(ii) for any Y NP, we have Y XLemmaIf an NP-complete problem solvable in polynomial time then P = NP.Theorem (Cook, Levin)Circuit Satisfiability is NP-completeAlgorithms NP-Completeness15-3Proving NP-CompletenessRemark. Once we establish first "natural" NP-complete problem,others are much easierRecipe 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. Algorithms NP-Completeness15-4Proving NP-CompletenessLemma 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.ProofLet W be any problem in NP. Then W X Y.By transitivity, W Y. Hence Y is NP-complete. QEDAlgorithms NP-Completeness15-53-SAT: NP-CompletenessProofSuffices 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.Theorem3-SAT is NP-complete??outputxx2x1x3x4x5ixAlgorithms NP-Completeness15-63-SAT: NP-CompletenessMake 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 intoclauses of length exactly 3.QED32xx=541xxx=21xxx=3232,xxxx5415141,,xxxxxxx2121,,xxxxxxx5=x1=x5xx??outputxx2x1x3x4x5Algorithms NP-Completeness15-7Hamiltonian CycleThe Hamiltonian Cycle ProblemInstance: 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.Algorithms NP-Completeness15-8Hamiltonian Cycle1351'3'242'4'NO: bipartite graph with odd number of nodes.Algorithms NP-Completeness15-9Directed Hamiltonian CycleThe Directed Hamiltonian Cycle ProblemInstance: A directed graph G = (V, E)Objective:Does there exist a simple directed cycle that contains every node in V....
View Full Document

This note was uploaded on 11/11/2009 for the course CS 405/705 taught by Professor Bulatov during the Fall '09 term at Simon Fraser.

Page1 / 29

15 - NP-CompletenessDesign and Analysis of AlgorithmsAndrei...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online