NP-Complete ‣ Co-NP ‣ NP-Hard

NP-Complete ‣ Co-NP ‣ NP-Hard

8. INTRACTABILITY II ‣ P vs. NP ‣ NP-complete ‣ co-NP ‣ NP-hard Lecture slides by Kevin Wayne Copyright © 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated on 5/5/18 5:20 AM Recap 3-SAT -SET poly-time reduces AT NDEPENDENT 3-S to I INDEPENDENT-SET DIR-HAM-CYCLE 3-COLOR SUBSET-SUM VERTEX-COVER HAM-CYCLE KNAPSACK SET-COVER 3-SAT poly-time reduces to all of these problems (and many, many more) 2 8. INTRACTABILITY II ‣ P vs. NP ‣ NP-complete ‣ co-NP ‣ NP-hard SECTION 8.3 P Decision problem. ・Problem X is a set of strings. Instance s is one string. ・ s X ・Algorithm A solves problem X : A(s)= ∈ s/X <latexit sha1_base64="upTjyVAoW+HGac/ZqQnsZjJdMk8=">AAACpnicbZFfa9swFMVlt1uz7F/aPe5FNN3IXoI9Ci2UQste9jRaWJpAFDJZvk5FZclI1yXBzQft6z7J5MQPTbILNoffPbpXPk4KJR1G0XMQ7u2/en3QetN+++79h4+dw6M7Z0orYCCMMnaUcAdKahigRAWjwgLPEwXD5OFH3R8+gnXS6N+4KGCS85mWmRQcPZp2nq577htlF/SyfrVZAjOpK+EnumXbE4Ywx4pBThee0K8NkBk9cZRJTUcnS8rYplWbHac2uDa3Gei0WTDtdKN+tCq6K+JGdElTN9PD4IilRpQ5aBSKOzeOowInFbcohQI/vHRQcPHAZzD2UvMc3KRaxbSkXzxJaWasfzTSFX15ouK5c4s88c6c473b7tXwf71xidn5pJK6KBG0WC/KSkXR0DpzmkoLAtXCCy6s9Hel4p5bLtD/mY0tq9kFiI0vqeallsKksEUVztHyOsV4O7Ndcfe9H0f9+Pa0e3Xe5Nkin8kx6ZGYnJEr8pPckAER5G/QCnzOYS/8FQ7C4doaBs2ZT2Sjwj//ACprzcM=</latexit> ∈ Def. Algorithm A runs in polynomial time if for every string s, A(s) terminates in ≤ p( ⎢s⎢) “steps,” where p(⋅) is some polynomial function. length of s Def. P = set of decision problems for which there exists a poly-time algorithm. problem PRIMES: { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, … } instance s: 592335744548702854681 algorithm: Agrawal–Kayal–Saxena (2002) 4 Some problems in P P. Decision problems for which there exists a poly-time algorithm. poly-time problem description yes no algorithm grade-school MULTIPLE Is a multiple of ? 51, 17 51, 16 x y division REL-PRIME Are x and y relatively prime ? Euclid’s algorithm 34, 39 34, 51 Agrawal–Kayal– PRIMES Is prime ? 53 51 x Saxena Is the edit distance between niether acgggt EDIT-DISTANCE Needleman–Wunsch x and y less than 5 ? neither ttttta # 0 1 1& # 4& " 1 0 0% "1 % Is there a vector x that Gauss–Edmonds % ( % ( $ ' $ ' L-SOLVE 2 4 −2 , 2 1 1 1 , 1 satisfies ? elimination % ( % ( $ ' $ ' Ax = b $% 0 3 15'( $% 36'( #$0 1 1&' #$1 &' Is an undirected graph U-CONN depth-first search€ € G connected? 5 NP Def. Algorithm C(s, t) is a certifier for problem X if for every string s : s ∈ X iff there exists a string t such that C(s, t) = yes. Def. NP = set of decision problems for which there exists a poly-time certifier. ・C(s, t) is a poly-time algorithm. ・Certificate t is of polynomial size: ⎢t⎢ ≤ p(⎢s⎢) for some polynomial p(⋅). “certificate” or “witness” problem COMPOSITES: { 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, …. } instance s: 437669 certificate t: 541 437,669 = 541 × 809 certifier C(s, t): grade-school division 6 Certifiers and certificates: satisfiability SAT. Given a CNF formula Φ, does it have a satisfying truth assignment? 3-SAT. SAT where each clause contains exactly 3 literals. Certificate. An assignment of truth values to the Boolean variables. Certifier. Check that each clause in Φ has at least one true literal. instance s x x x x x x x x x Φ = ( 1 ∨ 2 ∨ 3) ∧ ( 1 ∨ 2 ∨ 3) ∧ ( 1 ∨ 2 ∨ 4 ) certificate t x1 = true, x2 = true, x3 = false, x4 = false € Conclusions. SAT ∈ NP, 3-SAT ∈ NP. 7 Certifiers and certificates: Hamilton path HAMILTON-PATH. Given an undirected graph G = (V, E), does there exist a simple path P that visits every node? Certificate. A permutation π of the n nodes. Certifier. Check that π contains each node in V exactly once, and that G contains an edge between each pair of adjacent nodes. instance s certificate t Conclusion. HAMILTON-PATH ∈ NP. 8 Some problems in NP NP. Decision problems for which there exists a poly-time certifier. poly-time problem description yes no algorithm # 0 1 1& # 4& " 1 0 0% "1 % Is there a vector x Gauss–Edmonds % ( % ( $ ' $ ' L-SOLVE 2 4 −2 , 2 1 1 1 , 1 elimination % ( % ( $ ' $ ' that satisfies Ax = b ? $% 0 3 15'( $% 36'( #$0 1 1&' #$1 &' Agrawal–Kayal–€ € COMPOSITES 51 53 Is x composite ? Saxena Does x have a nontrivial factor FACTOR (56159, 50) (55687, 50) less than y ? Given a CNF formula, does it have ¬ x1 ∨ ¬ x2 ∨ ¬ x3 ¬ x1 ∨ ¬ x2 SAT ¬ x1 ∨ ¬ x2 ∨ ¬ x3 ¬ x1 ∨ ¬ x2 a satisfying truth assignment? ¬ x1 ∨ ¬ x2 ∨ ¬ x3 ¬ x1 ∨ ¬ x2 HAMILTON- Is there a simple path between PATH u and v that visits every node? 9 Intractability: quiz 1 Which of the following graph problems are known to be in NP? A. Is the length of the longest simple path ≤ k ? B. Is the length of the longest simple path ≥ k ? C. Is the length of the longest simple path = k ? D. Find the length of the longest simple path. E. All of the above. 10 Intractability: quiz 2 In complexity theory, the abbreviation NP stands for… A. Nope. B. No problem. C. Not polynomial time. D. Not polynomial space. E. Nondeterministic polynomial time. 11 Significance of NP NP. Decision problems for which there exists a poly-time certifier. “ NP captures vast domains of computational, scientific, and mathematical endeavors, and seems to roughly delimit what mathematicians and scientists have been aspiring to compute feasibly. ” — Christos Papadimitriou “ In an ideal world it would be renamed P vs VP. ” — Clyde Kruskal 12 P, NP, and EXP P. Decision problems for which there exists a poly-time algorithm. NP. Decision problems for which there exists a poly-time certifier. EXP. Decision problems for which there exists an exponential-time algorithm. Proposition. P ⊆ NP. Pf. Consider any problem X ∈ P. ・By definition, there exists a poly-time algorithm A(s) that solves X. ・Certificate t = ε, certifier C(s, t) = A(s). ▪ Proposition. NP ⊆ EXP. Pf. Consider any problem X ∈ NP. ・By definition, there exists a poly-time certifier C(s, t) for X, where certificate t satisfies ⎢t⎢ ≤ p(⎢s⎢) for some polynomial p(⋅). ・To solve instance s, run C(s, t) on all strings t with ⎢t⎢ ≤ p(⎢s⎢). ・Return yes iff C(s, t) returns yes for any of these potential certificates. ▪ Fact. P ≠ EXP ⇒ either P ≠ NP, or NP ≠ EXP, or both. 13 The main question: P vs. NP Q. How to solve an instance of 3-SAT with n variables? A. Exhaustive search: try all 2n truth assignments. Q. Can we do anything substantially more clever? Conjecture. No poly-time algorithm for 3-SAT. “intractable” 14 The main question: P vs. NP Does P = NP? [Cook 1971, Edmonds, Levin, Yablonski, Gödel] Is the decision problem as easy as the certification problem? EXP EXP NP P = NP P If P = NP If P ≠ NP If yes… Efficient algorithms for 3-SAT, TSP, VERTEX-COVER, FACTOR, … If no… No efficient algorithms possible for 3-SAT, TSP, VERTEX-COVER, … Consensus opinion. Probably no. 15 Reductions: quiz 3 Suppose P ≠ NP. Which of the following are still possible? A. O(n3) algorithm for factoring n-bit integers. B. O(1.657 n) time algorithm for HAMILTON-CYCLE. C. O(nlog log log n) algorithm for 3-SAT. D. All of the above. 16 Intractability: quiz 4 Does P = NP? A. Yes. B. No. C. None of the above. 17 8. INTRACTABILITY II ‣ P vs. NP ‣ NP-complete ‣ co-NP ‣ NP-hard SECTION 8.4 NP-complete NP-complete. A problem Y ∈ NP with the property that for every problem X ∈ NP, X ≤ P Y. Proposition. Suppose Y ∈ NP-complete. Then, Y ∈ P iff P = NP. Pf. ⇐ If P = NP, then Y ∈ P because Y ∈ NP. Pf. ⇒ Suppose Y ∈ P. ・Consider any problem X ∈ NP. Since X ≤ P Y, we have X ∈ P. ・This implies NP ⊆ P. ・We already know P ⊆ NP. Thus P = NP. ▪ Fundamental question. Are there any “natural” NP-complete problems? 28 The “first” NP-complete problem Theorem. [Cook 1971, Levin 1973] SAT ∈ NP-complete. The Complexity of Theorem-Proving Procedures IX 1973 . 3 Stephen A. Cook University of Toronto Summary certain recursive set of strings on this alphabet, and we are interested It is shown that any recognition in the problem of finding a good 519.14 problem solved by a polynomial time- lower bound on its possible recog- bounded nondeterministic Turing nition times. We provide no such machine can be "reduced" to the pro- lower bound here, but theorem 1 will » . blem of determining whether a given give evidence that {tautologies} is propositional formula is a tautology. a difficult set to recognize, since « » , Here "reduced" means, roughly speak- many apparently difficult problems , - ing, that the first problem can be can be reduced to determining tau- . solved deterministically in polyno- tologyhood. By reduced we mean, mial time provided an oracle is roughly speaking, that if tauto- - available for solving the second. logyhood could be decided instantly ( , - From this notion of reducible, (by an "oracle") then these problems , , polynomial degrees of difficulty are could be decided in polynomial time. ). - defined, and it is shown that the In order to make this notion precise, . problem of determining tautologyhood we introduce query machines, which - , - has the same polynomial degree as the are like Turing machines with oracles . - : , , problem of determining whether the in [I]. first of two given graphs is iso- , . - morphic to a subgraph of the second. A query machine is a multitape , Other examples are discussed. A Turing machine with a distinguished . - method of measuring the complexity of tape called the query tape, and ( 1,2]), - proof procedures for the predicate three distinguished states called . ( , , calculus is introduced and discussed. the query state, yes state, and n._o_ , .) state, respectively. If M is a , - ( - Throughout this paper, a set of query machine and T is a set of ) , strings means a set of strings on strings, then a T-computation of M ( ) , , - some fixed, large, finite alphabet Z.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    59 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