Search code examples
algorithmtime-complexitynp-complete

NP complete - solvable in non-deterministic polynomial time


It is written in a book that --"If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A" . But as far I know 'yes' -answer for NP complete problems can be "verified" in polynomial time. I am really confused. Can a NP-complete problem be "solved" using non-deterministic polynomial time algorithm?


Solution

  • Finding the solution to an NP-complete problem can be done in polynomial time on a non-deterministic Turing machine. Given a candidate solution of an NP-complete problem, it can be verified whether it is indeed a solution or not, i.e. checked, in polynomial time on a deterministic Turing machine.

    So the difference is in finding a solution and checking a solution. The former usually requires some kind of search for NP-complete problems while the latter is just verifying the assignments to your variables.