Problem Complexity Classes
|
|
- Anthony Dixon
- 5 years ago
- Views:
Transcription
1 Problem Complexity Classes P, NP, NP-Completeness and Complexity of Approximation Joshua Knowles School of Computer Science The University of Manchester COMP Week , March 20th 2015
2 In This Lecture The Classes P and NP The most difficult problems: NP-Complete and NP-hard Strongly and Weakly NP-hard An Approximation Complexity Class: APX Complexity / NP-Completeness , March 20th 2015
3 Quick Overview of Main Complexity Classes P The set of problems for which a worst-case polynomial-time algorithm is known (in short: Easy problems). NP The set of problems for which we know how to check a proposed solution in worst-case polynomial time (in short: this set might include some harder problems to find solutions for, but we can at least check the solutions quickly if we are given them). NP-complete The set of problems in NP that we can efficiently reduce any other problem in NP to. (In short: this set stands for the hardest problems in NP, but we don t actually have a proof that they are harder than P problems!) These definitions might seem a little tricky. Why can t we have something simpler?... We will hopefully see why they are like this in what follows Complexity / NP-Completeness , March 20th 2015
4 Polynomial-Time is Tractable Some notation: Π A problem π A problem instance π The number of symbols needed to describe π. Also written as n, the input size to an algorithm for solving π. Running times of algorithms are expressed as functions of the size of the input. E.g. O(n 2 ). Very few polynomial algorithms run in a complexity worse than say O(n 5 ) time. (There are no O(n 1000 ) algorithms). So, polynomial tractable. Complexity / NP-Completeness , March 20th 2015
5 The Need for Problem Complexity Classes Efficient algorithms have been designed for many problems, e.g.: integer arithmetic operations, sorting, matrix multiplication, shortest path in a graph, minimum spanning tree, and so on. These problems are polynomial-time solvable: there are known algorithms to solve each of these problems in polynomial time in the worst case. But for many other well-defined problems, often very simple to state, no efficient (polynomial) algorithm has been found. Confronted with a new problem, how do we know whether or not it will be futile to look for an efficient algorithm for it? Complexity / NP-Completeness , March 20th 2015
6 The Need for Problem Complexity Classes The bandersnatch problem (*Garey and Johnson, 1979) A fictitious scenario: Your boss has asked you, her chief algorithm designer, to design a procedure to check whether new components can be made for a bandersnatch machine that meet all the design requirements. You design an algorithm, but it keeps running too slowly. The result is that the whole production is held up. What can you do, as your boss wants a faster algorithm, but you can t think of one? Computers and Intractability, A Guide to the Theory of NP-Completeness, Freeman and Co., New York, Complexity / NP-Completeness , March 20th 2015
7 The Need for Problem Complexity Classes One strategy: If you can t do something, prove it can t be done. Good idea, but for many problems no such proof can be found either. This is the case for many optimization problems and whether they are polynomial-time solvable....now your bandersnatch boss asks to see you about the SLOWNESS of your algorithm. What can you say? Complexity / NP-Completeness , March 20th 2015
8 The Need for Problem Complexity Classes You should say: I can t prove it can t be done, but I can prove that the problem is as hard as all these problems: traveling salesman problem, propositional satisfiability, solving quadratic Diophantine equations, shortest common supersequence, bounded post correspondance problem,... And NO-ONE ELSE has found a polynomial time solution to those either! I.e. you might be able to prove an equivalence of your problem with some others that seem difficult. This is a key motivation for the class of NP-Complete problems (which are problems that all have an equivalent maximum level of difficulty). Complexity / NP-Completeness , March 20th 2015
9 The Need for Problem Complexity Classes c Bell Telephone Laboratories, (Reproduced without permission) Complexity / NP-Completeness , March 20th 2015
10 Optimization Problems, Evaluation Problems and Decision Problems Optimization Problems are Three Problems in One. 1. An optimization version instance has the form: Given the parameters of the instance, find the optimal feasible solution. (The solution must define the values of the variables to achieve the optimum.) 2. An evaluation version of the problem instance requires only that the optimal solution cost is returned. 3. A decision version of the problem instance gives the parameters of the instance and an additional integer L and asks for a yes/no answer to the question, Is there a feasible solution of cost c L? + The theory of computation studies problems like the decision version above, not optimization problems, so the classes P, NP (and NP-Complete) are defined on decision problems only. In the course textbook this is called a recognition version. + We assume a minimization problem, without loss of generality. Complexity / NP-Completeness , March 20th 2015
11 The Class P Informally the class P is the class of decision problems solvable by some algorithm within a number of steps bounded by some fixed polynomial in the length of the input. Stephen Cook The length of the input refers to the number of symbols written in some alphabet (or language) needed to describe a problem instance. Recall that O(n log n), which is a log-linear complexity, and not polynomial, is still bounded by a polynomial, e.g. O(n 2 ). Similarly other complexities involving roots will generally be bounded by polynomials if exponents and factorials of n are absent. Complexity / NP-Completeness , March 20th 2015
12 The Class NP Definition: The class NP is the set of decision problems such that a yes certificate can be checked in polynomial time. Thus, the class NP encapsulates all problems where it is easy/quick to verify a proposed yes solution (a certificate) to every problem instance that admits a yes solution. Proof: pi is a YES instance since: Algorithm Certificate is verified Every combinatorial optimization problem in its decision version is in NP (see p.351, course textbook). Complexity / NP-Completeness , March 20th 2015
13 Important Note: It is not a requirement of members of NP for there to be a method of efficiently generating the certificate. Second Important Note: If the problem instance is a no instance then any proposed solution (or certificate) must be verified as being a no in polynomial time. But there is no need to be able to arrive at the NO decision for the problem (one might have to check every certificate) quickly to be in NP. E.g. the problem may be Is there a route around the 50 state capitals of the United States in at most 5000 miles?. The answer is no, but it can be difficult to prove because we may have to check a lot of certificates. ALL that is required for the problem to be in NP is that we can check each no certificate in polynomial time. E.g. we can verify that a particular tour does NOT visit all the state capitals and have a length 5000 miles. Complexity / NP-Completeness , March 20th 2015
14 Example of a Member of the Class NP TSP (decision version) instance: Is there a Hamiltoninan Cycle in this graph of length less than L=41? A 7 B 9 6 F 6 G 7 5 C E D certificate: <ABCDEGF> = 40 Certificate: a sequence of cities, such as ABCDEGF Checking algorithm: check each edge in the certificate (e.g. A-B, B-C,..., F-A) exists in the given graph, and that every vertex in the sequence appears exactly twice. Complexity / NP-Completeness , March 20th 2015
15 Proof (TSP (decision) problem is in NP.) Clearly, the checking can be done in polynomial time since the number of symbols in the certificate is less than the number in the problem instance (input), and each check that must be done is a simple look-up or a simple increment to a counter. More examples: Papadimitriou and Steiglitz, p Complexity / NP-Completeness , March 20th 2015
16 All P problems are NP Theorem: Every (decision) problem in P is a member of NP. Argument: Assume a problem is in P but not in NP. The consequence of being in P: the algorithm for generating the decision (yes/no) is polynomial. But the trace of this algorithm can serve legitimately as the certificate of the decision (a polynomial certificate) contradicting the assumption the problem is not in NP. See page 351 of Papadimitriou and Steiglitz for fuller treatment. Complexity / NP-Completeness , March 20th 2015
17 Is P a proper subset of NP? This is the notorious P? NP (or P vs NP) problem. Computer scientists have not been able to prove that problems such as Traveling Salesman, Graph Coloring (scheduling and timetabling), Diophantine Equations, cannot be solved in polynomial time. Either: P = NP OR NP P P = NP P NP Complexity / NP-Completeness , March 20th 2015
18 P vs NP P vs NP One of the Clay Millenium Prizes vs NP/ is offering a Million US Dollars for a legitimate proof either way. Complexity / NP-Completeness , March 20th 2015
19 P vs NP (Wider Implications) Apart from being a rigourously defined mathematical problem of great interest to theoretical computer science, the P vs NP problem is also taken to have wider (even philosophical) implications about the limits of AI, and questions around human creativity. If P=NP, then painting a (new) masterpiece should be as easy as recognizing that it is a masterpiece. Check out the painting. vs. I verify it is good. Doing a painting versus verifying a painting is good. Complexity / NP-Completeness , March 20th 2015
20 P vs NP Some time in but Deolalikar is not a prize millionaire yet. Complexity / NP-Completeness , March 20th 2015
21 P vs NP In fact, when Deolalikar announced his proof, Scott Aaronson, a respected theoretical computer scientist wrote on his blog I hereby announce the following offer: If Vinay Deolalikar is awarded the 1,000,000-dollar Clay Millennium Prize for his proof of P NP, then I, Scott Aaronson, will personally supplement his prize by the amount of 200,000 dollars. I m dead serious and I can afford it about as well as you d think I can. even before the proof had been seen or checked. Complexity / NP-Completeness , March 20th 2015
22 Polynomial Transformations There is a polynomial transformation from a problem Π 1 to a problem Π 2 if there is a function F such that for every instance π 1 Π 1 there is an instance π 2 Π 2 = F (π 1 ), such that π 1 is a yes instance of Π 1 if and only if π 2 is a yes instance of Π 2, and F is a polynomially bounded function. We write Π 1 Π 2. Note 1: Π 2 is a least as hard a problem as Π 1 since the above says that all instances of Π 1 can be mapped to instances of Π 2, but not (necessarily) the other way around. Note 2: polynomial transformation is transitive, i.e. if Π 1 Π 2 and Π 2 Π 3 then Π 1 Π 3. We can use this idea to define a class of most difficult problems in NP. Complexity / NP-Completeness , March 20th 2015
23 The Definition of NP-Complete A Problem Π is NP-complete if and only if 1. Π is in NP, and 2. Π Π for every other Π in NP. It would be most inconvenient if, to show a problem is hard, we had to show that every problem in NP transforms to it. Fortunately, we can instead prove that just one NP-complete problem transforms to it. Why is this sufficient? Complexity / NP-Completeness , March 20th 2015
24 Updated View of Complexity Classes NP Complete NP P It has been shown that if P NP then there are problems in NP that are not in P or NP-Complete, including integer factoring. Complexity / NP-Completeness , March 20th 2015
25 The Usefulness of the NP-Complete Class 1. No NP-Complete problem can be solved by a known polynomial-time algorithm 2. If a polynomial-time algorithm is found for one NP-Complete problem, then all NP-Complete problems will be solvable in polynomial time. So, NP-Complete serves as a kind of badge of difficulty. One can now say, my problem Π is hard unless P=NP. (And most people who know, think P NP). It also allows every theoretical computer scientist to be working on the same problem, i.e., searching for a proof that P NP, or searching for a polynomial time algorithm for any NP-Complete problem (and hence proving P=NP). Complexity / NP-Completeness , March 20th 2015
26 The First NP-Complete Problem(s) Timeline: 1971 Stephen Cook proves that SATISFIABILITY is NP-Complete by showing that every other problem in NP can be transformed to it Cook also proves that another problem, SUBGRAPH ISOMORPHISM is NP-Complete Richard Karp gives NP-Completeness proofs for 21 further problems in NP Levin gives NP-Completeness proofs for a number of natural problems of interest Garey and Johnson publish the landmark book Computers and Intractability..., which contains NP-Completeness results (references to proofs) for more than 300 problems across Graph theory, Network design, Sets and partitions, Sequencing and scheduling, Logic, Storage and retrieval, Games, and Number theory. Complexity / NP-Completeness , March 20th 2015
27 Generalizations and Special Cases One easy way to prove a problem is NP-Complete is to show it is a generalization of an existing NP-Complete problem. E.g. The 0/1 Knapsack problem is a generalization of the problem, PARTITION. PARTITION asks whether or not it is possible to divide a set of items (each with a weight) into two sets with equal total weight. Can you show that 0/1 Knapsack is a generalization of this? Notice: This does not mean PARTITION is easier than 0/1 Knapsack; there must also be a way to transform 0/1 Knapsack to PARTITION too, so that each instance of 0/1 knapsack is a yes instance if and only if the corresponding PARTITION instance is a yes. Special cases (or restrictions) of NP-Complete problems need not be NP-complete. For you to do: Give a restriction of 0/1 Knapsack that makes it easy (polynomial-time solvable). Complexity / NP-Completeness , March 20th 2015
28 The Definition of NP-Hard Recall the definition of NP-Complete: A Problem Π is NP-complete if and only if 1. Π is in NP, and 2. Π Π for every other Π in NP. If Π satisfies condition (2) and whether or not it satisfies condition (1), then it is NP-hard. So, NP-hard problems are not necessarily in NP. The hard optimization problems (in the original optimization version) are NP-hard, and not in NP. NP-hard is the class of problems (not necessarily decision problems) that are at least as hard as the NP-Complete problems. Complexity / NP-Completeness , March 20th 2015
29 Warning: Some people mistakenly think NP-Complete are really hard problems, and NP-hard are slightly less hard. This is incorrect. NP-hard problems are a larger class than NP-Complete and at least as difficult. Complexity / NP-Completeness , March 20th 2015
30 The Complement of NP: co-np A problem is said to be in co-np if its complement is in NP. Hamiltonian Cycle Complement Problem: Is there NOT a Hamiltonian cycle in the given graph G? The above problem is in co-np (since if you remove the NOT you have a problem in NP). The above problem is not in NP. Why? (Hint: certificates?) Every P decision problem is in both NP and co-np. Can you see why? Complexity / NP-Completeness , March 20th 2015
31 Summary of Key Information decision problems P NP P NP P NP probably problems with yes/no answer set of poly.-time solvable decision problems set of problems whose yes instances can be verified (not solved) in poly. time, given a suitable certificate (since solution constitutes certificate) though proof is seeming difficult! NP-Complete Problem Π 1. Π is in NP, and 2. Π polynomially transforms to Π for all Π in NP NP-Hard Problem Π At least as hard as any problem in NP. Not necessarily in NP; so does not need to be a decision Π co-np P NP co-np problem complement of problem Π. Yes instances of Π are no instances of Π problems where no instances can be verified in poly. time (since run of polynomial algorithm is certificate for both a problem and its complement) Complexity / NP-Completeness , March 20th 2015
32 Part II Pseudopolynomial Algorithms and Approximation Algorithms Complexity / NP-Completeness , March 20th 2015
33 0/1 Knapsack Problem is Weakly NP-Hard You are currently studying algorithms for the 0/1 Knapsack problem. Later, you will study a Dynamic Programming algorithm for the problem. It works by constructing a table of size N.C, where N is the number of items in the knapsack and C is the knapsack capacity. Each operation for constructing the table is simple [i.e., O(1)], so the complexity of the algorithm as a whole is O(N.C). But 0/1 Knapsack is NP-Hard (or NP-Complete in decision form), so how can this be? Complexity / NP-Completeness , March 20th 2015
34 The Dynamic Programming Approach to Knapsack Here is a problem with Knapsack capacity=6 being solved. There are 3 items of sizes 3,1 and 5. (The profits equal the sizes.) Capacity item The optimal solution is in the last (bottom right) cell of the table. This looks like polynomial time. So did we prove P=NP? Complexity / NP-Completeness , March 20th 2015
35 0/1 Knapsack is Still Exponential Time :-( Why is the DP algorithm for Knapsack not polynomial? Because O(N.C) is not polynomial in the input size of the instance! Consider a problem with just 5 items but knapsack capacity 1,000,005 with items of sizes 743,004; 225,025; 78,000; 634,451; 362,017. What is the size of the instance? Well, count the digits in the input above. There are just 36. But N.C is 5, 000, 000. What has happened here? The input size is N. log C since it takes roughly log C digits to express each number (item weight). So O(N.C) is exponential in the input size. However, practically, Knapsack problems often grow in the number of items, not (so much) by the capacity. So in practice DP approach to Knapsack is fast. Complexity / NP-Completeness , March 20th 2015
36 0/1 Knapsack is Pseudopolynomial Time Solvable It seems useful to be able to describe the relative easiness of Knapsack in practice (despite it being NP-hard). Definition: A problem can be solved in pseudopolynomial time if there is an algorithm that can solve every instance π in a polynomial function of n and number(π). Above, number(π) can be taken as the largest number described in the input. Complexity / NP-Completeness , March 20th 2015
37 Strongly NP-Hard Means Not Pseudo-Poly. Solvable Many NP-hard problems cannot be solved in pseudopolynomial time. E.g. dynamic programming when applied to the travelling salesman still gives a running time exponential in V, so it does not matter if the weights in the graph are small or large. No other pseudopolynomial time algorithm is possible either unless P=NP. Such problems are called Strongly NP-Hard. Definition: A problem is strongly NP-hard if it remains NP-hard for instances π n Π that are restricted to the set of instances where number(π n ) is polynomial in π n. An NP-hard problem that is not strongly NP-hard is called weakly NP-hard. Complexity / NP-Completeness , March 20th 2015
38 Approximation Algorithms One approach to tackling NP-hard optimization problems, is to use polynomial-time algorithms that give guaranteed levels of approximation of the optimal solution. Definition: An algorithm is a p-approximation algorithm for a problem Π if it gives a solution not worse than p times the optimal cost on any instance π Π. If a p-approximation algorithm is in addition a polynomial time algorithm for Π, then it is known as a polynomial time approximation algorithm for Π. Complexity / NP-Completeness , March 20th 2015
39 Approximation Ratios The performance ratio of an algorithm is for a minimization problem max π Π max π Π C alg (π) C opt (π) C opt (π) C alg (π) for a maximization problem where C alg (π) is the value of the algorithm solution on input π and C opt (π) is the value of the optimal solution on input π. Complexity / NP-Completeness , March 20th 2015
40 A 2-Approximation Scheme for Metric TSP One form of metric TSP is: Given a weighted, complete graph G = (V, E) with edge weights satisfying the triangle inequality, give a minimal weight Hamiltonian cycle in G. A 2-Approximation Scheme for it is the following: [HOMEWORK: Prove this] Step 1. Construct the minimum spanning tree (e.g. using Kruskal or Prim s algorithm.) This takes O( V 2 ) time. Step 2. Create an Eulerian graph from the tree by duplicating all edges. This step is O( V ). Step 3. Construct an Euler cycle in the Eulerian graph by using a cycle finding algorithm. The complexity is O( V + E ). Step 4. Finally, construct a Hamiltonian Cycle in G by shortcutting the Euler cycle. That is, skip out vertices already visited and proceed to the next unvisited vertex on the Eulerian cycle. This takes O( V 2 ) steps. Complexity / NP-Completeness , March 20th 2015
41 Illustration: A 2-Approximation Scheme for Metric TSP D E C B A F G D E C B A F G 2 D E C B A F G 2 TSP Instance STEP 1 STEPS 2 & 3 D E C B A F G STEP 4 Note: the scheme is illustrated here on a sparse graph. However, in general it only works on complete graphs. Why? Complexity / NP-Completeness , March 20th 2015
42 The APX Class Any problem that is approximable within a fixed constant factor of the best cost is in the class APX (approximable). In other words, if there is a polynomial time p-approximation algorithm for a problem, then the problem is in APX. Metric TSP is in APX. Complexity / NP-Completeness , March 20th 2015
43 Summary The P, NP and NP-Complete complexity classes are important for classifying problem difficulty. NP-hard class characterizes optimization problems (optimization versions) as being very difficult. Strongly NP-hard problems remain hard even when all the numbers (e.g. weights) in a problem instance are small (i.e. bounded by a polynomial of the instance size). Weakly NP-hard problems are only hard when some of the numbers in an instance are large. They can be solved in pseudo-polynomial time. Constant-factor approximation algorithms for NP-hard problems that run in polynomial time are known as polynomial approximation algorithms. The class of problems for which a PTAA exists is called APX. Complexity / NP-Completeness , March 20th 2015
44 Further Reading Chapters 15, 16, 17 of Papadimitriou and Steiglitz Garey and Johnson (1979). Look at the NP-Complete problems listed in the back, and how they are related Zoo Some more links are on the course webpage. Complexity / NP-Completeness , March 20th 2015
ECS122A Handout on NP-Completeness March 12, 2018
ECS122A Handout on NP-Completeness March 12, 2018 Contents: I. Introduction II. P and NP III. NP-complete IV. How to prove a problem is NP-complete V. How to solve a NP-complete problem: approximate algorithms
More informationCS 350 Algorithms and Complexity
CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
More informationEasy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P
Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the
More informationCS 350 Algorithms and Complexity
1 CS 350 Algorithms and Complexity Fall 2015 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
More informationData Structures in Java
Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways
More informationIntroduction to Complexity Theory
Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity
More informationLimitations of Algorithm Power
Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying
More informationComputational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs
Computational Complexity IE 496 Lecture 6 Dr. Ted Ralphs IE496 Lecture 6 1 Reading for This Lecture N&W Sections I.5.1 and I.5.2 Wolsey Chapter 6 Kozen Lectures 21-25 IE496 Lecture 6 2 Introduction to
More informationNP Completeness and Approximation Algorithms
Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic
More informationComputational Complexity
Computational Complexity Algorithm performance and difficulty of problems So far we have seen problems admitting fast algorithms flow problems, shortest path, spanning tree... and other problems for which
More informationP versus NP. Math 40210, Fall November 10, Math (Fall 2015) P versus NP November 10, / 9
P versus NP Math 40210, Fall 2015 November 10, 2015 Math 40210 (Fall 2015) P versus NP November 10, 2015 1 / 9 Properties of graphs A property of a graph is anything that can be described without referring
More informationNP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]
NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the
More informationNP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.
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 1 General Problems, Input Size and
More informationSummer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.
Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA NP Completeness Susmita Sur-Kolay Advanced Computing and Microelectronics Unit
More informationNotes for Lecture 21
U.C. Berkeley CS170: Intro to CS Theory Handout N21 Professor Luca Trevisan November 20, 2001 Notes for Lecture 21 1 Tractable and Intractable Problems So far, almost all of the problems that we have studied
More informationNP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20
NP-complete problems CSE 101: Design and Analysis of Algorithms Lecture 20 CSE 101: Design and analysis of algorithms NP-complete problems Reading: Chapter 8 Homework 7 is due today, 11:59 PM Tomorrow
More informationComputational complexity theory
Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,
More information1.1 P, NP, and NP-complete
CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Introduction to NP-complete Problems Date: 11/01/2008 Lecturer: Lap Chi Lau Scribe: Jerry Jilin Le This lecture gives a general introduction
More information1. Introduction Recap
1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization
More informationNP-Completeness. NP-Completeness 1
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 1 General Problems, Input Size and
More informationChapter 34: NP-Completeness
Graph Algorithms - Spring 2011 Set 17. Lecturer: Huilan Chang Reference: Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. Chapter 34: NP-Completeness 2. Polynomial-time
More informationEssential facts about NP-completeness:
CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions
More informationWeek Cuts, Branch & Bound, and Lagrangean Relaxation
Week 11 1 Integer Linear Programming This week we will discuss solution methods for solving integer linear programming problems. I will skip the part on complexity theory, Section 11.8, although this is
More information6-1 Computational Complexity
6-1 Computational Complexity 6. Computational Complexity Computational models Turing Machines Time complexity Non-determinism, witnesses, and short proofs. Complexity classes: P, NP, conp Polynomial-time
More informationNP-Completeness. Until now we have been designing algorithms for specific problems
NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower
More informationComputational complexity theory
Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,
More informationThe P-vs-NP problem. Andrés E. Caicedo. September 10, 2011
The P-vs-NP problem Andrés E. Caicedo September 10, 2011 This note is based on lecture notes for the Caltech course Math 6c, prepared with A. Kechris and M. Shulman. 1 Decision problems Consider a finite
More informationVIII. NP-completeness
VIII. NP-completeness 1 / 15 NP-Completeness Overview 1. Introduction 2. P and NP 3. NP-complete (NPC): formal definition 4. How to prove a problem is NPC 5. How to solve a NPC problem: approximate algorithms
More informationComputers and Intractability
Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory M. R. Garey and D. S. Johnson W. H. Freeman and Company, 1979 The Bandersnatch problem Background: Find
More informationAlgorithms: COMP3121/3821/9101/9801
NEW SOUTH WALES Algorithms: COMP3121/3821/9101/9801 Aleks Ignjatović School of Computer Science and Engineering University of New South Wales LECTURE 9: INTRACTABILITY COMP3121/3821/9101/9801 1 / 29 Feasibility
More informationA Working Knowledge of Computational Complexity for an Optimizer
A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi 1 Why computational complexity? What is computational complexity theory? It s a branch of mathematics
More informationComputers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness
Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory Background: Find a good method for determining whether or not any given set of specifications for a
More informationAgenda. What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class
Complexity Agenda What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class Complexity class A complexity class is a set All problems within
More informationCHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1
CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY E. Amaldi Foundations of Operations Research Politecnico di Milano 1 Goal: Evaluate the computational requirements (this course s focus: time) to solve
More informationLecture 4: NP and computational intractability
Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples
More informationCS 6901 (Applied Algorithms) Lecture 3
CS 6901 (Applied Algorithms) Lecture 3 Antonina Kolokolova September 16, 2014 1 Representative problems: brief overview In this lecture we will look at several problems which, although look somewhat similar
More informationLecture 18: P & NP. Revised, May 1, CLRS, pp
Lecture 18: P & NP Revised, May 1, 2003 CLRS, pp.966-982 The course so far: techniques for designing efficient algorithms, e.g., divide-and-conquer, dynamic-programming, greedy-algorithms. What happens
More informationCOMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Computational Complexity CLRS 34.1-34.4 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures 1 / 50 Polynomial
More informationTheory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death
Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory
More informationNP-Completeness. NP-Completeness 1
NP-Completeness x x x 2 x 2 x 3 x 3 x 4 x 4 2 22 32 3 2 23 3 33 NP-Completeness Outline and Reading P and NP ( 3.) Definition of P Definition of NP Alternate definition of NP NP-completeness ( 3.2) Definition
More informationTractable & Intractable Problems
Tractable & Intractable Problems We will be looking at : What is a P and NP problem NP-Completeness The question of whether P=NP The Traveling Salesman problem again Programming and Data Structures 1 Polynomial
More informationTractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?
Tractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?» Standard working definition: polynomial time» On an input
More informationDESIGN AND ANALYSIS OF ALGORITHMS. Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS
DESIGN AND ANALYSIS OF ALGORITHMS Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS http://milanvachhani.blogspot.in COMPLEXITY FOR THE IMPATIENT You are a senior software engineer in a large software
More informationUnit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS
DESIGN AND ANALYSIS OF ALGORITHMS Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS http://milanvachhani.blogspot.in COMPLEXITY FOR THE IMPATIENT You are a senior software engineer in a large software
More informationThe P = NP Problem Bristol Teachers Circle, June P.D.Welch, University of Bristol
The P = NP Problem Bristol Teachers Circle, June 26 2013 P.D.Welch, University of Bristol The Königsberg Bridge Problem - Euler = A graph version = As Euler observed: there can be no path crossing each
More informationP vs. NP. Data Structures and Algorithms CSE AU 1
P vs. NP Data Structures and Algorithms CSE 373-18AU 1 Goals for today Define P, NP, and NP-complete Explain the P vs. NP problem -why it s the biggest open problem in CS. -And what to do when a problem
More informationP versus NP. Math 40210, Spring September 16, Math (Spring 2012) P versus NP September 16, / 9
P versus NP Math 40210, Spring 2012 September 16, 2012 Math 40210 (Spring 2012) P versus NP September 16, 2012 1 / 9 Properties of graphs A property of a graph is anything that can be described without
More informationLecture 5: Computational Complexity
Lecture 5: Computational Complexity (3 units) Outline Computational complexity Decision problem, Classes N P and P. Polynomial reduction and Class N PC P = N P or P = N P? 1 / 22 The Goal of Computational
More informationP and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.
Overview Problem classification Tractable Intractable P and NP Reductions Tools for classifying problems according to relative hardness Inge Li Gørtz Thank you to Kevin Wayne, Philip Bille and Paul Fischer
More informationCSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?
CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal? The conjecture that P is different from NP made its way on to several lists of the most important unsolved problems in Mathematics (never
More informationCS 6783 (Applied Algorithms) Lecture 3
CS 6783 (Applied Algorithms) Lecture 3 Antonina Kolokolova January 14, 2013 1 Representative problems: brief overview of the course In this lecture we will look at several problems which, although look
More informationCS/COE
CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct
More informationNP-Complete Problems and Approximation Algorithms
NP-Complete Problems and Approximation Algorithms Efficiency of Algorithms Algorithms that have time efficiency of O(n k ), that is polynomial of the input size, are considered to be tractable or easy
More informationNP-Complete Reductions 1
x x x 2 x 2 x 3 x 3 x 4 x 4 CS 4407 2 22 32 Algorithms 3 2 23 3 33 NP-Complete Reductions Prof. Gregory Provan Department of Computer Science University College Cork Lecture Outline x x x 2 x 2 x 3 x 3
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 20.1 Introduction Definition 20.1.1 We say that an algorithm runs in polynomial time if its running
More informationIntroduction to Computational Complexity
Introduction to Computational Complexity Tandy Warnow October 30, 2018 CS 173, Introduction to Computational Complexity Tandy Warnow Overview Topics: Solving problems using oracles Proving the answer to
More informationArtificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK
Artificial Intelligence 3 Problem Complexity Prof. Dr. Jana Koehler Fall 2016 Agenda Computability and Turing Machines Tractable and Intractable Problems P vs. NP Decision Problems Optimization problems
More informationP versus NP. Math 40210, Spring April 8, Math (Spring 2012) P versus NP April 8, / 9
P versus NP Math 40210, Spring 2014 April 8, 2014 Math 40210 (Spring 2012) P versus NP April 8, 2014 1 / 9 Properties of graphs A property of a graph is anything that can be described without referring
More informationNP Complete Problems. COMP 215 Lecture 20
NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst
More informationAnalysis of Algorithms. Unit 5 - Intractable Problems
Analysis of Algorithms Unit 5 - Intractable Problems 1 Intractable Problems Tractable Problems vs. Intractable Problems Polynomial Problems NP Problems NP Complete and NP Hard Problems 2 In this unit we
More informationP, NP, NP-Complete, and NPhard
P, NP, NP-Complete, and NPhard Problems Zhenjiang Li 21/09/2011 Outline Algorithm time complicity P and NP problems NP-Complete and NP-Hard problems Algorithm time complicity Outline What is this course
More information5. Complexity Theory
Course: Combinatorial Optimisation DOCUMENT LAST MODIFIED: MARCH 2, 2011 VU University Amsterdam 5. Complexity Theory Guido Schäfer March 2011 These lecture notes cover the material of the lectures given
More informationP,NP, NP-Hard and NP-Complete
P,NP, NP-Hard and NP-Complete We can categorize the problem space into two parts Solvable Problems Unsolvable problems 7/11/2011 1 Halting Problem Given a description of a program and a finite input, decide
More informationCS 320, Fall Dr. Geri Georg, Instructor 320 NP 1
NP CS 320, Fall 2017 Dr. Geri Georg, Instructor georg@colostate.edu 320 NP 1 NP Complete A class of problems where: No polynomial time algorithm has been discovered No proof that one doesn t exist 320
More informationGraph Theory and Optimization Computational Complexity (in brief)
Graph Theory and Optimization Computational Complexity (in brief) Nicolas Nisse Inria, France Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, Sophia Antipolis, France September 2015 N. Nisse Graph Theory
More informationBounds on the Traveling Salesman Problem
Bounds on the Traveling Salesman Problem Sean Zachary Roberson Texas A&M University MATH 613, Graph Theory A common routing problem is as follows: given a collection of stops (for example, towns, stations,
More informationMultiple Sequence Alignment: Complexity, Gunnar Klau, January 12, 2006, 12:
Multiple Sequence Alignment: Complexity, Gunnar Klau, January 12, 2006, 12:23 6001 6.1 Computing MSAs So far, we have talked about how to score MSAs (including gaps and benchmarks). But: how do we compute
More informationCS 583: Algorithms. NP Completeness Ch 34. Intractability
CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working
More informationHarvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness
Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harry Lewis November 19, 2013 Reading: Sipser 7.4, 7.5. For culture : Computers and Intractability: A Guide to the Theory
More informationAlgorithm Design and Analysis
Algorithm Design and Analysis LECTURES 30-31 NP-completeness Definition NP-completeness proof for CIRCUIT-SAT Adam Smith 11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova,
More informationP, NP, NP-Complete. Ruth Anderson
P, NP, NP-Complete Ruth Anderson A Few Problems: Euler Circuits Hamiltonian Circuits Intractability: P and NP NP-Complete What now? Today s Agenda 2 Try it! Which of these can you draw (trace all edges)
More informationComputational Complexity
Computational Complexity Problems, instances and algorithms Running time vs. computational complexity General description of the theory of NP-completeness Problem samples 1 Computational Complexity What
More informationCMPT307: Complexity Classes: P and N P Week 13-1
CMPT307: Complexity Classes: P and N P Week 13-1 Xian Qiu Simon Fraser University xianq@sfu.ca Strings and Languages an alphabet Σ is a finite set of symbols {0, 1}, {T, F}, {a, b,..., z}, N a string x
More informationCombinatorial Optimization
Combinatorial Optimization Problem set 8: solutions 1. Fix constants a R and b > 1. For n N, let f(n) = n a and g(n) = b n. Prove that f(n) = o ( g(n) ). Solution. First we observe that g(n) 0 for all
More informationComputer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms
Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds
More informationNP-Complete Problems. More reductions
NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM
More informationNP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.
NP-Completeness ch34 Hewett Problem Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g., O(2 n ) computationally feasible poly-time alg. sol. E.g., O(n k ) No
More informationOutline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm
Outline 1 NP-Completeness Theory 2 Limitation of Computation 3 Examples 4 Decision Problems 5 Verification Algorithm 6 Non-Deterministic Algorithm 7 NP-Complete Problems c Hu Ding (Michigan State University)
More informationLecture 14 - P v.s. NP 1
CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 27, 2018 Lecture 14 - P v.s. NP 1 In this lecture we start Unit 3 on NP-hardness and approximation
More informationAlgorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University
Algorithms NP -Complete Problems Dong Kyue Kim Hanyang University dqkim@hanyang.ac.kr The Class P Definition 13.2 Polynomially bounded An algorithm is said to be polynomially bounded if its worst-case
More informationComputational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9
1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives Classify problems as tractable or intractable Define decision problems Define the class P Define
More informationP and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides
P and NP Inge Li Gørtz Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides 1 Overview Problem classification Tractable Intractable Reductions Tools for classifying problems
More informationIntroduction. Pvs.NPExample
Introduction Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 09 NP-Completeness (Chapter 34) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu I
More informationCS 241 Analysis of Algorithms
CS 241 Analysis of Algorithms Professor Eric Aaron Lecture T Th 9:00am Lecture Meeting Location: OLB 205 Business Grading updates: HW5 back today HW7 due Dec. 10 Reading: Ch. 22.1-22.3, Ch. 25.1-2, Ch.
More informationNon-Deterministic Time
Non-Deterministic Time Master Informatique 2016 1 Non-Deterministic Time Complexity Classes Reminder on DTM vs NDTM [Turing 1936] (q 0, x 0 ) (q 1, x 1 ) Deterministic (q n, x n ) Non-Deterministic (q
More informationNP and NP Completeness
CS 374: Algorithms & Models of Computation, Spring 2017 NP and NP Completeness Lecture 23 April 20, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 44 Part I NP Chandra Chekuri (UIUC) CS374 2 Spring
More informationCOP 4531 Complexity & Analysis of Data Structures & Algorithms
COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According
More informationAlgorithms. Outline! Approximation Algorithms. The class APX. The intelligence behind the hardware. ! Based on
6117CIT - Adv Topics in Computing Sci at Nathan 1 Algorithms The intelligence behind the hardware Outline! Approximation Algorithms The class APX! Some complexity classes, like PTAS and FPTAS! Illustration
More informationComputability and Complexity Theory
Discrete Math for Bioinformatics WS 09/10:, by A Bockmayr/K Reinert, January 27, 2010, 18:39 9001 Computability and Complexity Theory Computability and complexity Computability theory What problems can
More informationAlgorithm Design Strategies V
Algorithm Design Strategies V Joaquim Madeira Version 0.0 October 2016 U. Aveiro, October 2016 1 Overview The 0-1 Knapsack Problem Revisited The Fractional Knapsack Problem Greedy Algorithms Example Coin
More informationSAT, NP, NP-Completeness
CS 473: Algorithms, Spring 2018 SAT, NP, NP-Completeness Lecture 22 April 13, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Part I Reductions Continued Ruta (UIUC)
More informationComplexity, P and NP
Complexity, P and NP EECS 477 Lecture 21, 11/26/2002 Last week Lower bound arguments Information theoretic (12.2) Decision trees (sorting) Adversary arguments (12.3) Maximum of an array Graph connectivity
More informationThe P versus NP Problem. Ker-I Ko. Stony Brook, New York
The P versus NP Problem Ker-I Ko Stony Brook, New York ? P = NP One of the seven Millenium Problems The youngest one A folklore question? Has hundreds of equivalent forms Informal Definitions P : Computational
More informationLecture Notes 4. Issued 8 March 2018
CM30073 Advanced Algorithms and Complexity 1. Structure of the class NP Lecture Notes 4 Issued 8 March 2018 Recall that it is not known whether or not P = NP, the widely accepted hypothesis being that
More informationComplexity Theory: The P vs NP question
The $1M question Complexity Theory: The P vs NP question Lecture 28 (December 1, 2009) The Clay Mathematics Institute Millenium Prize Problems 1. Birch and Swinnerton-Dyer Conjecture 2. Hodge Conjecture
More informationNP-Completeness. Subhash Suri. May 15, 2018
NP-Completeness Subhash Suri May 15, 2018 1 Computational Intractability The classical reference for this topic is the book Computers and Intractability: A guide to the theory of NP-Completeness by Michael
More informationIn complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size.
10 2.2. CLASSES OF COMPUTATIONAL COMPLEXITY An optimization problem is defined as a class of similar problems with different input parameters. Each individual case with fixed parameter values is called
More informationNP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University
NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with
More informationIntractable Problems Part One
Intractable Problems Part One Announcements Problem Set Five due right now. Solutions will be released at end of lecture. Correction posted for Guide to Dynamic Programming, sorry about that! Please evaluate
More information