Britannica Sources used in this answer

How can a solution to an NP problem be verified efficiently?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In the context of computational complexity, an NP problem is defined by the ability to verify a proposed solution in polynomial time.12

While finding a solution to an NP problem may be computationally difficult—often requiring time that grows exponentially with the input size—the verification process is considered efficient because it requires only a number of steps bounded by a polynomial function of the input size n. Essentially, if someone provides a "guess" or a candidate solution, an algorithm can check the validity of that specific answer within this polynomial timeframe.12

A classic example of this asymmetry is cryptography: it is computationally easy (polynomial time) to verify the product of two large prime numbers, but it is considered hard to compute the original prime factors from that product. Determining whether all problems that can be verified in polynomial time can also be solved in polynomial time remains one of the most significant open questions in computer science, known as the P versus NP problem.21