Newsletter Subscribe
Enter your email address below and subscribe to our newsletter
Enter your email address below and subscribe to our newsletter
An NP-hard problem is one that is at least as difficult as the hardest problems in NP. This article explains definitions, examples, and methods for dealing with NP-hard tasks.
An NP-hard problem is a classification in computational complexity theory describing problems that are at least as hard as the hardest problems in NP (nondeterministic polynomial time). NP-hard problems may not themselves be decision problems and might not be solvable in polynomial time. They are considered computationally intractable for large inputs, meaning no known algorithm can solve all NP-hard problems efficiently.
Definition
An NP-hard problem is a problem to which every problem in NP can be reduced in polynomial time, making it at least as difficult as the most complex NP problems, regardless of whether it has a solution verifiable in polynomial time.
| Category | Must be in NP? | Description | Example |
|---|---|---|---|
| NP-hard | No | At least as hard as every NP problem; may not be verifiable in polynomial time | Traveling Salesman (optimization version) |
| NP-complete | Yes | Both in NP and NP-hard | Boolean satisfiability (SAT) |
Because no polynomial-time algorithm is known, practitioners use:
Return near-optimal solutions efficiently.
Systematic search methods for exact solutions.
Useful for smaller instances.
Some NP-hard problems are easier with restricted inputs.
To prove a problem is NP-hard, every NP problem must be reducible to it in polynomial time.
If P = NP were proven true, all NP-hard problems would become solvable efficiently—one of the biggest unsolved problems in mathematics and computer science.
No, they can be solved, but not efficiently for large inputs.
By reducing a known NP-hard problem to it using a polynomial-time reduction.
Many are, but not all. Some are decision or search problems.
The decision version is NP-complete; the optimization version is NP-hard.
Because many real-world optimization tasks map to NP-hard structures.