P vs NP Problem
by aoum, Mar 20, 2025, 8:47 PM
The P vs. NP Problem: One of the Greatest Unsolved Questions in Computer Science
The P vs. NP problem is one of the most profound and long-standing unsolved problems in mathematics and theoretical computer science. It is one of the seven Millennium Prize Problems, meaning that a correct proof (or disproof) earns a reward of $1,000,000 from the Clay Mathematics Institute.
At its core, the P vs. NP problem asks:
Is every problem whose solution can be verified quickly also solvable quickly?
More formally:
Does P = NP?
If the answer is "yes," it means that problems for which a solution can be verified quickly (in polynomial time) can also be solved quickly. If "no," then there are problems that are inherently hard to solve, even though checking a solution is easy.
1. Understanding P and NP
In complexity theory, problems are classified based on how efficiently they can be solved by an algorithm. The classes P and NP describe two fundamental categories of decision problems.
By definition, we have:
![\[
\text{P} \subseteq \text{NP}.
\]](//latex.artofproblemsolving.com/0/4/d/04d0eb775f943e138ec10566878d487e8a42f04e.png)
The open question is whether this inclusion is strict: Is P = NP, or is P
NP?
2. NP-Complete Problems: The Hardest Problems in NP
A subset of NP problems, called NP-complete problems, are the "hardest" problems in NP. If any NP-complete problem can be solved in polynomial time, then P = NP.
To formally define NP-complete problems:
A problem
is NP-complete if:
The first NP-complete problem, Boolean satisfiability (SAT), was proved by Stephen Cook in 1971 through the famous Cook-Levin theorem. Since then, thousands of problems have been shown to be NP-complete.
Examples of NP-complete problems:
3. Implications of P = NP or P ≠ NP
The resolution of the P vs. NP problem would have enormous implications across mathematics, computer science, cryptography, and more.
If P = NP:
If P ≠ NP:
4. Attempts to Solve the P vs. NP Problem
Despite extensive efforts, no one has been able to prove or disprove whether P = NP. Some major developments include:
5. Theoretical and Practical Consequences
If P = NP, it would revolutionize fields such as:
If P ≠ NP, it would confirm the inherent hardness of many problems and validate the foundation of computational security.
6. Summary
7. References
The P vs. NP problem is one of the most profound and long-standing unsolved problems in mathematics and theoretical computer science. It is one of the seven Millennium Prize Problems, meaning that a correct proof (or disproof) earns a reward of $1,000,000 from the Clay Mathematics Institute.
At its core, the P vs. NP problem asks:
Is every problem whose solution can be verified quickly also solvable quickly?
More formally:
Does P = NP?
If the answer is "yes," it means that problems for which a solution can be verified quickly (in polynomial time) can also be solved quickly. If "no," then there are problems that are inherently hard to solve, even though checking a solution is easy.

Euler diagram for P, NP, NP-complete, and NP-hard set of problems (excluding the empty language and its complement, which belong to P but are not NP-complete)
1. Understanding P and NP
In complexity theory, problems are classified based on how efficiently they can be solved by an algorithm. The classes P and NP describe two fundamental categories of decision problems.
- P (Polynomial Time): This is the class of decision problems that can be solved by a deterministic Turing machine in polynomial time. In other words, if a problem is in P, there exists an algorithm that can solve it in time bounded by a polynomial function of the input size.
Examples of problems in P include:- Sorting a list (using algorithms like merge sort).
- Finding the greatest common divisor (using the Euclidean algorithm).
- Determining whether a number is prime (with modern algorithms like AKS primality testing).
- NP (Nondeterministic Polynomial Time): This is the class of decision problems where a proposed solution can be verified in polynomial time by a deterministic Turing machine. An equivalent definition is that NP problems can be solved by a nondeterministic Turing machine in polynomial time.
Examples of problems in NP include:- The Traveling Salesman Problem (TSP): Given a list of cities and distances between them, is there a tour visiting each city exactly once with a total length less than a given value?
- The Boolean Satisfiability Problem (SAT): Given a Boolean formula, is there an assignment of variables that makes the formula true?
- Graph Coloring: Can the vertices of a graph be colored with
colors such that no two adjacent vertices share the same color?
By definition, we have:
![\[
\text{P} \subseteq \text{NP}.
\]](http://latex.artofproblemsolving.com/0/4/d/04d0eb775f943e138ec10566878d487e8a42f04e.png)
The open question is whether this inclusion is strict: Is P = NP, or is P

2. NP-Complete Problems: The Hardest Problems in NP
A subset of NP problems, called NP-complete problems, are the "hardest" problems in NP. If any NP-complete problem can be solved in polynomial time, then P = NP.
To formally define NP-complete problems:
A problem

(it is in NP, meaning solutions can be verified in polynomial time).
- Every other problem in NP can be reduced to
in polynomial time (this means if you can solve
efficiently, you can solve all NP problems efficiently).
The first NP-complete problem, Boolean satisfiability (SAT), was proved by Stephen Cook in 1971 through the famous Cook-Levin theorem. Since then, thousands of problems have been shown to be NP-complete.
Examples of NP-complete problems:
- SAT (Boolean Satisfiability Problem).
- Traveling Salesman Problem (decision version).
- 3-Colorability (can a graph be colored with 3 colors?).
- Subset Sum Problem (is there a subset of numbers that sums to a target value?).
3. Implications of P = NP or P ≠ NP
The resolution of the P vs. NP problem would have enormous implications across mathematics, computer science, cryptography, and more.
If P = NP:
- Every problem for which a solution can be verified quickly can also be solved quickly.
- Many currently hard problems (such as breaking cryptographic codes) would become easy.
- Modern encryption methods based on the hardness of NP problems (like RSA) would become insecure.
- Solutions to many practical optimization problems would become feasible in real time.
If P ≠ NP:
- There exist problems in NP that are inherently hard to solve, even though their solutions can be verified efficiently.
- Cryptographic systems would remain secure.
- Certain problems (such as protein folding, perfect route planning) will likely remain computationally infeasible to solve exactly.
4. Attempts to Solve the P vs. NP Problem
Despite extensive efforts, no one has been able to prove or disprove whether P = NP. Some major developments include:
- Cook-Levin Theorem (1971): Stephen Cook and independently Leonid Levin proved that SAT is NP-complete, introducing the entire field of NP-completeness.
- Karp’s 21 Problems (1972): Richard Karp showed that 21 classical problems (including TSP and graph coloring) are NP-complete.
- Cryptographic Evidence: Many encryption systems rely on the assumption that P ≠ NP, though this is not a proof.
- Relativization (Baker, Gill, and Solovay – 1975): Certain techniques (oracle machines) cannot resolve P vs. NP, suggesting new methods are needed.
5. Theoretical and Practical Consequences
If P = NP, it would revolutionize fields such as:
- Cryptography: Encryption systems would collapse, making secure communication impossible.
- Artificial Intelligence: Efficient solutions to complex problems like natural language understanding and protein folding would become possible.
- Optimization: Problems like airline scheduling and supply chain management would become trivial to solve.
If P ≠ NP, it would confirm the inherent hardness of many problems and validate the foundation of computational security.
6. Summary
- P vs. NP asks whether every problem whose solution can be verified in polynomial time can also be solved in polynomial time.
- If P = NP, many hard problems would become easy to solve, impacting encryption and optimization.
- If P ≠ NP, some problems remain inherently difficult to solve efficiently.
- The P vs. NP problem remains unsolved and is one of the most important open questions in computer science and mathematics.
7. References
- Clay Mathematics Institute: P vs NP Problem
- Arora, S., & Barak, B. Computational Complexity: A Modern Approach.
- Garey, M. R., & Johnson, D. S. Computers and Intractability: A Guide to the Theory of NP-Completeness.
- Wikipedia: P vs NP Problem
- AoPS: P vs NP Problem