1

Forgive me if this is a stupid question - it's been a while since I thought at all about complexity theory and I want to make sure that I have covered all the possible angles with regards to the basics.

My question is, is it immediately true that class P is a subset of the class NP? That is, do we need to prove that the set of problems for which a solution may be obtained in polynomial time, is a subset of the class of problems for which a potential solution may be verified in polynomial time?

For example, consider a problem has multiple solutions and suppose that at least one of these solutions can be found by a program that runs in polynomial time. Then this problem is clearly in the class of P, since a solution can be found in polynomial time.

However, this does not tell us that all solutions are verifyable in polynomial time. Could it not be the case that some other solution to the problem is very difficult to verify?

M Smith
  • 467
  • 4
  • 11

1 Answers1

1

P problems are a subset of NP problems. For a problem to be in P it must be decidable in polynomial time. For a problem to be in NP, it must be verifiable in polynomial time. If a problem is decidable in polynomial time, it is clearly verifiable in polynomial time as it can simply be verified by deciding it a second time. Therefore, all P problems are in NP.

I think that the fundamental component that you may not be remembering is that P and NP refer to specific time complexity classes of decision problems. Decision problems can't return general solutions. They can return yes (accept), no (reject), or never return.

jncraton
  • 113
  • 3