I know if I reduce an NP-complete problem to a unknown problem P then I'm sure that P is itself NP-complete. And I know if I reduce a Problem P to an NP-complete problem there is no conclusion. So I want to give an example to show that we can reduce a Polynomial solvable problem P to an NP-complete one.
-
Maybe this question is better suited for Programmers.SE? – Jan Doggen Nov 18 '14 at 13:18
-
I raised this question from chapter 34 CLRS about NP-completeness – user3070752 Nov 18 '14 at 13:29
1 Answers
If I reduce an NP-complete problem to a unknown problem P then I'm sure that P is itself NP-complete
No, this is not well formulated. If an NP-complete problem A is reducible to a problem P all we can say is that any problem in NP is reducible to P. To say that P is NP-complete we need to know additionally that P is itself in NP.
What you probably intended to say was
If I reduce an NP-complete problem to some
a unknownproblem P in NP then I'm sure that P is itself NP-complete
Now to your original question.
give an example to show that we can reduce a Polynomial solvable problem P to an NP-complete one
Consider the problem known as 2-SAT: Given a boolean formula in conjunctive normal form such that each disjunction contains at most two variables tell it if is satisfiable.
Solving this problem following an algorithm by Aspvall, Plass & Tarjan (1979) involves building an implication graph and finding all its strongly connected components. The paper proves that the formula is satisfiable if and only if the implication graph does not contain a strongly connected component that include some variable together with its negation. It also shows that this algorithm is linear in the size of the formula encoding.
So
- there exists a linear algorithm for 2-SAT.
- 2-SAT is reducible to unrestricted boolean satisfiability problem known as SAT.
This gives an example of a polynomially solvable problem (2-SAT) that is reducible to an NP-complete problem (SAT).

- 16,199
- 6
- 40
- 76