This preview shows pages 1–7. 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 Document
Unformatted text preview: Part VI: Dealing with Hard Problems Lecture 17: NPCompleteness Lecture 17: NPCompleteness Part VI: Dealing with Hard Problems Objective and Outline Objective: Introduce NPcompleteness and show how to prove that a problem is NPcomplete. Reference : Chapter 34 of CLRS Outline: Polynomialtime reductions. The class NPC . NPComplete problems. SAT, CLIQUE, INDEPENDENT SET, VERTEX COVER Optimization vs. Decision problems Summary Lecture 17: NPCompleteness Part VI: Dealing with Hard Problems What is Reduction? Reduction is a relationship between problems. Problem Q can be reduced to Q’ if every instance of of Q can be “rephrased” as an instance of Q’ Example 1: Q: multiplying two positive numbers. Q’: adding two numbers. Q can be reduced to Q’ via a logarithmic transformation xy = exp [ logx + logy ] If Q can be reduced to Q’, Q is “no harder to solve” than Q’. Lecture 17: NPCompleteness Part VI: Dealing with Hard Problems PolynomialTime Reductions Definition Let L 1 and L 2 be two decision problems. A PolynomialTime Reduction from L 1 to L 2 is a transformation f with the following two properties: 1 f transforms an input x for L 1 into an input f ( x ) for L 2 such that a yesinput of L 1 maps to a yesinput of L 2 , and a noinput of L 1 maps to a noinput of L 2 . f N N Y Y 1 L L 2 2 f ( x ) is computable in polynomial time (in size ( x )). If such an f exists, we say that L 1 is polynomialtime reducible to L 2 , and write L 1 ≤ P L 2 . Lecture 17: NPCompleteness Part VI: Dealing with Hard Problems PolynomialTime Reductions Intuitively, L 1 ≤ P L 2 means L 1 is no harder than L 2 . Given an algorithm A 2 for the decision problem L 2 , we can develop an algorithm A 1 to solve L 1 : Transform f algorithm f(x) input for L2 for L1 input x yes/no answer for L2 on f(x) yes/no answer for L1 on x Algorithm for L1 for L2 If A 2 is polynomialtime algorithm, so it A 1 . Lecture 17: NPCompleteness Part VI: Dealing with Hard Problems PolynomialTime Reduction f : L 1 → L 2 Theorem If L 1 ≤ P L 2 and L 2 ∈ P , then L 1 ∈ P . Proof. L 2 ∈ P means we have a polynomialtime algorithm A 2 for L 2 . Since L 1 ≤ P L 2 , we have a polynomialtime transformation f mapping input x for L 1 to an input for L 2 . Combining these, we get the following polynomialtime algorithm for solving L 1 : (1) take input x for L 1 and compute f ( x ); (2) run algorithm A 2 on input f ( x ), and return the answer found (for L 2 on f ( x )) as the answer for L 1 on x . Each of Steps (1) and (2) takes polynomial time. So the combined algorithm takes polynomial time. Hence L 1 ∈ P . Warning : Note that this does not imply that if L 1 ≤ P L 2 and L 1 ∈ P , then L 2 ∈ P . This statement is not true....
View
Full
Document
This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.
 Spring '07
 ARYA
 Algorithms

Click to edit the document details