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.

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

NP-Hard Nattee Niparnan.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
1 The Limits of Computation Intractable and Non-computable functions.
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.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Chapter 11: Limitations of Algorithmic Power
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
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.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 CSC 421: Algorithm Design & Analysis Spring 2013 Complexity & Computability  lower bounds on problems brute force, decision trees, adversary arguments,
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 11 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
FACULTY OF ENGINEERING & INFORMATION TECHNOLOGIES P, NP, and Complexity Six fundamental facts One rule of thumb Three fundamental notions One fundamental.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
DP TSP Have some numbering of the vertices We will think of all our tours as beginning and ending at 1 C(S, j) = length of shortest path visiting each.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
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.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
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.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
Week 13 - Monday.  What did we talk about last time?  B-trees  Hamiltonian tour  Traveling Salesman Problem.
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.
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
NPC.
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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
1 Computability Tractable, Intractable and Non-computable functions.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
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.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
ICS 353: Design and Analysis of Algorithms
Approximation Algorithms
Chapter 11 Limitations of Algorithm Power
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

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 to an algorithm that has two possible outputs.(ie Is this path optimal?)  NP is NOT Non-Polynomial, it is Non- deterministic Polynomial.  A decision problem is NP-complete if it is classified as both NP and NP-Hard.  They can be verified quickly in polynomial time (P), but can take years to solve as their data sets grow.

 Was introduced by Stephen Cook in 1971 at the 3rd Annual ACM Symposium on Theory of Computing  His paper, The complexity of theorem-proving procedures, started the debate whether NP-Complete problem could be solved in polynomial time on a deterministic Turing machine.  This debate has led to a $1 million reward from the Clay Mathematics Institute for proving that NP-Complete problems can be solved in polynomial time so that P=NP or disproving it thus P≠NP.

 Approximation: Find the most optimal solution…almost.  Heuristic: An algorithm that works in many cases, but there is no proof that it is both always fast and always has a correct answer.  Parameterization: If certain parameters of the input are constant, you can usually find a faster algorithm.  Restriction: By reducing the structure of the input to be less complex, faster algorithms are usually possible.  Randomization: Use randomness to reduce the average running time, and allow some small possibility of failure.

 Using a list of cities and the distances between each pair of cities find the shortest route by going to each city and returning to the original.  The decision version of the problem, when given a tour length L, decide whether the graph has any tour shorter than L, is NP-complete.  Optimal solution would be to travel to each city only once without any big “jumps”  Brute force runtime = O(n!)

 Heuristic algorithm  Starting node could be random or same every time  Finds the node with the least weight from the starting node and goes there  Repeats from that node until back to start  Not guaranteed to be the best solution but runs relatively quickly  Runtime of O(n 2 )

Best Solution found Starting Map

Initialization c← 0 Cost ← 0 visits ← 0 e = 1 /* pointer of the visited city */ For 1 ≤ r ≤ n Do { Choose pointer j with minimum = c (e, j) = min{c (e, k); visits (k) = 0 and 1 ≤ k ≤ n } cost ← cost + minimum - cost e = j C(r) ← j C(n) = 1 cost = cost + c (e, 1)

 Given a set of items with a weight and a value, determine which items you should pick that will maximize the value while staying within the weight limit of your knapsack (a backpack).  The optimal solution is the highest value that will “fit” in the knapsack  Brute force runtime = O(2 n )

 Starts with the last item in the list and removes it if over capacity  Recurses through every item and adds to knapsack based on Value and if there is still room  Works for item duplicates  Runtime = O(kn) where k is capacity

INTEGER-KNAPSACK(Weight,Value,Item,Capacity) { If Item = 0 then return 0 else if (Capacity – Weight[Item] < 0) return INTEGER-KNAPSACK(Weight,Value,Item-1,Capacity) else a = INTEGER-KNAPSACK(Weight,Value,Item-1,Capacity) b = INTEGER-KNAPSACK(Weight,Value,Item-1,Capacity) return max(a,b) }

 Given a set of integers, does this set contain a non-empty subset which has a sum of zero  Given this set  Would be true because  A variation would be for the subset sum to equal some integer n  Brute force runtime = O(2 n n)

 Algorithm trims itself down to remain running in polynomial time  Set for finding a certain sum  A list U consists of numbers lists T and S have in common  Return True if list S has a number that is both smaller than total sum but grater than the total negative sum

a list S contains one element 0. for i = 1 to N T =a list of x i + y, for all y in S U = T ⋃ S sort [U] //sorts where U[0] is smallest delete S[] y = U[0] S.push(y) for z = 0 to U.size() //eliminate numbers close to one another //and throw out elements greater than s if (y + cs/N < z ≤ s) y = z S.push(z) if S contains a number between (1 − c)s and s return true Else return false

 NP-complete problems are pushing the limits of our computing power  The limits of NP-completeness are set based on the question of whether P=NP or P≠NP  If one problem can be solved quickly then they all can be solved quickly.

 Some areas of cryptography, such as public key cryptography, which rely on being hard, would be broken easily  The other six millennial problems could instantly be solved.  Transportation become more efficient thanks to easy path finding.  Operations research and protein structures in biology would be easy to solve  Any yes/no question could be answered by machine, not by a person, as long as the polynomial constant factor of the algorithms is low, not, for example, n 1000

 Currently believed to be true, based on years of research and the lack of an effective algorithm  Hard problems couldn’t be solved efficiently, so Computer Scientists would be focused on developing only partial solutions.  This result still leaves open the average case complexity of hard problems in NP.

 Applets/TSP/notspcli.htm Applets/TSP/notspcli.htm  problem/fulltext problem/fulltext      Computers and Intractability: A Guide to the Theory of NP-Completeness. New York: W.H. Freeman. ISBN 