4.6.27 · D5Theory of Computation

Question bank — NP-hard — harder than NP, may not be in NP

1,675 words8 min readBack to topic

Before we start, one word we lean on everywhere:


True or false — justify

TF1. "NP-hard" and "NP-complete" mean the same thing.
False. NP-complete NP-hard AND in NP; NP-hard drops the membership requirement, so it is a strictly larger family that can even contain undecidable problems.
TF2. Every NP-hard problem is decidable.
False. The Halting Problem is NP-hard yet undecidable; NP-hardness is only a lower bound on difficulty and places no ceiling.
TF3. Every NP-hard problem is a decision (yes/no) problem.
False. Optimization TSP ("output the minimum tour length") is NP-hard but outputs a number, not a bit, so it isn't even the right type to be a language in NP.
TF4. If is NP-hard then NP.
False. That would make it NP-complete. NP-hardness only says everything in NP reduces into ; it says nothing about having a short certificate of its own.
TF5. If is NP-complete then is NP-hard.
True. NP-complete is defined as NP-hard plus membership in NP, so the "hard" half holds by definition — every complete problem is also hard.
TF6. Showing proves is NP-hard.
False, and backwards. That shows is no harder than 3-SAT (essentially that is in NP). To prove hardness you need a known-hard problem reducing into : .
TF7. If , then every NP-hard problem becomes solvable in polynomial time.
False. Only the NP-hard problems that are also in NP (the NP-complete ones) would collapse into P. HALT stays undecidable regardless.
TF8. A problem harder than every NP-complete problem cannot be NP-hard.
False. Being harder than NP-complete problems is exactly what an above-NP problem like HALT does, and it is still NP-hard because all of NP still reduces into it.
TF9. Cook–Levin proves 3-SAT is NP-hard by reducing 3-SAT to every NP problem.
False. Cook–Levin goes the other way: it reduces every NP problem to SAT, so all of NP pours into SAT — that is what makes SAT hard.
TF10. Once one NP-hard problem exists, proving others NP-hard never needs the full Cook–Levin construction again.
True. By transitivity of , reducing one known-hard problem into your new () inherits hardness from the whole class in a single step.

Spot the error

SE1. "To prove Vertex-Cover is NP-hard, I built a poly-time map from Vertex-Cover instances into 3-SAT instances."
Direction is wrong. That places Vertex-Cover inside NP's difficulty; you must map 3-SAT into Vertex-Cover so the known-hard problem's difficulty transfers onto Vertex-Cover.
SE2. "HALT can't be NP-hard because there's no algorithm for it, and hardness proofs need algorithms."
The proof needs a poly-time reduction (a translator), not a solver for HALT. We build a machine that halts iff is satisfiable — building the machine is fast even though running it forever might be needed.
SE3. "Optimization-TSP is NP-complete because its decision version is."
Only the decision version ("tour of length ?") is NP-complete; the optimization version outputs a number and is not a language, so it can be NP-hard but never in NP. See Decision vs Optimization problems.
SE4. "Since and is NP-hard, must also be NP-hard."
Wrong arrow again. means (the hard one) is easier-or-equal, so it says is at least as hard — this is fine only if is the known-hard problem. If you instead had , you'd learn nothing about 's hardness.
SE5. "Every NP-hard problem has a short certificate; we just haven't found an efficient checker."
A certificate requires the problem to be a decision problem with a poly-time verifier. Undecidable NP-hard problems have no verifier at all — no future cleverness produces one.
SE6. "If I reduce 3-SAT to but the reduction takes exponential time, is still NP-hard."
No. The reduction itself must run in polynomial time; an exponential translator lets the translation, not , hide the difficulty, so the argument collapses.
SE7. " and gives , but only if is NP-complete."
Transitivity of holds for any three languages; NP-completeness of is irrelevant. Composing two poly-time reductions gives a poly-time reduction because a polynomial of a polynomial is a polynomial.

Why questions

WHY1. Why does the NP-hard definition use many-one poly-time reductions rather than "just be slower"?
Because we want the problem's difficulty to dominate, not the translation's; polynomial-time glue is cheap enough that if were easy, the whole of NP would be easy too.
WHY2. Why must the reduction go from a known-hard problem into the new one, and not the reverse?
A fast solver for must yield a fast solver for the known-hard problem; that only works if the hard problem's instances translate into 's instances, so the solver for can be reused.
WHY3. Why can an NP-hard problem live "above" NP at all?
The definition only imposes a lower bound ("everything in NP reduces to me"); it never caps the problem, so it may be undecidable or the wrong type (non-decision) and thus outside NP.
WHY4. Why is SAT NP-complete but HALT only NP-hard?
SAT has a short certificate (a satisfying assignment) checkable in poly time, so it's in NP; HALT has no decider whatsoever, so it fails NP membership while still absorbing all of NP's difficulty.
WHY5. Why does transitivity make reduction the "engine" of hardness proofs?
Because automatically gives , a single reduction from one known-hard into inherits the entire class NP without re-doing Cook–Levin.
WHY6. Why isn't "output the minimum tour" in NP even though its decision cousin is?
NP is defined for languages with yes/no answers and checkable certificates; an answer that is a full number has no single-bit outcome to verify, so it is disqualified by type, not by difficulty.
WHY7. Why does leave HALT untouched?
only collapses the class NP onto P; HALT is not in NP (it's undecidable), so nothing in that collapse can reach it. See P vs NP.

Edge cases

EC1. Is the trivial language (or ) NP-hard?
No under standard many-one reductions. A yes-instance of any must map to a yes-instance of ; with there are no yes-instances to hit, so satisfiable formulas have nowhere to go and the reduction breaks.
EC2. If a problem is in P, can it still be NP-hard?
Only if . If some P problem were NP-hard, all of NP would reduce into it and be solvable in poly time, forcing — currently unknown, so we assume no.
EC3. Can a problem be NP-hard yet trivially "easy to answer" for a human, like HALT-for-tiny-programs?
The class HALT as a whole is NP-hard and undecidable; restricting inputs changes the problem. Hardness is a property of the whole language, not of individual convenient instances.
EC4. Is being "harder than NP-complete" a contradiction with being NP-hard?
No — it's exactly the interesting case. HALT is strictly harder (undecidable) than any NP-complete problem yet is still NP-hard, because "hard" is a floor, not a ceiling.
EC5. Can two problems be NP-hard yet not reduce to each other in poly time?
Yes. HALT and 3-SAT are both NP-hard, but 3-SAT (decidable) cannot in general reduce from HALT while staying poly-time-and-decidable-preserving — NP-hardness only guarantees NP reduces into each, not that they inter-reduce.
EC6. If is NP-hard and you find NP, what have you proved?
That is NP-complete — the two halves (hard + in NP) exactly compose into completeness.
EC7. Does an NP-hard optimization problem's decision version being NP-complete "downgrade" the optimization version into NP?
No. The decision version is a different problem that happens to be in NP; the optimization version still outputs a number and remains outside NP by type.
Recall One-line self-test

Name the two independent ways a problem can be NP-hard but not in NP. ::: It can be undecidable (no verifier at all, e.g. HALT), or not a decision problem (no yes/no bit to certify, e.g. optimization TSP).