NP Completeness
NP Completeness
Introduction
Co-NP
Class of problems where the complement of a problem in NP is also verifiable in
polynomial time.
Example: Validating that no Hamiltonian cycle exists in a graph.
NP-Complete
A problem is NP-Complete if:
1. It is in NP.
2. It is NP-Hard.
Intuitively, these problems are the hardest in NP, and solving one NP-Complete
problem efficiently would solve all NP problems efficiently.
Reductions
To prove a problem is NP-Complete, reductions are used:
Polynomial-Time Reduction: Transforming one problem into another in
polynomial time.
If A reduces to B, and B is solvable in polynomial time, then A is also solvable in
polynomial time.
The idea is that solving B efficiently implies A can also be solved efficiently.
Cook-Levin Theorem
The first NP-Complete problem, Boolean Satisfiability Problem (SAT), was
proved by Stephen Cook in 1971 and independently by Leonid Levin.
Cook-Levin Theorem: SAT is NP-Complete.
This theorem laid the foundation for identifying other NP-Complete problems.
Proving NP-Completeness
Steps to Prove a Problem is NP-Complete
Show the Problem is in NP:
Demonstrate that a solution can be verified in polynomial time.
Show the Problem is NP-Hard:
Use a known NP-Complete problem and reduce it to the problem in question in
polynomial time.
Example: Proving 3-SAT is NP-Complete
Step 1: 3-SAT is in NP because given a truth assignment, verifying the formula's
truth takes polynomial time.
Step 2: Reduce SAT (known NP-Complete) to 3-SAT in polynomial time.
P NP
vs.
If P=NP, every NP problem would have an efficient solution, with profound
implications for cryptography, optimization, and beyond.
Practical Implications
Many problems in NP have no known polynomial-time algorithms but also no
proofs of intractability.