Math 2.0

Computer science Definition

NP-completeness

Builds on NPNP-hardnessPolynomial-time reductionFormal languageP

Definition

Let Σ\Sigma be a finite alphabet, and let C⊆Σ∗C \subseteq \Sigma^* be a language. The language CC is NP-complete when both conditions hold.

  1. CC lies in the class NP.
  2. CC is NP-hard, that is, A≤pCA \le_p C for every A∈NPA \in \mathrm{NP}, where ≤p\le_p is polynomial-time reducibility.

Remarks

Example: the satisfiability problem SAT for propositional formulas is NP-complete, by the Cook–Levin theorem. It lies in NP, since a satisfying assignment is a certificate that can be checked in polynomial time.

Non-example: the halting problem is NP-hard but not NP-complete. It fails clause 1, since it is undecidable and every language in NP is decidable.

To show that a language CC in NP is NP-complete, it is enough to give B≤pCB \le_p C for one known NP-complete BB, since ≤p\le_p is transitive. If some NP-complete language lies in P, then P=NP\mathrm{P} = \mathrm{NP}.

Reading path

To understand this page from the ground up, read these 6 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Formal language concept
  2. NP concept
  3. NP-hardness concept
  4. P concept
  5. Polynomial-time reduction concept
  6. NP-completeness definition

Further reading

  1. Web https://en.wikipedia.org/wiki/NP-completeness
About this page
TagREKDJ8V504
URIm2://REKDJ8V504
Kinddefinition
WritingW0 stub
MSC68Q17, 68Q15
DefinesNP-completeness
UsesNP, NP-hardness, Polynomial-time reduction, Formal language, P
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.