CLASSES P AND NP.

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Complexity Classes: P and NP
Time Complexity P vs NP.
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,
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Chapter 11: Limitations of Algorithmic Power
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
Section 11.4 Language Classes Based On Randomization
MCS312: NP-completeness and Approximation Algorithms
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:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
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.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
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.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
LIMITATIONS OF ALGORITHM POWER
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
1 Chapter 10 Intractable Problems Switzerland Lion Monument in Lucerne.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
© M. Winter COSC/MATH 4P61 - Theory of Computation Minimum-weight Spanning Tree Weighted Graph Spanning.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
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.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
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.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
The NP class. NP-completeness
NP-Complete Problems.
CSE 105 theory of computation
P & NP.
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Chapter 12: Theory of Computation
EMIS 8373: Integer Programming
Lecture 2-2 NP Class.
Part VI NP-Hardness.
Time Complexity Costas Busch - LSU.
1.5 Intractable problems.
Lecture 22 Complexity and Reductions
Lecture 5 NP Class.
Other Models of Computation
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Intro to NP Completeness
Intractable Problems Time-Bounded Turing Machines Classes P and NP
How Hard Can It Be?.
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Computational Complexity
CSE838 Lecture notes copy right: Moon Jung Chung
Time Complexity We use a multitape Turing machine
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.
P, NP and NP-Complete Problems
What is Computer Science About? Part 2: Algorithms
The Polynomial Hierarchy Enumeration Problems 7.3.3
Instructor: Aaron Roth
CSE 105 theory of computation
Week 11 - Wednesday CS221.
Presentation transcript:

CLASSES P AND NP

Intractability The class of problem that can be solved by non deterministic TM’s operating in polynomial time includes atleast some problems that cannot be solved by deterministic TM’s operating in polynomial time. All these problems have polynomial-time deterministic solutions or none (they may require exponential time).

Class P A language L is in class P if L can be recognized by a Turing machine M where M runs in polynomial time, i.e., if M is given an input w of length n, M will halt after making at most f(n) steps where f(n) is a polynomial function of n. Equivalently, a language L is in class P if there is a polynomial time algorithm to solve the problem of L.

Class P A problem is tractable if its language is in class P. These are the problems we work on everyday, e.g., minimum-weight spanning-tree problem, sorting, binary search, matrix multiplication, etc. They can be solved efficiently.

Class P A TM M is said to be of time complexity T(n) if whenever M is given an input w of length n, M halts after making at most T(n) moves, regardless of whether or not M accepts. Examples: Any function T(n), T(n) = 50n2 Finding a MWST for a graph.

Finding a MWST for a graph Solve using Kruskal’s algorithm Input: Possible code for the graph and weight limits An input of length n can represent at most O(n/log n) edges. Using Multitape TM it takes O(n2) steps to implement the algorithm. Single tape ? Extra tapes for several jobs: One to store the nodes and their current component numbers. Length is O(n) Store, Scan edges that hold least edge – weight, takes O(n) time. Find components of the two nodes connected, O(n) times Merge nodes that are to be connected.

Class NP A language L is in class NP if L can be recognized by a non-deterministic Turing machine M where M runs in polynomial time. Equivalently, a language L is in class NP if there is a polynomial time algorithm to check the validity of a certificate for the problem of L.

Class NP Examples are the Satisfiability Problem, the Traveling Salesman Problem, the Hamilton-Circuit Problem, …, etc. For example, in the TSP, we can “guess” a permutation of the nodes and “check” in polynomial time whether the total weight of this route is within the given bound, i.e., a valid certificate. If it has a hamilton circuit? Total time is O(m!), in using NTM then it is O(n2) in multitape. In single tape O(n4)

Class NP It is one of the top ten most important open questions in mathematics whether the class P is equal to the class NP. P = NP

Where is RE and CFL? NP P NPC Recursive Recursively Enumerable (RE) Ld Where is RE and CFL? NP P NPC ULP Halting Problem Recursive Recursively Enumerable (RE) PCP Non-Recursively Enumerable (Non-RE)

NP-Complete A language L is NP-Complete if L itself is in NP and every language L’ in NP can be reduced to L in polynomial time. That means, for any instance I’ of the problem of L’, we can construct an instance I of the problem of L such that the answer to I is yes (no) iff the answer to I’ is yes (no).

NP-Hard A language L is NP-Hard if every language L’ in NP can be reduced to L in polynomial time. Note that L is not necessarily in NP itself.