5

If a problem A known to be NP-Complete can be reduced to another problem B in polynomial time then B is (A) NP-Complete (B) NP-hard

Nothing is given about problem B whether it is in NP or not. I'm confused because in Hopcraft and Ullman book there is theorem given if a NP-complete problem P1 can be reduced to problem P2 in polynomial time then P2 is NP-complete. But it also required for a problem to be NP-Complete that it should belong to NP class. Guys help in understanding this concept.

Prashant Bhardwaj
  • 1,203
  • 2
  • 18
  • 26
  • As some of the answerers noted (some were *totally* off), the reduction simply makes B NP-Hard, although in your particular case, even though not stated explicitly, maybe the authors thought it was obvious that it was in NP (and therefore NPC). If it's easily verifiable (usually the easiest way to belong to NP) then that would be enough. – davin Nov 25 '11 at 17:11

3 Answers3

10

If A can be reduced to B in polynomial time all you know is that B is harder than A. In your case, if A is NP-complete, B is NP-hard.

If B also happens to be in NP then B will be NP-complete (since NP-complete means being both in NP and being NP-hard at the same time).

However, nothing stops you from reducing A to a problem that is not in NP. For example, it is trivial to reduce any problem in NP to the halting problem - a problem that is undecideable in addition to being NP-hard:

Construct the following program:
    Test all possible solutions for A.
    If one of them is successful halt and otherwise enter an infinite loop.
A has a solution if-and-only if that program halts
ggorlen
  • 44,755
  • 7
  • 76
  • 106
hugomg
  • 68,213
  • 24
  • 160
  • 246
2

Since problem A can be reduced to problem B in polynomial time, any solution to problem B can be used to find a solution to A. Or more simply, solving A cannot be harder than solving B. Since we know A is NP-complete, which class of problems is at least as hard as NP-complete problems?

For reference you might also want to take a look at the wikipedia articles on NP-Hard (specifically the 2nd sentence), NP-Complete. and Reduction.

David Brown
  • 13,336
  • 4
  • 38
  • 55
  • That's what I'm asking that why B is not just NP-hard. B could be harder than NP. That way B should be NP-hard. If it is also in NP then we can say that B is NP-Complete. – Prashant Bhardwaj Nov 25 '11 at 17:09
  • Yes, B is NP-Hard. NP-Hard problems are "at least as hard as the hardest problems in NP." Since A can be reduced to B, B is at least as hard as A, and since A is NP-complete it is among the hardest problems in NP. – David Brown Nov 25 '11 at 17:14
  • thank you @David. I got it finally. I was little bit confused after reading from so many different sources. – Prashant Bhardwaj Nov 25 '11 at 17:17
  • One more doubt David, Suppose we can reduce a NP problem A to another problem B in polynomial time then what can we infer about B. Will it be in NP or not? – Prashant Bhardwaj Nov 25 '11 at 17:32
  • We can't say if B is NP or not. NP is an upper bound on the complexity of a problem, but all we know about B is that it's at least as hard as A (which is a lower bound). NP-Hard is a lower bound on complexity, all NP-Hard problems are at least as hard as NP-Complete problems (and possibly harder). However if A is just NP, we can't say that B is NP-Hard either (Not unless P=NP) because it could be that both A and B are NP but not NP-Complete. The vendiagram [here](http://en.wikipedia.org/wiki/NP-hard) should help clarify this. – David Brown Nov 25 '11 at 17:46
-1

If A is NP-Complete, then it is also necessarily NP. This in turns means that every potential solution for A can be verified in polynomial time, which implies that the same is true for B (since A is reducible to B in polynomial time). Hence B is NP; it doesn't have to be stated as separate condition.

Xion
  • 22,400
  • 10
  • 55
  • 79
  • My teacher has told me that If problem Y can be reduced to problem X, It also means that X is at least as hard as Y because if you can solve X, you can solve Y. I'm also quoting wikipedia here "A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H." – Prashant Bhardwaj Nov 25 '11 at 17:00
  • 2
    A being reducible to B means that any solution of B can be used to solve A. This does not put an upper limit on the complexity of B, so B could be harder than NP. – David Brown Nov 25 '11 at 17:03