NP-Completeness

Context: FIT2014_MOC · the hardest languages in — [[Polynomial-Time Reductions|]] finally used to name a summit rather than compare two problems, collapsing the whole -vs- question onto any single one of them

Quick Revision

  • 🎯 Objective: is NP-complete iff (a) and (b) ➔ so a polynomial-time decider for one NP-complete language would give one for every language in .
  • 📦 Core Components: condition (a) membership ➔ a verifier | condition (b) hardness ➔ universal reducibility | the master theorem has a poly decider .
  • ⚡ Key Constraint: (b) alone is not NP-completeness. A language everything reduces to but which sits outside (e.g. an undecidable one) is NP-hard, not NP-complete — both conditions are marked separately.

📝 How It Works

1. The definition, and the two ways to fail it

Definition. A language is NP-complete if (a) , and (b) every language in is polynomial-time reducible to : .

  • (a) fails lies outside . It does not matter that everything in reduces to it — such an is only NP-hard, and cannot be the summit of because it is not in the set.
  • (b) fails but some has . is then a member, not a maximum — every language in is like this (given ).
  • Quantifier discipline ➔ (b) ranges over all of , an infinite set. That is why establishing the first NP-complete language (Cook-Levin Theorem) is hard and every one after it is one reduction away.

2. Why one language decides the whole question

  • The collapse ➔ condition (b) makes a universal solver: an efficient algorithm for is, via the reduction, an efficient algorithm for everything in .
  • Consequence for practice ➔ proving your problem NP-complete is proving it at least as hard as SATISFIABILITY, HAMILTONIAN CIRCUIT, and 3-COLOURABILITY simultaneously — which is why nobody expects you to then find a fast exact algorithm.
  • What it does not settle ➔ NP-completeness is a statement about ‘s position, not its difficulty in absolute terms. Whether that position is inside is the open question itself.

3. The landscape — two possible worlds

RegionIf If
In 2-SAT, EULERIAN CIRCUIT, 2-COLOURABILITY, CONNECTED GRAPHS, SHORTEST PATH, PRIMES, invertible matrices, all regular and all context-free languageseverything below, merged
NP-completeSATISFIABILITY, 3-SAT, HAMILTONIAN CIRCUIT, 3-COLOURABILITY, VERTEX COVER, INDEPENDENT SETthe whole picture is one blob
In , in neitherGRAPH ISOMORPHISM, INTEGER FACTORISATION — not known in , not known NP-completeregion vanishes
  • Instance stock ➔ the named problems and their certificates are catalogued in Standard NP Problems and Certificates; this table only places them.
  • The picture is degenerate ➔ under the three regions cannot be distinguished, which is itself the revision exercise the slides pose (see Active Recall).

4. co-NP and the remaining open questions

  • co-NP ➔ the complements of languages; co-NPC the complements of the NP-complete ones. sits inside .
  • Second open questiondoes ? Open, and the lecture’s remark is that in practice there does not seem to be much difference.
  • Standing assumption for the picture ➔ the two-lobe diagram is drawn under and ; neither is proved.

5. Living with NP-completeness

Proving a language NP-complete does not make it go away — you may still need to ship an algorithm for it. NP-completeness is evidence that no single algorithm is efficient, deterministic, all-cases, and exact at once. So drop exactly one of the four:

DropWhat you buildWhat you give up
efficientexponential-time exact algorithmspeed
deterministicrandomised algorithma guaranteed run
all casesalgorithm for a special casegenerality
exactapproximation algorithmoptimality
  • Not a fifth option ➔ the slides raise quantum computers only as a maybe in future, not as a known escape.

🧮 Proof Blueprint — the master theorem

Theorem. Let be any NP-complete language. There is a polynomial-time decider for if and only if .

Strategyeach direction uses exactly one half of the definition — () uses membership (a), () uses hardness (b) plus the [[Polynomial-Time Reductions| transfer theorem]]. Naming which half you are spending is the marked move.

⚠️ Common Mistakes

  • 💡 Proving only hardness ➔ (b) without (a) is NP-hard. The HALTING PROBLEM is NP-hard and undecidable; calling it NP-complete is a straight error.
  • 💡 Reducing in the wrong direction ➔ NP-completeness of needs for arbitrary — reducing to a known-hard problem shows is easy enough, which is the opposite claim.
  • 💡 Saying “NP-complete means no algorithm exists” ➔ every NP-complete language is decidable (it is in ). What is doubted is a polynomial-time algorithm, and even that is conditional on .
  • 💡 Writing “NP” for “not polynomial” is nondeterministic polynomial; , so every easy language is in too.
  • 💡 Treating the two-lobe diagram as fact ➔ it depicts the conjectured world . State the assumption when you draw it.

🧠 Active Recall