Cook–Levin theorem (SAT is NP-complete) seed hai: yeh dikhata hai ki har NP problem SAT mein reduce hoti hai, seedha Turing-machine definition se. Uske baad, baaki saari problems ki hardness prove hoti hai pehle se proven NP-complete problem se reduce karke. Classic chain:
SAT≤p3-SAT≤pClique≤pVertex Cover≤pHamiltonian Cycle≤pTSP3-SAT≤pSubset Sum
Nondeterministic Polynomial — ek certificate ko verify kiya ja sake polynomial time mein.
NP-complete define karo.
Ek problem jo NP mein bhi ho aur NP-hard bhi ho (har NP problem poly time mein isme reduce ho).
Problem B ko NP-hard prove karne ke liye reduction kis direction mein hogi?
Ek known NP-complete problem A ko B mein reduce karo: A≤pB.
A≤pB kya guarantee karta hai?
x∈A⟺f(x)∈B jahan f poly-time ho; B ka fast solver A ka bhi fast solver deta hai.
Kaunse theorem ne pehla NP-complete problem establish kiya?
Cook–Levin theorem (SAT is NP-complete).
Independent Set aur Vertex Cover ka relation?
I size k ka independent set ⟺V∖I size n−k ka vertex cover hai.
Clique vs Independent Set ka link?
G mein Clique ⟺ complement graph Gˉ mein Independent Set.
3-SAT→Clique mein do literal-vertices ke beech edge kab hoti hai?
Alag clauses mein hon AUR ek doosre ke negations na hon; clique size k=m.
Subset Sum ka O(nt) DP poly-time algorithm kyun nahi hai?
t ke logt bits hain, isliye t input length mein exponential ho sakta hai → pseudo-polynomial hai.
HamCycle→TSP mein kaunse edge weights aur budget use hote hain?
Weight 1 real edges ke liye, 2 baaki ke liye; budget B=∣V∣ (ek tour ek cycle hai jisme ∣V∣ edges hain).
TSP budget ∣V∣ kyun hai na ki ∣V∣−1?
TSP tour ek cycle hai jo start par waapas aata hai, isliye ∣V∣ edges hain, na ki path jaise ∣V∣−1.
Kya NP-complete aur undecidable same hai?
Nahi — NP-complete problems decidable hain (brute force terminate karta hai); bas (likely) poly-time mein nahi.
TSP ka decision form kya hai?
Weighted complete graph aur budget B diya gaya ho, kya koi tour (cycle) hai jiska total cost ≤B ho?
Recall Feynman: 12-saal ke bacche ko explain karo
Ek bade group ke puzzles imagine karo — Sudoku, mazes, suitcase pack karna. Sab alag dikhte hain, lekin ek secret machine hai jo koi bhi ek puzzle ko doosre mein badal sakti hai. Toh yeh sab really ek hi bada puzzle hain alag-alag disguises mein. Hum inhe jaldi solve karne ka trick nahi jaante, lekin agar tumne ek solve kar liya, toh hum tumhara answer bahut jaldi check kar sakte hain. Aur sabse wild baat: agar kisi ne kabhi sirf ek ka fast trick dhundh liya, toh machine sabka fast trick turant de deti hai. Yeh disguised twins NP-complete kehlaate hain.