0

To prove that a certain problem is in P we have to give an algorithm that decides or solves it in polynomial time. To prove that a problem is in NP an algorithm must exist so that it can check whether a certain input is a solution to the problem in polynomial time (validate the input).

I am very confused as to how we can apply that logic to problems that are defined as a certain language. I have attached such problem to this post from Spiser's book on formal automata. For example SPATH is essentially a language that contains a certain number of elements. If "deciding" SPATH is checking whether a certain input is in the language or not then how could one validate a possible solution to prove that its in NP.

For example is SPATH is the language that contains all graphs having a certain property. Would an algorithm that checks whether an arbitrary graph G is in SPATH or not in polynomial time be "deciding" SPATH and proving that it is in P or would be validating the input and proving that it is in NP?

enter image description here

0 Answers0