bu cs 332 theory of computation
play

BU CS 332 Theory of Computation Lecture 21: Reading: NP - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 21: Reading: NP Completeness Sipser Ch 7.3 7.5 Cook Levin Theorem Reductions Mark Bun April 15, 2020 Last time: Two equivalent definitions of 1) is the class of languages decidable


  1. BU CS 332 – Theory of Computation Lecture 21: Reading: • NP ‐ Completeness Sipser Ch 7.3 ‐ 7.5 • Cook ‐ Levin Theorem • Reductions Mark Bun April 15, 2020

  2. Last time: Two equivalent definitions of 1) is the class of languages decidable in polynomial time on a nondeterministic TM � � ��� 2) A polynomial ‐ time verifier for a language is a deterministic ‐ time algorithm such that iff there exists a string such that accepts Theorem: A language iff there is a polynomial ‐ time verifier for 4/15/2020 CS332 ‐ Theory of Computation 2

  3. Examples of languages: SAT “Is there an assignment to the variables in a logical formula that make it evaluate to ?” • Boolean variable: Variable that can take on the value / (encoded as 0/1) • Boolean operations: • Boolean formula: Expression made of Boolean variables and operations. Ex: � � � • An assignment of 0s and 1s to the variables satisfies a formula if it makes the formula evaluate to 1 • A formula is satisfiable if there exists an assignment that satisfies it 4/15/2020 CS332 ‐ Theory of Computation 3

  4. Examples of languages: SAT Ex: Satisfiable? � � � Ex: Satisfiable? � � � � � Claim: 4/15/2020 CS332 ‐ Theory of Computation 4

  5. Examples of languages: TSP “Given a list of cities and distances between them, is there a ‘short’ tour of all of the cities?” More precisely: Given • A number of cities � • A function giving the distance between each pair of cities • A distance bound 4/15/2020 CS332 ‐ Theory of Computation 5

  6. vs. Question: Does ? Philosophically: Can every problem with an efficiently verifiable solution also be solved efficiently? A central problem in mathematics and computer science NP EXP EXP P = NP P If P  NP If P = NP 4/15/2020 CS332 ‐ Theory of Computation 6

  7. A world where • Many important decision problems can be solved in polynomial time ( , , , etc.) • Many search problems can be solved in polynomial time (e.g., given a natural number, find a prime factorization) • Many optimization problems can be solved in polynomial time (e.g., find the lowest energy conformation of a protein) 4/15/2020 CS332 ‐ Theory of Computation 7

  8. A world where • Secure cryptography becomes impossible An NP search problem: Given a ciphertext , find a plaintext and encryption key that would encrypt to • AI / machine learning become easy: Identifying a consistent classification rule is an NP search problem • Finding mathematical proofs becomes easy: NP search problem: Given a mathematical statement and length bound , is there a proof of with length at most ? General consensus: 4/15/2020 CS332 ‐ Theory of Computation 8

  9. NP ‐ Completeness 4/15/2020 CS332 ‐ Theory of Computation 9

  10. What about a world where Believe this to be true, but very far from proving it implies that there is a problem in which cannot be solved in polynomial time, but it might not be a useful one Question: What would allow us to conclude about problems we care about? Idea: Identify the “hardest” problems in NP Find such that iff 4/15/2020 CS332 ‐ Theory of Computation 10

  11. Recall: Mapping reducibility Definition: ∗ is computable if there is a TM ∗ A function ∗ , halts with only which, given as input any on its tape. Definition: Language is mapping reducible to language , written � ∗ such that for ∗ if there is a computable function ∗ , we have all strings 4/15/2020 CS332 ‐ Theory of Computation 11

  12. Polynomial ‐ time reducibility Definition: ∗ is polynomial ‐ time computable if there ∗ A function ∗ , is a polynomial ‐ time TM which, given as input any halts with only on its tape. Definition: Language is polynomial ‐ time reducible to language , written � ∗ ∗ if there is a polynomial ‐ time computable function ∗ , we have such that for all strings 4/15/2020 CS332 ‐ Theory of Computation 12

  13. Implications of poly ‐ time reducibility Theorem: If and then � Proof: Let decide in poly time, and let be a poly ‐ time reduction from to . The following TM decides in poly time: 4/15/2020 CS332 ‐ Theory of Computation 13

  14. NP ‐ completeness Definition: A language is NP ‐ complete if 1) and 2) Every language is poly ‐ time reducible to , i.e., (“ is NP ‐ hard”) � 4/15/2020 CS332 ‐ Theory of Computation 14

  15. Implications of NP ‐ completeness Theorem: Suppose is NP ‐ complete. Then iff Proof: 4/15/2020 CS332 ‐ Theory of Computation 15

  16. Implications of NP ‐ completeness Theorem: Suppose is NP ‐ complete. Then iff Consequences of being NP ‐ complete: 1) If you want to show , you just have to show 2) If you want to show , you just have to show 3) If you already believe , then you believe 4/15/2020 CS332 ‐ Theory of Computation 16

  17. Cook ‐ Levin Theorem and NP ‐ Complete Problems 4/15/2020 CS332 ‐ Theory of Computation 17

  18. Cook ‐ Levin Theorem Theorem: (Boolean satisfiability) is NP ‐ complete Proof: Already know . Need to show every problem in reduces to (later?) Stephen A. Cook (1971) Leonid Levin (1973) 4/15/2020 CS332 ‐ Theory of Computation 18

  19. New NP ‐ complete problems from old Lemma: If and , then � � � (poly ‐ time reducibility is transitive) Theorem: If and for some NP ‐ complete � language , then is also NP ‐ complete 4/15/2020 CS332 ‐ Theory of Computation 19

  20. New NP ‐ complete problems from old All problems below are NP ‐ complete and hence poly ‐ time reduce to one another! by definition of NP ‐ completeness SAT 3SAT INDEPENDENT SET DIR-HAM-CYCLE GRAPH 3-COLOR SUBSET-SUM VERTEX COVER HAM-CYCLE PLANAR 3-COLOR SCHEDULING SET COVER TSP 4/15/2020 CS332 ‐ Theory of Computation 20

  21. (3 ‐ CNF Satisfiability) Definition(s): • A literal either a variable of its negation � , � • A clause is a disjunction (OR) of literals Ex. � � � • A 3 ‐ CNF is a conjunction (AND) of clauses where each clause contains exactly 3 literals Ex. … � � � � � � � � � � � � 4/15/2020 CS332 ‐ Theory of Computation 21

  22. is NP ‐ complete Theorem: is NP ‐ complete Proof idea: 1) is in NP (why?) 2) Show that � Idea of reduction: Given a poly ‐ time algorithm converting an arbitrary formula into a 3CNF such that is satisfiable iff is satisfiable 4/15/2020 CS332 ‐ Theory of Computation 22

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend