David Evans http://www.cs.virginia.edu/evans Lecture 41: P = NP? I will have extra office hours after class today (1-3pm). To be eligible to present Monday,

Slides:



Advertisements
Similar presentations
NP-Complete Problems CIT 596, Spring Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound.
Advertisements

David Evans CS200: Computer Science University of Virginia Computer Science Class 38: Intractable Problems (Smiley Puzzles.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
1 The Limits of Computation Intractable and Non-computable functions.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 40: Computing with Glue and Photons.
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
1 CSC 421: Algorithm Design & Analysis Spring 2013 Complexity & Computability  lower bounds on problems brute force, decision trees, adversary arguments,
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
Lecture 30. P, NP and NP Complete Problems 1. Recap Data compression is a technique to compress the data represented either in text, audio or image form.
David Evans Curing Cancer with Your Cell Phone: Why all Sciences are Becoming Computing Sciences.
David Evans CS200: Computers, Programs and Computing University of Virginia Computer Science Class 39: Meaning of Life.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 15: Complexity Notes This is selected.
CSC 413/513: Intro to Algorithms NP Completeness.
What Every Biologist, Chemist, and Poet Should Know about Computer Science David Evans UVaCompBio 25 April
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
David Evans Class 19: Golden Ages and Astrophysics CS200: Computer Science University of Virginia Computer Science.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Class 24: P=NP? David Evans cs302: Theory of Computation University of Virginia Computer Science PS6 (the last one) is.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
David Evans Class 16: NP-Completeness / The Story so Far CS150: Computer Science University of Virginia Computer Science.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
David Evans Class 15: P vs. NP (Smiley Puzzles and Curing Cancer) CS150: Computer Science University of Virginia Computer.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 14: P = NP?
Pancakes, Puzzles, and Polynomials: Cracking the Cracker Barrel Game Christopher Frost Michael Peck.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Intro to Computer Algorithms Lecture 21 Phillip G. Bradford Computer Science University of Alabama.
Limitation of Computation Power – P, NP, and NP-complete
The NP class. NP-completeness
NP-Complete Problems.
Chapter 10 NP-Complete Problems.
Great Theoretical Ideas in Computer Science
1.5 Intractable problems.
Lecture 22 Complexity and Reductions
CS 2210 Discrete Structures Algorithms and Complexity
Analysis and design of algorithm
Class 14: Intractable Problems CS150: Computer Science
Computational Complexity
CS 2210 Discrete Structures Algorithms and Complexity
Lecture 22: P = NP? CS200: Computer Science University of Virginia
Discrete Mathematics CS 2610
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
CS 3343: Analysis of Algorithms
Class 24: Computability Halting Problems Hockey Team Logo
CSC 380: Design and Analysis of Algorithms
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
NP-Completeness Lecture for CS 302.
CSC 380: Design and Analysis of Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
RAIK 283 Data Structures & Algorithms
Lecture 23: Computability CS200: Computer Science
Lecture 22 Complexity and Reductions
CS 2210 Discrete Structures Algorithms and Complexity
Presentation transcript:

David Evans http://www.cs.virginia.edu/evans Lecture 41: P = NP? I will have extra office hours after class today (1-3pm). To be eligible to present Monday, your team must send an email with your URL before midnight tonight. DNA Helix Photomosaic from cover of Nature, 15 Feb 2001 (made by Eric Lander) CS150: Computer Science University of Virginia Computer Science David Evans http://www.cs.virginia.edu/evans

Pegboard Problem

How hard is the Pegboard Problem? - Input: a configuration of n pegs on a cracker barrel style pegboard - Output: if there is a sequence of jumps that leaves a single peg, output that sequence of jumps. Otherwise, output false. How hard is the Pegboard Problem?

Problems and Procedures To know a O (f) bound for a problem, we need to find a (f) procedure that solves it The sorting problem is O (n log n) since we know a procedure that solves it in (n log n) To know a Ω(f ) bound for a problem, we need to prove that there is no procedure faster than (f) that solves it We proved sorting is Ω(n log n) by reasoning about the number of decisions needed

How much work is the Pegboard Problem? Upper bound: (O) O (n!) Try all possible permutations Lower bound: ()  (n) Must at least look at every peg Tight bound: () No one knows!

Complexity Class P “Tractable” Class P: problems that can be solved in a polynomial (O(nk) for some constant k) number of steps by a deterministic TM. Easy problems like sorting, making a photomosaic using duplicate tiles, simulating the universe are all in P.

Complexity Class NP Class NP: Problems that can be solved in a polynomial number of steps by a nondeterministic TM. Omnipotent: If we could try all possible solutions at once, we could identify the solution in polynomial time. Omniscient: If we had a magic guess-correctly procedure that makes every decision correctly, we could devise a procedure that solves the problem in polynomial time.

NP Problems The pegboard problem is in NP Can be solved by just trying all possible answers until we find one that is right Easy to quickly check if an answer is right Checking an answer is in P The pegboard problem is in NP We can easily try ~n! different answers We can check if a guess is correct in O(n) (check all n jumps are legal)

Is the Pegboard Problem in P? No one knows! We can’t find a O (nk) solution. We can’t prove one doesn’t exist.

Orders of Growth 2n < n! simulating universe pegboard puzzle insertsort quicksort

Orders of Growth pegboard puzzle simulating universe insertsort quicksort

Orders of Growth Pegboard puzzle “intractable” “tractable” simulating universe I do nothing that a man of unlimited funds, superb physical endurance, and maximum scientific knowledge could not do. – Batman (may be able to solve intractable problems, but computer scientists can only solve tractable ones for large n)

Intractable Problems P n! 2n n2 n log n log-log scale time since “Big Bang” 2n P 2022 today n2 n log n

Moore’s Law Doesn’t Help If the fastest procedure to solve a problem is (2n) or worse, Moore’s Law doesn’t help much. Every doubling in computing power increases the solvable problem size by 1.

Complexity Classes Class P: problems that can be solved in polynomial time by deterministic TM Easy problems like simulating the universe are all in P. Class NP: problems that can be solved in polynomial time by a nondeterministic TM. Includes all problems in P and some problems possibly outside P like the Pegboard puzzle.

Problem Classes if P  NP: Simulating Universe: O(n3) NP Find Best: (n) P How many problems are in the (n) class? (n) infinite How many problems are in P but not in the (n) class? infinite How many problems are in NP but not in P? Sorting: (n log n) infinite Pegboard: O(n!) and (n)

Problem Classes if P = NP: Simulating Universe: O(n3) Find Best: (n) P How many problems are in the (n) class? (n) infinite How many problems are in P but not in the (n) class? infinite How many problems are in NP but not in P? Sorting: (n log n) Pegboard: (nk)

P = NP? Is P different from NP: is there a problem in NP that is not also in P If there is one, there are infinitely many Is the “hardest” problem in NP also in P If it is, then every problem in NP is also in P The most famous unsolved problem in computer science and math Listed first on Millennium Prize Problems $1M + an automatic A+ in this course

NP-Complete NP-Complete: is the class of problems that are the hardest problems in NP Cook and Levin proved that 3SAT was NP-Complete (1971) If 3SAT can be transformed into a different problem in polynomial time, than that problem must also be NP-complete. Pegboard  3SAT Either all NP-complete problems are tractable (in P) or none of them are!

NP-Complete Problems Easy way to solve by trying all possible guesses If given the “yes” answer, quick (in P) way to check if it is right If given the “no” answer, no quick way to check if it is right No solution (can’t tell there isn’t one) No way (can’t tell there isn’t one) This part is hard to prove: requires showing you could use a solution to the problem to solve a known NP-Complete problem.

Pegboard Problem

Pegboard Problem - Input: a configuration of n pegs on a cracker barrel style pegboard - Output: if there is a sequence of jumps that leaves a single peg, output that sequence of jumps. Otherwise, output false. If given the sequence of jumps, easy (O(n)) to check it is correct. If not, hard to know if there is a solution.

Most Important Science/Technology Races 1930-40s:Decryption Nazis vs. British Winner: British Reason: Bletchley Park had computers (and Alan Turing), Nazi’s didn’t 1940s: Atomic Bomb Nazis vs. US Winner: US Reason: Heisenberg miscalculated, US had better physicists, computers, resources 1960s: Moon Landing Soviet Union vs. US Reason: Many, better computing was a big one 1990s-2001: Sequencing Human Genome

vs. Human Genome Race UVa CLAS 1970 San Mateo College Yale PhD Francis Collins (Director of public National Center for Human Genome Research) (Picture from UVa Graduation 2001) Craig Venter (President of Celera Genomics) vs. UVa CLAS 1970 Yale PhD Tenured Professor at U. Michigan San Mateo College Court-martialed Denied tenure at SUNY Buffalo

Reading the Genome Whitehead Institute, MIT

Gene Reading Machines One read: about 700 base pairs But…don’t know where they are on the chromosome Read 3 TACCCGTGATCCA Read 2 TCCAGAATAA Read 1 ACCAGAATACC Actual Genome AGGCATACCAGAATACCCGTGATCCAGAATAAGC

Genome Assembly Read 1 ACCAGAATACC Read 2 TCCAGAATAA Read 3 TACCCGTGATCCA Input: Genome fragments (but without knowing where they are from) Ouput: The full genome

Genome Assembly Read 1 ACCAGAATACC Read 2 TCCAGAATAA Read 3 TACCCGTGATCCA Input: Genome fragments (but without knowing where they are from) Ouput: The smallest genome sequence such that all the fragments are substrings.

Common Superstring Input: A set of n substrings and a maximum length k. Output: A string that contains all the substrings with total length  k, or no if no such string exists. ACCAGAATACC ACCAGAATACC TCCAGAATAA TCCAGAATAA TACCCGTGATCCA TACCCGTGATCCA ACCAGAATACCCGTGATCCAGAATAA n = 26

Common Superstring Input: A set of n substrings and a maximum length k. Output: A string that contains all the substrings with total length  k, or no if no such string exists. ACCAGAATACC TCCAGAATAA Not possible TACCCGTGATCCA n = 25

Common Superstring In NP: In NP-Complete: Easy to verify a “yes” solution: just check the letters match up, and count the superstring length In NP-Complete: Similar to Pegboard Puzzle! Could transform Common Superstring problem instance into Pegboard Puzzle instance!

Shortest Common Superstring Input: A set of n substrings Output: The shortest string that contains all the substrings. ACCAGAATACC ACCAGAATACC TCCAGAATAA TCCAGAATAA TACCCGTGATCCA TACCCGTGATCCA ACCAGAATACCCGTGATCCAGAATAA

Shortest Common Superstring Also is NP-Complete: def scsuperstring (pieces): maxlen = sum of lengths of all pieces for k in range(1, maxlen): if (commonSuperstring (pieces, k)): return commonSuperstring (pieces, k)

Human Genome 3 Billion base pairs 600-700 bases per read ~8X coverage required So, n  37 Million sequence fragments Celera used 27.2 Million reads (but could get more than 700 bases per read) > (/ (* 8 3000000000)) 650) 36923076 12/13

Give up? No way to solve an NP-Complete problem (best known solutions being O(2n) for n  20 Million) time since “Big Bang” 2n

Approaches Human Genome Project (Collins) Celera Solution (Venter) Change problem: Start by producing a genome map (using biology, chemistry, etc) to have a framework for knowing where the fragments should go Celera Solution (Venter) Approximate: we can’t guarantee finding the shortest possible, but we can develop clever algorithms that get close most of the time in O(n log n)

Result: Draw? Venter Collins President Clinton announces Human Genome Sequence essentially complete, June 26, 2000

Charge Presentation qualification before midnight tonight