computational complexity
play

Computational Complexity Lecture 2 in which we talk about - PowerPoint PPT Presentation

Computational Complexity Lecture 2 in which we talk about NP-completeness (reductions, reductions) 1 Recap 2 Recap Languages in NP are of the form: 2 Recap Languages in NP are of the form: L= { x | w, |w| < poly(|x|) s.t. (x,w)


  1. CKT-SAT is NP-Complete Reduce any NP language L to CKT-SAT Let’ s start from the TM for verifying membership in L, with time bound T Build a circuit which on input w outputs what the TM outputs on (x,w), within T steps This circuit is an instance of CKT-SAT Ensure reduction is poly-time 10

  2. TM to Circuit (x,w) 11

  3. TM to Circuit (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head 11

  4. TM to Circuit (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head 11

  5. TM to Circuit (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level 11

  6. TM to Circuit (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input 11

  7. TM to Circuit x,q 0 (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input 11

  8. TM to Circuit x,q 0 w (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input 11

  9. TM to Circuit x,q 0 w (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input T configurations, T bundles each 11

  10. TM to Circuit x,q 0 w (x,w) Wires for configurations: a bundle for each tape cell, encoding (content,state), where state is encoded in the cell with the head Circuitry for evolution: each bundle depends (as specified by the TM) on 3 neighboring bundles at the previous level (Part of) initial configuration, namely w, to be plugged in as input T configurations, T bundles each Circuit size = O(T 2 ) 11

  11. TM to Circuit x,q 0 w (x,w) 12

  12. TM to Circuit x,q 0 w (x,w) Reducing any NP language L to CKT-SAT 12

  13. TM to Circuit x,q 0 w (x,w) Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w outputs what the TM outputs on (x,w) within T steps 12

  14. TM to Circuit x,q 0 w (x,w) Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w outputs what the TM outputs on (x,w) within T steps Poly-time reduction 12

  15. TM to Circuit x,q 0 w (x,w) Reducing any NP language L to CKT-SAT TM for verifying membership in L, time-bound T, and input x " A circuit which on input w outputs what the TM outputs on (x,w) within T steps Poly-time reduction CKT-SAT is NP-complete 12

  16. Other NP-complete problems 13

  17. Other NP-complete problems SAT and 3SAT 13

  18. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 13

  19. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals 13

  20. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER 13

  21. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known 13

  22. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known Shown using already known ones: 13

  23. Other NP-complete problems SAT and 3SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3SAT: Each clause has at most 3 literals CLIQUE, INDEP-SET, VERTEX-COVER Hundreds (thousands?) more known Shown using already known ones: If L ! p L 1 and L 1 ! p L 2 , then L ! p L 2 13

  24. CKT-SAT # p SAT 14

  25. CKT-SAT # p SAT Converting a circuit to a collection of clauses: 14

  26. CKT-SAT # p SAT Converting a circuit to a collection of clauses: For each wire (connected component), add a variable 14

  27. CKT-SAT # p SAT Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate: 14

  28. CKT-SAT # p SAT Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate: x z e.g. : (z ⇒ x), (z ⇒ y), (¬z ⇒ ¬x ∨ ¬y). y AND i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y). 14

  29. CKT-SAT # p SAT Converting a circuit to a collection of clauses: For each wire (connected component), add a variable For each gate, add a clause involving variables for wires connected to the gate: x z e.g. : (z ⇒ x), (z ⇒ y), (¬z ⇒ ¬x ∨ ¬y). y AND i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y). x and : (z ⇒ x ∨ y), (¬z ⇒ ¬x), (¬z ⇒ ¬y). z y OR 14

  30. SAT # p 3SAT 15

  31. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. 15

  32. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. More directly: 15

  33. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) 15

  34. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT 15

  35. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT 2SAT is in fact in P! [Exercise] 15

  36. SAT # p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ! p 3SAT. More directly: (a ∨ b ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ d ∨ e) " (a ∨ b ∨ x), (¬x ∨ c ∨ y), (¬y ∨ d ∨ e) Reduction needs 3SAT 2SAT is in fact in P! [Exercise] Reduction not parsimonious (can you make it? [Exercise]) 15

  37. 3SAT # p CLIQUE 16

  38. 3SAT # p CLIQUE Clauses " Graph 16

  39. 3SAT # p CLIQUE (x ∨ ¬y ∨ ¬z) Clauses " Graph (w ∨ y) (w ∨ x ∨ ¬z) 16

  40. 3SAT # p CLIQUE (x ∨ ¬y ∨ ¬z) Clauses " Graph vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) (w ∨ x ∨ ¬z) 16

  41. 3SAT # p CLIQUE (x ∨ ¬y ∨ ¬z) Clauses " Graph vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 16

  42. 3SAT # p CLIQUE (x ∨ ¬y ∨ ¬z) Clauses " Graph vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 16

  43. 3SAT # p CLIQUE *000 (x ∨ ¬y ∨ ¬z) *111 *100 Clauses " Graph *010 *101 *110 *001 vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 16

  44. 3SAT # p CLIQUE *000 (x ∨ ¬y ∨ ¬z) *111 *100 Clauses " Graph *010 *101 *110 *001 vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 16

  45. 3SAT # p CLIQUE *000 (x ∨ ¬y ∨ ¬z) *111 *100 Clauses " Graph *010 *101 *110 *001 vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* 00*0 (w ∨ x ∨ ¬z) 10*0 11*1 01*1 01*0 10*1 11*0 16

  46. 3SAT # p CLIQUE *000 (x ∨ ¬y ∨ ¬z) *111 *100 Clauses " Graph *010 *101 *110 *001 vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* edges between consistent assignments 00*0 (w ∨ x ∨ ¬z) 10*0 11*1 01*1 01*0 10*1 11*0 16

  47. 3SAT # p CLIQUE *000 (x ∨ ¬y ∨ ¬z) *111 *100 Clauses " Graph *010 *101 *110 *001 vertices: each clause’ s (w ∨ y) satisfying assignments (for its variables) 1*0* 1*1* 0*1* edges between consistent assignments 00*0 (w ∨ x ∨ ¬z) 10*0 11*1 01*1 01*0 10*1 11*0 16

Recommend


More recommend