This preview shows pages 1–10. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: NPCompletenessDesign and Analysis of AlgorithmsAndrei BulatovAlgorithms NPCompleteness152NPCompletenessWhat are the most difficult problems in NP?A problem X is said to be NPcompleteif(i) X NP(ii) for any Y NP, we have Y XLemmaIf an NPcomplete problem solvable in polynomial time then P = NP.Theorem (Cook, Levin)Circuit Satisfiability is NPcompleteAlgorithms NPCompleteness153Proving NPCompletenessRemark. Once we establish first "natural" NPcomplete problem,others are much easierRecipe to establish NPcompleteness of problem Y.Step 1. Show that Y is in NP.Step 2. Choose an NPcomplete problem X.Step 3. Prove that X Y. Algorithms NPCompleteness154Proving NPCompletenessLemma If X is an NPcomplete problem, and Y is a problem in NP with the property that X Y then Y is NPcomplete.ProofLet W be any problem in NP. Then W X Y.By transitivity, W Y. Hence Y is NPcomplete. QEDAlgorithms NPCompleteness1553SAT: NPCompletenessProofSuffices to show that CIRCUITSAT 3SAT since 3SAT is in NP.Let C be any circuit.Create a 3SAT variable for each circuit element i.Theorem3SAT is NPcomplete??outputxx2x1x3x4x5ixAlgorithms NPCompleteness1563SAT: NPCompletenessMake circuit compute correct values at each node:add 2 clauses:add 3 clauses:add 3 clauses:Hardcoded 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 NPCompleteness157Hamiltonian 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 NPCompleteness158Hamiltonian Cycle1351'3'242'4'NO: bipartite graph with odd number of nodes.Algorithms NPCompleteness159Directed 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.
 Fall '09
 Bulatov
 Algorithms

Click to edit the document details