Computational Complexity

Computational Complexity

Computational Complexity Lecture 3 in which we come across Diagonalization and Time-hierarchies (But first some more of NP-completeness) 1 NP-Complete Languages 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) Trivial example: L1 = TMSAT 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) Trivial example: L1 = TMSAT First interesting example: L1 = CKT-SAT 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) Trivial example: L1 = TMSAT First interesting example: L1 = CKT-SAT Convert x into a circuit C s.t. C is satisfiable iff x in L 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) Trivial example: L1 = TMSAT First interesting example: L1 = CKT-SAT Convert x into a circuit C s.t. C is satisfiable iff x in L More examples, bootstrapping from CKT-SAT 2 NP-Complete Languages A language L1 is NP-complete if L1 is in NP and any NP language L can be reduced to L1 (Karp reduction: polynomial time many-one reduction) Trivial example: L1 = TMSAT First interesting example: L1 = CKT-SAT Convert x into a circuit C s.t. C is satisfiable iff x in L More examples, bootstrapping from CKT-SAT If L ≤p L1 and L1 ≤p L2, then L ≤p L2 2 CKT-SAT ≤p SAT 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) Converting a circuit to a collection of clauses: 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) Converting a circuit to a collection of clauses: For each wire (connected component), add a variable 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) Converting a circuit to a collection of clauses: For each wire (connected component), add a variable Add output variable as a clause. And for each gate, add a clause involving variables for wires connected to the gate: 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) Converting a circuit to a collection of clauses: For each wire (connected component), add a variable Add output variable as a clause. And for each gate, add a clause involving variables for wires connected to the gate: x AND ⇒ ⇒ ⇒ ∨ e.g. y z : (z x), (z y), (¬z ¬x ¬y). i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y). 3 CKT-SAT ≤p SAT SAT: Are all given “clauses” simultaneously satisfiable? (Conjunctive Normal Form) Converting a circuit to a collection of clauses: For each wire (connected component), add a variable Add output variable as a clause. And for each gate, add a clause involving variables for wires connected to the gate: x AND ⇒ ⇒ ⇒ ∨ e.g. y z : (z x), (z y), (¬z ¬x ¬y). i.e., (¬z ∨ x), (¬z ∨ y), (z ∨ ¬x ∨ ¬y). x and y OR z : (z⇒x ∨ y), (¬z⇒¬x), (¬z⇒¬y). 3 SAT ≤p 3SAT 4 SAT ≤p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ≤p 3SAT. 4 SAT ≤p 3SAT Previous reduction was to 3SAT, so 3SAT is NP-complete. And SAT is in NP. So SAT ≤p 3SAT. More directly: 4 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) 4 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 4 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] 4 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]) 4 3SAT ≤p CLIQUE 5 3SAT ≤p CLIQUE CLIQUE: Does graph G have a clique of size m? 5 3SAT ≤p CLIQUE CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) have a clique of size m? (w ∨ y) (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) have a clique of size m? Clauses → Graph (w ∨ y) (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) have a clique of size m? Clauses → Graph (w ∨ y) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) have a clique of size m? Clauses → Graph (w ∨ y) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) 1*0* 1*1* 0*1* (w ∨ x ∨ ¬z) 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) 1*0* 1*1* 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* 00*0 (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* edges between 00*0 consistent assignments (w ∨ x ∨ ¬z) 11*1 10*0 01*1 01*0 10*1 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* edges between 00*0 consistent assignments (w ∨ x ∨ ¬z) 11*1 10*0 01*1 m-clique iff all m 01*0 10*1 clauses satisfiable 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* edges between 00*0 consistent assignments (w ∨ x ∨ ¬z) 11*1 10*0 01*1 m-clique iff all m 01*0 10*1 clauses satisfiable 11*0 5 3SAT ≤p CLIQUE *000 CLIQUE: Does graph G (x ∨ ¬y ∨ ¬z) *111 *100 have a clique of size m? *101 *010 *110 *001 Clauses → Graph (w ∨ y) vertices: each clause’s satisfying assignments 1*0* 1*1* (for its variables) 0*1* edges between 00*0 consistent assignments (w ∨ x ∨ ¬z) 11*1 10*0 3-Clique 1*1* 01*1 m-clique iff all m *110 01*0 10*1 clauses satisfiable 11*0 ---- 11*0 sat assignment 1110 5 INDEP-SET and VERTEX-COVER 6 INDEP-SET and VERTEX-COVER CLIQUE ≤p INDEP-SET 6 INDEP-SET and VERTEX-COVER CLIQUE ≤p INDEP-SET G has an m-clique iff Gc has an m-independent-set 6 INDEP-SET and VERTEX-COVER CLIQUE ≤p INDEP-SET G has an m-clique iff Gc has an m-independent-set INDEP-SET ≤p VERTEX-COVER 6 INDEP-SET and VERTEX-COVER CLIQUE ≤p INDEP-SET G has an m-clique iff Gc has an m-independent-set INDEP-SET ≤p VERTEX-COVER G has an m-indep-set iff G has an (n-m)-vertex-cover 6 NP, P, co-NP and NPC NP coNP NPC coNPC P 7 NP, P, co-NP and NPC We say class X is “closed under polynomial reductions” if (L1 ≤p L2 and L2 in class X) implies L1 in X NP coNP NPC coNPC P 7 NP, P, co-NP and NPC We say class X is “closed under polynomial reductions” if (L1 ≤p L2 and L2 in class X) implies L1 in X e.g.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    127 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us