Study Atlas › Computer Science › Complexity theory

P versus NP

Can every problem whose answer is quick to check also be solved quickly?

Edited by Alex C, EduAlx · Sources cited below

Explanation

P is the class of problems solvable in polynomial time; NP is the class whose solutions can be verified in polynomial time. Cook (1971) and Levin showed SAT is NP-complete; Karp (1972) listed 21 NP-complete problems. It is one of the Clay Millennium Prize Problems ($1 million).

Example

Travelling salesman (decision version), Sudoku generalised and graph colouring are NP-complete.

How it works, step by step

  1. Show the problem is in NP (verifiable)
  2. Pick a known NP-complete problem
  3. Reduce it to your problem in polynomial time
  4. Conclude your problem is NP-complete

Open the interactive page with diagrams →

People behind it

References

  1. S. A. Cook, Proc. 3rd ACM STOC 1971, 151–158.
  2. R. M. Karp, in Complexity of Computer Computations, Plenum, 1972, 85–103.

Textbooks

Related topics

Boolean logic and digital circuitsTuring machines and computabilityVon Neumann architectureDynamic programmingOperating systems: processes, scheduling and memoryGraph algorithms: BFS, DFS and Dijkstra's shortest pathConcurrency: deadlock and synchronisationTrees and binary search treesRelational databases and SQLHash tables