Imagine a classroom of homework problems called "NP." A problem is NP-hard if it's a "master key": if you could solve it fast, you could quickly solve every problem in that classroom by first translating them into it. But here's the surprise — the master key might belong to a problem from a totally different, even more impossible room (like "will this computer program ever stop?"). It's a key strong enough to open the NP room, even if it itself lives somewhere harder. So "NP-hard" means at least as tough as the whole NP class, not "a member of it."
A problem L such that every A∈ NP reduces to it in polynomial time (A≤pL for all A∈NP) — at least as hard as all of NP.
NP-complete vs NP-hard?
NP-complete = NP-hard AND in NP; NP-hard alone does not require membership in NP.
Give an NP-hard problem that is NOT in NP.
The Halting Problem (undecidable, hence no poly-time verifier) — or optimization TSP (not a decision problem).
Why can an NP-hard problem fail to be in NP?
NP needs a yes/no decision problem with a poly-time-checkable certificate; NP-hard only demands a hardness lower bound, so optimization/undecidable problems qualify as hard but lack the certificate/type.
To prove a new problem L is NP-hard, what do you do?
Reduce a KNOWN NP-hard problem K to L (K≤pL); by transitivity all of NP reduces to L.
Which reduction direction proves NP-hardness — into or out of L?
INTO L: known-hard ≤pL. Reducing L into something easy proves L is easy, not hard.
State and justify transitivity of ≤p.
If A≤pB and B≤pC then A≤pC, via h=g∘f; poly∘poly is poly and answers are preserved.
If P=NP, do all NP-hard problems become poly-time?
No — only those also in NP (NP-complete). Undecidable NP-hard problems like HALT stay unsolvable.
Why is SAT NP-hard?
Cook–Levin: any NP machine's poly-time accepting computation can be encoded as a Boolean formula satisfiable iff input is accepted, in poly size.
Dekho, NP-hard ka matlab hai: ek problem jo NP class ke har problem se kam se kam utni hi mushkil hai. Formally, agar koi A∈ NP hai, to use polynomial time mein hamari problem L mein convert (reduce) kar sakte hain. Iska seedha matlab — agar L fast solve ho jaye, to poori NP class fast solve ho jaye. Isliye L ek "master key" jaisa hai.
Ab twist yahan hai: NP-hard hone ke liye L ka NP mein hona zaroori nahi. NP mein hone ke liye problem decision (haan/naa) type honi chahiye aur uska ek chhota certificate poly time mein verify hona chahiye. Lekin NP-hard sirf "neeche se bound" deta hai (kam se kam itni hard). Isliye Halting Problem (jo undecidable hai, koi algorithm hi nahi) ya optimization TSP (jo decision problem hi nahi) — ye NP-hard hain par NP ke bahar baithe hain. Yahi line yaad rakho: "harder than NP, may not be in NP."
Proof technique simple hai aur yahi 80/20 hai: naya problem L NP-hard sabit karne ke liye poori NP ko dobara reduce mat karo — bas ek already-known NP-hard problem (jaise 3-SAT) ko L mein reduce karo: K≤pL. Transitivity ki wajah se A≤pK≤pL, to saari NP automatically L mein chali gayi. Direction yaad rakhna: known-hard ko L ke andar daalo, ulta nahi — warna tum galti se L ko easy sabit kar doge.
Yaad rakhne ka mantra: "All complete are hard; not all hard are complete." NP-complete = NP-hard + NP mein. NP-hard akela = difficulty ka floor, jo upar undecidable tak ja sakta hai.