
Properties of Algorithms A given problem can be solved by many different algorithms. Which NP-Completeness ALGORITHMS will be useful in practice? A working definition: (Jack Edmonds, 1962) ■ Efficient: polynomial time for ALL inputs. ■ Inefficient: "exponential time" for SOME inputs. Robust definition has led to explosion of useful algorithms for wide spectrum of problems. ■ Notable exception: simplex algorithm. Princeton University • COS 423 • Theory of Algorithms • Spring 2001 • Kevin Wayne 2 Exponential Growth Properties of Problems Exponential growth dwarfs technological change. Which PROBLEMS will we be able to solve in practice? ■ Suppose each electron in the universe had power of today’s ■ Those with efficient algorithms. supercomputers. ■ How can I tell if I am trying to solve such a problem? ■ And each works for the life of the universe in an effort to solve TSP ! Theory of NP-completeness helps. problem using N! algorithm. Yes Probably No Unknown Some Numbers Shortest path Longest path Primality Quantity Number Euler cycle Hamiltonian cycle Factoring Home PC instructions / second 109 Min cut Max cut Graph isomorphism Supercomputer instructions / second 1012 † Estimated 2-SAT 3-SAT Seconds per year 109 PLANAR-2-COLOR PLANAR-3-COLOR Age of universe † 1013 PLANAR-4-COLOR PLANAR-3-COLOR Electrons in universe † 1079 Matching 3D-Matching Baseball elimination Soccer elimination ■ Will not succeed for 1,000 city TSP! 1000! >> 101000 >> 1079 × 1013 × 109 × 1012 Bipartite vertex cover Vertex cover 3 4 P Strong Church-Turing Thesis Decision problem X. Definition of P fundamental because of SCT. ■ X is a (possibly infinite) set of binary strings. ■ Instance: finite binary string s, of length |s|. Strong Church-Turing thesis: ⇔ ∈ ■ Algorithm A solves X if A(s) = YES s X. ■ P is the set of decision problems solvable in polynomial time on REAL computers. Polynomial time. ■ Algorithm A runs in polynomial-time if for every instance s, A Evidence supporting thesis: terminates in at most p(s) "steps", where p is some polynomial. ■ True for all physical computers. ■ Can create deterministic TM that efficiently simulates any real Definition of P. general-purpose machine (and vice versa). ■ Set of all decision problems solvable in polynomial time on a deterministic Turing machine. Possible exception? ■ Quantum computers: no conventional gates. Examples: ■ MULTIPLE: Is the integer y a multiple of x? ■ RELPRIME: Are the integers x and y relatively prime? ■ PERFECT-MATCHING: Given graph G, is there a perfect matching? 5 6 Efficient Certification Certifiers and Certificates Certification algorithm. COMPOSITE: Given integer s, is s composite? ■ Design an algorithm that checks whether proposed solution is a YES instance. Observation. s is composite ⇔ there exists an integer 1 < t < s such that s is a multiple of t. Input s: Certificate t: Algorithm C is an efficient certifier for X if: 437,669 541 ■ YES instance: s = 437,669. ■ C is a polynomial-time algorithm that takes two inputs s and t. – certificate t = 541 or 809 (a factor) ■ There exists a polynomial p( ) so that for every string s, s ∈ X ⇔ there exists a string t such that |t| ≤ p(|s|) and C(s, t) = YES. Intuition. Certifier: Is s a multiple of t? ■ Efficient certifier views things from "managerial" viewpoint. ■ It doesn't determine whether s ∈ X on its own. YES NO ■ Rather, it evaluates a proposed proof t that s ∈ X. ■ Accepts if and only if given a "short" proof of this fact. s is a YES instance no conclusion 7 8 Certifiers and Certificates Certifiers and Certificates COMPOSITE: Given integer s, is s composite? CLIQUE: Given an undirected graph, is there a subset S of k nodes such that there is an arc connecting every pair of nodes in S? Observation. s is composite ⇔ there exists an integer 1 < t < s k = 4 Input s: Certificate t: such that s is a multiple of t. Input s: Certificate t: u v 437,677 ??? {u, v, w, x} ■ YES instance: s = 437,669. z w – certificate t = 541 or 809 (a factor) y x ■ NO instance: s = 437,677. Certifier: – no witness can fool verifier Certifier: 1. For all pairs of nodes v and w in t, into saying YES Is s a multiple of t? check that (v, w) is an edge in the graph. 2. Check that number of nodes in t ≤ k. ∈ ■ Conclusion: COMPOSITE NP. YES NO YES NO CLIQUE ∈ NP. s is a YES instance no conclusion s is a YES instance no conclusion 9 10 Certifiers and Certificates NP 3-COLOR: Given planar map, can it be colored with 3 colors? Definition of NP: ■ Does NOT mean "not polynomial." Input s: Certificate t: Definition of NP: ■ Set of all decision problems for which there exists an efficient certifier. ■ Definition important because it links many fundamental problems. Certifier: Claim: P ⊆ NP. 1. Check that s and t describe same map. Proof: Consider problem X ∈ P. 2. Count number of distinct colors in t. ■ Then, there exists efficient algorithm A(s) that solves X. 3. Check all pairs of adjacent states. ■ Efficient certifier B(s, t): return A(s). YES NO 3-COLOR ∈ NP. s is a YES instance no conclusion 11 12 NP The Main Question Definition of EXP: Does P = NP? (Edmonds, 1962) ■ Set of all decision problems solvable in exponential time on a ■ Is the original DECISION problem as easy as CERTIFICATION? deterministic Turing machine. ■ Does nondeterminism help you solve problems faster? Claim: NP ⊆ EXP. Most important open problem in computer science. Proof: Consider problem X ∈ NP. ■ If yes, staggering practical significance. ■ Then, there exists efficient certifier C(s, t) for X. ■ Clay Foundation Millennium $1 million prize. ■ To solve input s, run C(s, t) on all strings t with |t| ≤ p(|s|). ■ Return YES, if C(s, t) returns YES for any of these. Useful alternate definition of NP: EXP NP EXP ■ Set of all decision problems solvable in polynomial time on a NONDETERMINISTIC Turing machine. P = NP P ■ Intuition: act of searching for t is viewed as a non-deterministic search over the space of possible proofs. Nondeterministic TM can try all possible solutions in parallel. If P ≠ NP If P = NP 13 14 The Main Question The Main Question Generator (P) Certifier (NP) Does P = NP? ■ Factor integer s. n Is s a multiple of t? ■ Is the original DECISION problem as easy as CERTIFICATION? ■ Color a map with minimum # colors. n Check if all adjacent regions have different colors. If yes, then: n ■ Design airfoil of minimum drag. Compute drag of airfoil. ■ Efficient algorithms for 3-COLOR, TSP, FACTOR, . n ■ Prove a beautiful theorem. Understand its proof. ■ Cryptography is impossible (except for one-time pads) on ■ Write a beautiful sonnet. n Appreciate it. conventional machines. ■ Devise a good joke. n Laugh at it. ■ Modern banking system will collapse. ■ Vinify fine wine. n Be a wine snob. ■ Harmonial bliss. ■ Orate a good lecture. n Know when you've heard one. ■ Ace an exam. n Verify TA's solutions. If no, then: ■ Can't hope to write efficient algorithm for TSP. ■ But maybe efficient algorithm still exists for FACTOR . Imagine the wealth of a society that produces optimal planes, bridges, rockets, theorems, art, music, wine, jokes. 15 16 The Main Question Polynomial Transformation ≤ Does P = NP? Problem X polynomial reduces (Cook-Turing) to problem Y (X P Y) if arbitrary instances of problem X can be solved using: ■ Is the original DECISION problem as easy as CERTIFICATION? ■ Polynomial number of standard computational steps, plus Probably no, since: ■ Polynomial number of calls to oracle that solves problem Y. ■ Thousands of researchers have spent four frustrating decades in search of polynomial algorithms for many fundamental NP Problem X polynomial transforms (Karp) to problem Y if given any problems without success. input x to X, we can construct an input y such that x is a YES instance of X if and only if y is a YES instance of Y. ■ Consensus opinion: P ≠ NP. ■ We require |y| to be of size polynomial in |x|. But maybe yes, since: Polynomial transformation is polynomial reduction with just one call ■ No success in proving P ≠ NP either. to oracle for Y, exactly at the end of the algorithm for X. Note: all previous reductions were of this form! 17 18 NP-Complete NP-Complete Definition of NP-complete: Definition of NP-complete: ■ A problem Y in NP with the property that for every problem X in NP, ■ A problem Y in NP with the property that for every problem X in NP, X polynomial transforms to Y. X polynomial transforms to Y. ■ "Hardest computational problems" in NP. Significance. ■ Efficient algorithm for any NP-complete problem ⇒ efficient algorithm for every other problem in NP. ■ Links together a huge and diverse number of fundamental EXP NP EXP problems: NP- – TSP, 3-COLOR, CNF-SAT, CLIQUE, . P P = NP complete ■ Can implement any computer program in 3-COLOR. Notorious complexity class. If P ≠ NP If P = NP ■ Only exponential algorithms known for these problems. ■ Called "intractable" - unlikely that they can be solved given limited computing resources. 19 20 Some NP-Complete Problems The "World's First" NP-Complete Problem Most natural problems in NP are either in P or NP-complete. CNF-SAT is NP-complete. (Cook-Levin, 1960’s) Six basic genres and paradigmatic examples of NP-complete Idea of proof: problems. ■ Given problem X in NP, by definition, there exists ■ Packing problems: SET-PACKING, INDEPENDENT-SET. nondeterministic TM M that solves X in polynomial time. ■ Covering problems: SET-COVER, VERTEX-COVER. ■ Possible execution of M on input string s forms a ■ Sequencing problems: HAMILTONIAN-CYCLE, TSP. branching tree of configurations, where each configuration ■ Partitioning problems: 3-COLOR, CLIQUE.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages12 Page
-
File Size-