The Brick Wall: NP-Completeness Christopher King Joshua Greenspan.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

NP-Completeness.
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
NP-Completeness Lecture for CS 302. Traveling Salesperson Problem You have to visit n cities You want to make the shortest trip How could you do this?
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Computational problems, algorithms, runtime, hardness
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
P versus NP and Cryptography Wabash College Mathematics and Computer Science Colloquium Nov 16, 2010 Jeff Kinne, Indiana State University (Theoretical)
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Analysis of Algorithms CS 477/677
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
P, NP, and NP-Complete Suzan Köknar-Tezel.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
CSCE350 Algorithms and Data Structure
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.
Difficult Problems. Polynomial-time algorithms A polynomial-time algorithm is an algorithm whose running time is O(f(n)), where f(n) is a polynomial A.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Cliff Shaffer Computer Science Computational Complexity.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
NP-Complete Problems Algorithm : Design & Analysis [23]
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
“One ring to rule them all” Analogy (sort of) Lord of The Rings Computational Complexity “One problem to solve them all” “my preciousss…”
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
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.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Pancakes, Puzzles, and Polynomials: Cracking the Cracker Barrel Game Christopher Frost Michael Peck.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
The Theory of NP-Completeness
Chapter 10 NP-Complete Problems.
Section 14.3 Complexity Classes
NP-Complete Problems.
CS 3343: Analysis of Algorithms
The Theory of NP-Completeness
Approximation Algorithms
Our old list of problems
Presentation transcript:

The Brick Wall: NP-Completeness Christopher King Joshua Greenspan

2 History Before 1950s computers will solve anything 1950s & 1960s: The wall −Computers can’t solve basic problems. Today: The wall still stands John von Neumann, 1950

3 The Wall Many fundamentally important problems can’t be solved in tractable time −Engineering −Operations research −VLSI chip design −Database management −Etc. NP Complete (Nondeterministic Polynomial time) −2 n or worse −Every time ‘n’ increases by 1, processing doubles −n! −Every time ‘n’ increases by 1, processing takes ‘n’ times longer

4 Scheduling Example Industry: Welding Schedule Manufacturing-line welding Fastest path = Line speed Finding fastest path: −Tabulate all possible paths −Compute path times −Choose best path All possible paths = n! (n = #welds) −3!=6, 4!=24, 5!=120, 6!=720, 30!=2.6x10 32 −30! Compute (1 trillion schedules)/sec = 30 years −31! = 930 years

5 Jackhammer through the wall Faster Computers & Massive Parallelization Turn every molecule in the universe into processor: −10 60 processors Every processor: 1,000 times faster than current −10 15 schedules/second Compute a schedule with 63 welds in 1000 years 64 welds: 64,000 years or 63 more universes Even improving algorithm to 2 n would allow 240 welds Exponential Explosion of Complexity

6 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A

7 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D −18 −Total = 18

8 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D – E − −Total = 32

9 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D – E – C − −Total = 46

10 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D – E – C – B − −Total = 68

11 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D – E – C – B – A − −Total = 93

12 Avoiding the wall n!, or even 2 n wont work −n 2 needed, or even n k Greedy Algorithm? −Start at arbitrary point −Take optimal path A – D – E – C – B – A − = 93 A – D – C – E – B – A − = 90

13 Avoiding the wall For scheduling problem −No n 2, n 100, or n k algorithm has ever been found −No n k will ever be found For all NP-complete problems −No n 2, n 100, or n k algorithm has ever been found −No n k will ever be found Can good solutions be made efficiently? −For non-Euclidean, no such guarantee −For scheduling problem using Euclidean distances −Polynomial can be found to produce 50% optimal −Many other NP-C problems can be approximated efficiently

14 Bin packing problem Goal: Store telephones of different sizes in bins Optimal solution: Use as few bins as possible First Fit Algorithm −Place each phone in first bin it fits in −No bin except last can be less then half full −This means: FF requires no more then 2x optimal + 1 −Proof: If two bins are less then half full −You can combine the contents of these bins into 1

15 Efficient approximation guarantee Better algorithms can be found −First-Fit Decreasing - Put the biggest phone in the lowest bin it fits in −guarantee within 22% of optimal −proof is complex −Shows ratio of bins produced by FFD to optimal is 11/9 Example of worst case

16 Probabilistic Results Guarantees can be much worse than actual Consider where you have infinite phones with sizes between 0 to bin-size −Always find two phones to fit in a bin Actually holds for more general cases using a finite number of phones of even size distribution −High probability that two phones will fit bin Proved that under uniform distribution −Constant number of bins are wasted Combining locally optimal solutions can make NP-C approximations efficient Not all NP-C can be solved using locally optimal solutions

17 Satisfiability (SAT) problem Important because first to be shown NP-C Used to prove many other problems are NP-C Boolean equation in Conjunctive Normal Form −Equation is an “AND” of clauses −Clause is an “OR” of literals −Literals are True or false Clause is true if at least one literal is true Equation is satisfiable (true) if every clause is true Problem: Determine if given formula is satisfiable Known solution is O(2 n )

18 SAT Problem Since it is either satisfiable or not satisfiable −No approximations −No locally optimal solutions SAT allows research into NP-C problems Special classes of SAT can be solved efficiently −Restrict to 2 literals, time to solve proportional to size of formula −Restrict so only 1 non-negated literal, also proportional to size of formula Problems with 3 literals per clause are those of NP-C problems

19 Probability of Satisfiability It is trivial to find satisfiabilities probabilistically −Given M clauses and N literals −Formula is likely satisfiable if M/N < 4.2 −Near 100% not-satisfiable if M/N > 4.3 It is non-trivial to find satisfiability with certainty −Known special classes are likely only with M/N < 1 −Other efficient solutions are likely (Near 100%) if M/N < −No known efficiently solution when M/N > 4.3

20 Other NP Problems NP −All decision problems where ‘yes’ answers have simple proofs −Ex. Integer factorization NP Complete (NPC) −Most challenging NP problems −Proving 1 NP-C=P proves all NP=P −Proving 1 NP-C≠P proves all NP-C≠P −Ex. Boolean NP Easy −At most as hard as NP NP Hard −At least as hard as NP −May not be NP Ex. (NP-C) Subset Sum, Traveling Salesperson Ex. (! NP-C) Halting problem

21 Proving NP-C Prove a problem is NP-C −Prove NP −Reduce problem to a known NP-C −n 4 reduces to n*n*n*n

22 Does NP≠P It has yet to be shown if NP problems can be solved in Polynomial Time −Clay Mathematics Institute (CMI): $1,000,000 If NP-C ≠ P for one problem: The same for all If NP-C=P: Solutions to all CMI problems If NP-C=P: All life’s mysteries will be solved, artificially intelligent beings will emerge, and they will enslave humanity [Stross, 2000]

23 Questions?