100 likes | 119 Views
Explore the complexities of NP-complete problems, including comparisons, reductions, and Ladner's Theorem, illustrated with examples like CLIQUE, 3SAT, and Independent Set. Dive into the world of computational cost and polynomial-time reductions in this informative text.
E N D
§5 Structural Complexity: NPc • Comparing Problems: polynomial-time reduction • Reductions: CLIQUEpIS≼pSATp3SAT≼pIS • NP-completeness, Master Reduction • coNP, Ladner's Theorem
Comparing Problems, again CLIQUE = {G,k | Gcontains ak-clique} IS={G,k : Ghask pairwise non-connected vertices} p N N f L' L LC L'C polynomial-time For L,L'N write L≼ L' if exists a computable f: NN such that x: xL f(x)L'. p a) L' decidable so L. a) L'P LP b) L ≼ L' ≼ L'' L≼ L'' p p p
Reduction IS≼pSAT Let G consist of vertices V={1,..,n} and edges E. Consider Boolean variables xv,i, v V, i=1...k and clauses Ki := vVxv,i, i=1...k and xv,i xv,j, v V, 1≤i<j≤k and xu,i xv,j, {u,v}E, 1≤i<j≤k Length of : O(k·n+n·k2+n2k2)=O(n2k2) Computational cost of (G,k) → : polyn. in n+logk Goal: Upon input of (the encoding of) a graph G and kN, produce in polynomial time a CNF formula such that: satisfiable iff G contains ≥k independent vertices There is an i-th vertex Vertex v is #i among the k independent. Vertex v cannot be both #iand #j. No adjacent vertices are independent. since k≤n.
Example Reduction: 4SAT vs. 3SAT 4-SAT: Is formula Φ(Y) in 4-CNF satisfiable? 3-SAT: Is formula Φ(Y) in 3-CNF satisfiable? Given = (abcd) (pqrs) … with literalsa,b,c,d, p,q,r,s,…. Introduce new variablesu,v,… and consider ':=( abu ) (ucd ) (pqv) (vrs ) … variables, possibly negated f: ' For L,L'N write L≼ L' if exists a computable f: NN such that x: xL f(x)L'.
Reduction 3SAT≼pIS = C1C2 … Ck, Ci = xi1xi2xi3, xisliterals V:= { (i,1),…(i,3): i≤k }, E:= { {(i,s),(j,t)} : i=j or xis= xjt } (k,1) (1,1) (k,2) (1,2) (k,3) (1,3) Produce, given a 3-CNF term , within polynomial time a graph G and integer k such that it holds: iff G contains k pairwise non-adjacent vertices. is satisfiable e.g. ( u.... ) ( .. u .. ) ( .. .. u ) ( u .. .. ) Richard Karp
Problems of similar complexity Showed: CLIQUEpIS≼pSATp3SAT≼pIS. These 4 problem have about same complexity: Either all are belong to P, or none of them. We will show: Also TSP, HC, VC and many further problems in NP belong to this class called NPc. And will show: These are ‘hardest‘ problems in NP. Cook–Levin Theorem: L2NP : L≼pSAT. That is, eitherall ornone of the problems in NPc can be decided in polynomial time. A deterministic WHILE+ program could simulate anynon-deterministic one with polynomial slowdown! unknown yet In the first case:
Complexity Class Picture coNP-complete NP- complete EXP PSPACEcomplete Def: ANP is NP-complete if L≼pAholds for every LNP. PSPACE CH Theorem (Cook'72/Levin'71): SATis NP-complete! #P PH Lemma: For A NP-complete and A≼pB NP, B is also NPc. PNP co-NP NP Now know ≈500 natural problems NP-complete… P
coNPc NP =coNP NPc NP coNP P =coP P Scenarios for P≠NP coNP := { LN : N\LNP } unSAT := {Boolean term, x:(x)=0 }coNPc Theorem [Ladner'75]: If P≠NP, there exists LNP \ (PNPc) coNP NP NPcoNP P =coP
Master Reductions SAT= { : Boolean term, y1,…ym:(y1,…ym)=1} Cook/Levin Theorem: SATis NP-complete! Proof (Sketch): Fix LNP and VP. FixWHILE+program Bdeciding Vin timepoly(n). Express "bin(z0,…zk-1)V" as Boolean term "k(z0,…zk-1)=1"of lengthpoly(k). Thenbin(x0,…xn-1)L y0,…ym-1{0,1}: n+k(x, y)=1. N x→ := n+k(bin(x), · ) Thm: The following problem UNP is NP-complete: { A,x,2N : nondetermin. WHILE+ program A accepts input x within at most N steps } L = {xN: y, ℓ(y)≤poly(ℓ(x)), x,yV}, VP
SubsetSum is NP-complete SubsetSumNP√ Show: 3SAT≼p SubsetSum In polyn.time: 3CNF →ANandbN s.t. satisf. assignm. of BA:b=aB a {a1,…aN,b | a1,…aN,bN, 1,…N{0,1} : b=iai·i} Eg. Φ = (x1 x3 x5) (x1 x5 x4) (x2 x2 x5) b := 444 11111 v1' := 010 10000 v2' := 002 01000 v3' := 100 00100 v4' := 000 00010 v5' := 001 00001 v1 := 100 10000 v2 := 000 01000 v3 := 000 00100 v4 := 010 00010 v5 := 110 00001 c1:= 100 00000 d1:= 200 00000 c2:= 010 00000 d2:= 020 00000 c3:= 001 00000 d3:= 002 00000 mclauses in n var.s → 2n+2m+1 values àn+m dec.digits ANP-complete, BNP and A ≼pBBalso NP-complete.