Intractable Problems Time-Bounded Turing Machines Classes P and NP

Slides:



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

CS 332: Algorithms NP Completeness David Luebke /2/2017.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
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)
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
1 Intractable Problems Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Machines with Memory Chapter 3 (Part B). Turing Machines  Introduced by Alan Turing in 1936 in his famous paper “On Computable Numbers with an Application.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
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.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
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.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
CS 3813: Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
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 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
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
CSC 172 P, NP, Etc.
Design and Analysis of Approximation Algorithms
The NP class. NP-completeness
NP-Complete Problems.
More NP-Complete and NP-hard Problems
Intractable Problems Time-Bounded Turing Machines Classes P and NP
8.2 – Strong NP Completeness
Probabilistic Algorithms
EMIS 8373: Integer Programming
Complexity & the O-Notation
Part VI NP-Hardness.
Growth of functions CSC317.
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Intro to Theory of Computation
Intro to Theory of Computation
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Intractable Problems Time-Bounded Turing Machines Classes P and NP
How Hard Can It Be?.
Intro to Theory of Computation
Decidable Languages Costas Busch - LSU.
Introduction to Finite Automata
CLASSES P AND NP.
Halting Problem.
NP-Complete Problems.
CS154, Lecture 12: Time Complexity
CS 3343: Analysis of Algorithms
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
More NP-Complete Problems
More Undecidable Problems
Instructor: Aaron Roth
Instructor: Aaron Roth
Theory of Computability
The Satisfiability Problem
Presentation transcript:

Intractable Problems Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions

Time-Bounded TM’s A Turing machine that, given an input of length n, always halts within T(n) moves is said to be T(n)-time bounded. The TM can be multitape. Sometimes, it can be nondeterministic. The deterministic, multitape case corresponds roughly to “an O(T(n)) running-time algorithm.”

The class P If a DTM M is T(n)-time bounded for some polynomial T(n), then we say M is polynomial-time (“polytime ”) bounded. And L(M) is said to be in the class P. Important point: when we talk of P, it doesn’t matter whether we mean “by a computer” or “by a TM” (next slide).

Polynomial Equivalence of Computers and TM’s A multitape TM can simulate a computer that runs for time O(T(n)) in at most O(T2(n)) of its own steps. If T(n) is a polynomial, so is T2(n).

Examples of Problems in P Is w in L(G), for a given CFG G? Input = w. Use CYK algorithm, which is O(n3). Is there a path from node x to node y in graph G? Input = x, y, and G. Use Dijkstra’s algorithm, which is O(n log n) on a graph of n nodes and arcs.

Running Times Between Polynomials You might worry that something like O(n log n) is not a polynomial. However, to be in P, a problem only needs an algorithm that runs in time less than some polynomial. Surely O(n log n) is less than the polynomial O(n2).

A Tricky Case: Knapsack The Knapsack Problem is: given positive integers i1, i2 ,…, in, can we divide them into two sets with equal sums? Perhaps we can solve this problem in polytime by a dynamic-programming algorithm: Maintain a table of all the differences we can achieve by partitioning the first j integers.

Knapsack – (2) Basis: j = 0. Initially, the table has “true” for 0 and “false” for all other differences. Induction: To consider ij, start with a new table, initially all false. Then, set k to true if, in the old table, there is a value m that was true, and k is either m+ij or m-ij.

Knapsack – (3) Suppose we measure running time in terms of the sum of the integers, say m. Each table needs only space O(m) to represent all the positive and negative differences we could achieve. Each table can be constructed in time O(n).

Knapsack – (4) Since n < m, we can build the final table in O(m2) time. From that table, we can see if 0 is achievable and solve the problem.

Subtlety: Measuring Input Size “Input size” has a specific meaning: the length of the representation of the problem instance as it is input to a TM. For the Knapsack Problem, you cannot always write the input in a number of characters that is polynomial in either the number-of or sum-of the integers.

Knapsack – Bad Case Suppose we have n integers, each of which is around 2n. We can write integers in binary, so the input takes O(n2) space to write down. But the tables require space O(n2n). They therefore require at least that order of time to construct.

Bad Case – (2) Thus, the proposed “polynomial” algorithm actually takes time O(n22n) on an input of length O(n2). Or, since we like to use n as the input size, it takes time O(n2sqrt(n)) on an input of length n. In fact, it appears no algorithm solves Knapsack in polynomial time.

The Class NP The running time of a nondeterministic TM is the maximum number of steps taken along any branch. If that time bound is polynomial, the NTM is said to be polynomial-time bounded. And its language/problem is said to be in the class NP.

Example: NP The Knapsack Problem is definitely in NP, even using the conventional binary representation of integers. Use nondeterminism to guess one of the subsets. Sum the two subsets and compare.

P Versus NP Originally a curiosity of Computer Science, mathematicians now recognize as one of the most important open problems the question P = NP? There are thousands of problems that are in NP but appear not to be in P. But no proof that they aren’t really in P.

Complete Problems One way to address the P = NP question is to identify complete problems for NP. An NP-complete problem has the property that if it is in P, then every problem in NP is also in P. Defined formally via “polytime reductions.”

NP-Complete Problems A problem/language M is said to be NP-complete if for every language L in NP, there is a polytime reduction from L to M. Fundamental property: if M has a polytime algorithm, then L also has a polytime algorithm. I.e., if M is in P, then every L in NP is also in P, or “P = NP.”