17 - Dealing with hard problems - NPC

17 - Dealing with hard problems - NPC - Part VI: Dealing...

Info iconThis preview shows pages 1–7. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Part VI: Dealing with Hard Problems Lecture 17: NP-Completeness Lecture 17: NP-Completeness Part VI: Dealing with Hard Problems Objective and Outline Objective: Introduce NP-completeness and show how to prove that a problem is NP-complete. Reference : Chapter 34 of CLRS Outline: Polynomial-time reductions. The class NPC . NP-Complete problems. SAT, CLIQUE, INDEPENDENT SET, VERTEX COVER Optimization vs. Decision problems Summary Lecture 17: NP-Completeness 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: NP-Completeness Part VI: Dealing with Hard Problems Polynomial-Time Reductions Definition Let L 1 and L 2 be two decision problems. A Polynomial-Time 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 yes-input of L 1 maps to a yes-input of L 2 , and a no-input of L 1 maps to a no-input 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 polynomial-time reducible to L 2 , and write L 1 ≤ P L 2 . Lecture 17: NP-Completeness Part VI: Dealing with Hard Problems Polynomial-Time 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 polynomial-time algorithm, so it A 1 . Lecture 17: NP-Completeness Part VI: Dealing with Hard Problems Polynomial-Time 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 polynomial-time algorithm A 2 for L 2 . Since L 1 ≤ P L 2 , we have a polynomial-time transformation f mapping input x for L 1 to an input for L 2 . Combining these, we get the following polynomial-time 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.

Page1 / 51

17 - Dealing with hard problems - NPC - Part VI: Dealing...

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

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