AI engineering glossary · Data structures algorithms
What is NP-complete?
NP-complete (also called NP-hard): A class of decision problems that are both checkable in polynomial time and at least as hard as every other problem in that class, so a fast solution to one would give a fast solution to all. Recognising one signals that exact fast algorithms are unlikely.
NP-complete: an example
Deciding whether a set of items fits the knapsack for a target value is NP-complete, so large exact instances may need heuristics.
Related terms
More Data structures algorithms terms
- Open addressing
- Optimal substructure
- Overlapping subproblems
- P versus NP
- Polynomial time
- Prefix sum
- Prim's algorithm
- Priority queue
Where you learn it
NP-complete is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.