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.

Slides:



Advertisements
Similar presentations
Limitation of Computation Power – P, NP, and NP-complete
Advertisements

JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
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.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Tractable and intractable problems for parallel computers
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
P, NP, and NP-Complete Suzan Köknar-Tezel.
NP and NP- Completeness Bryan Pearsaul. Outline Decision and Optimization Problems Decision and Optimization Problems P and NP P and NP Polynomial-Time.
NP-complete and NP-hard problems. Decision problems vs. optimization problems The problems we are trying to solve are basically of two kinds. In decision.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Hardness Results for Problems
Programming & Data Structures
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:
CSCE350 Algorithms and Data Structure
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.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
P and NP. Computational Complexity Recall from our sorting examples at the start of class that we could prove that any sort would have to do at least.
P and NP.
CSC 413/513: Intro to Algorithms NP Completeness.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
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.
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 Computability Tractable, Intractable and Non-computable functions.
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.
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.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
P & NP.
Chapter 10 NP-Complete Problems.
Lecture 2-2 NP Class.
Analysis and design of algorithm
ICS 353: Design and Analysis of Algorithms
CLASSES P AND NP.
Chapter 11 Limitations of Algorithm Power
P, NP and NP-Complete Problems
P, NP and NP-Complete Problems
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

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 for any one of them, we would have efficient algorithms for all of them. Such an algorithm has never been found, but it’s never been proven that one is not possible. This kind of problems are called NP-complete problems and are introduces in this chapter. A problem for which an efficient algorithm is not possible is said to be intractable..

3 Interacability A problem in computer science is intracable if a computer has difficulty solving it that is it is impossible to solve it with a polynomial-time algorithm. Polynomial-time algorithm is one whose worst-case time complexity is bounded above by a polynomial function of its input size. For a problem to be intractable there must be no polynomial-time algorithm that solves it.

4 Interacability(Contd..) Furthermore, many algorithms whose worst-case time complexities are not polynomials have efficient running times for many actual instances. This is the case for many backtracking and branch-and-bound algorithms. There are three general categories of problems as far as intractability is concerned:  Problems for which polynomial-time algorithms have been found  Problems that have been proven to be intractable  Problems that have not been proven to be intractable, but for which polynomial-time algorithms have never been found

5 The Three General Problem Categories We have three general categories in which problems can be grouped as far as intractability is concerned. 1. Problems for Which Polynomial-Time Algorithms Have Been Found Any problem for which we have found a poly-time algorithm Sorting, searching, matrix multiplication, chained matrix multiplication, shortest paths, minimal spanning tree, etc.

6 2.Problems That Have Been Proven to Be Intractable There are two types of problems in this category. The first type is problems that require a non-polynomial amount of output such as the problem of determining all Hamiltonian Circuits. If there was an edge from every vertex to every other vertex, there would be (n - 1)! such circuits. To solve the problem, an algorithm would have to output all of these circuits, which means that our request is not reasonable. It is straightforward to recognize that a non- polynomial amount of output is being requested, and once we recognize this, we realize that we are simply asking for more information than we could possibly use. That is, the problem is not defined realistically.

7 2.Problems That Have Been Proven to Be Intractable (Contd..) The second type of those that produce a reasonable amount of output, but the processing time is just too long. The most well-known of these is the Halting problem. In this problem we take as input any algorithm and any input to that algorithm, and decide whether or not the algorithm will halt when applied to that input.

8 3. Problems That Have Not Been Proven to Be Intractable Problems That Have Not Been Proven to Be Intractable but for Which Polynomial-Time Algorithms Have Never Been Found This category includes any problem for which a polynomial-time algorithm has never been found, but yet no one has ever proven that such an algorithm is not possible. Many problems belong in the category such as 0-1 Knapsack, Traveling Salesperson, m-coloring, Hamiltonian Circuits. In general, any problem that we had to solve using backtracking or bounded backtracking falls into this category

9 The Theory of NP It will be more convenient to develop this theory restricting ourselves to decision problems Problems that have a yes/no answer We can always convert non-decision problems into decision problems In 0/1 Knapsack instead of just asking for the optimal profit, we can instead ask if the optimal profit exceeds some number In graph coloring instead of just asking the minimal number of colors we can instead ask if the minimal number is less than m

10 The Sets P and NP The set P is the set of all decision problems that can be solved by polynomial-time algorithms. All decision problems for which we have found poly-time algorithms are certainly in P. For example, the problem of determining whether a key is present in an array, the problem of determining whether a key is present in a sorted array, and the decision problems corresponding to the optimization problems.

11 The Sets P(Contd..) Can decision problem for which we have not found a polynomial-time algorithm also be in P? An example is the Traveling Salesperson problem. Even though no one has ever created a polynomial-time algorithm that solves this problem, no one has ever proven that it cannot be solved with a polynomial time algorithm. Therefore, it could possibly be in P. To know that a decision problem is not in P, we have to prove that it is not possible to develop a polynomial-time algorithm for it.

12 The set NP : The set NP is the set of all decision problems that can be solved by a polynomial-time non-deterministic algorithm. For a decision problem to be in NP there must be an algorithm that does the verification in polynomial time. Because this is the case for the Traveling Salesperson Decision problem, that problem is in NP. This does not mean that we necessarily have a polynomial-time algorithm that solves the problem. A poly-time non-deterministic algorithm is an algorithm that is broken into 2 stages: Guessing (non-deterministic) stage Verification (deterministic) stage Where the verification stage can be accomplished in polynomial-time

13 NP-Complete Problems To date, no one has found a polynomial-time algorithm for the Traveling Salesperson problem. On the other hand, no one has been able to prove that no polynomial- time algorithm exists for it. How, then, can we argue persuasively that the Traveling Salesperson problem and many problems in NP are “intractable”? Instead, we offer an argument that is slightly weaker but also compelling. We show that the recognition version of the Traveling Salesperson problem, and scores of other NP problems, are the hardest problems in the class NP in the following sense: if there is a polynomial-time algorithm for any one of these problems, then there is a polynomial-time algorithm for every problem in NP. Problems in NP with this property are called NP- complete.

P And NP Summary P = set of problems that can be solved in polynomial time NP = set of problems for which a solution can be verified in polynomial time P  NP