Intractable Problems [HMU06,Chp.10a]

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

NP-Completeness and Boolean Satisfiability

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

COSE215: Theory of Computation. Lecture 21 P, NP, and NP-Complete Problems

CSE 105 THEORY OF COMPUTATION

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Chapter 7: Time Complexity

Introduction to Complexity Theory

ECS 120 Lesson 24 The Class N P, N P-complete Problems

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

CSE 135: Introduction to Theory of Computation NP-completeness

Computability and Complexity

CMSC 441: Algorithms. NP Completeness

CSE 105 THEORY OF COMPUTATION

Comparison of several polynomial and exponential time complexity functions. Size n

P and NP. Or, how to make $1,000,000.

Time Complexity. CS60001: Foundations of Computing Science

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

CISC 4090 Theory of Computation

CS154, Lecture 17: conp, Oracles again, Space Complexity

Essential facts about NP-completeness:

CS154, Lecture 13: P vs NP

Theory of Computation

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

Time-bounded computations

CSE 105 Theory of Computation

Computational Models Lecture 11, Spring 2009

Definition: conp = { L L NP } What does a conp computation look like?

Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?

1 Computational Problems

CSE 105 THEORY OF COMPUTATION

NP, polynomial-time mapping reductions, and NP-completeness

CS154, Lecture 13: P vs NP

Notes for Lecture Notes 2

Finish K-Complexity, Start Time Complexity

BBM402-Lecture 11: The Class NP

Beyond NP [HMU06,Chp.11a] Tautology Problem NP-Hardness and co-np Historical Comments Optimization Problems More Complexity Classes

Lecture 21: Space Complexity (The Final Exam Frontier?)

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Lecture 4 : Quest for Structure in Counting Problems

Analysis of Algorithms. Unit 5 - Intractable Problems

conp, Oracles, Space Complexity

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK

Advanced Topics in Theoretical Computer Science

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Complexity Theory Part II

Computational Complexity

Friday Four Square! Today at 4:15PM, Outside Gates

Acknowledgments 2. Part 0: Overview 17

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

Lecture 16: Time Complexity and P vs NP

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Problems, and How Computer Scientists Solve Them Manas Thakur

CP405 Theory of Computation

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

NP Completeness and Approximation Algorithms

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

Turing s original paper (1936)

Lecture 3: Reductions and Completeness

1 Computational problems

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Lecture 3: Nondeterminism, NP, and NP-completeness

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Complexity Theory Part I

13.1 Nondeterministic Polynomial Time

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring l. Blum TIME COMPLEXITY AND POLYNOMIAL TIME;

Polynomial Space. The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem

Computability and Complexity CISC462, Fall 2018, Space complexity 1

CS151 Complexity Theory. Lecture 1 April 3, 2017

Space Complexity. The space complexity of a program is how much memory it uses.

Computational Complexity

CS20a: NP completeness. NP-complete definition. Related properties. Cook's Theorem

CS154 Final Examination

1 Non-deterministic Turing Machine

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

Lecture 19: Finish NP-Completeness, conp and Friends

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity

NP Complete Problems. COMP 215 Lecture 20

CSC 1700 Analysis of Algorithms: P and NP Problems

where Q is a finite set of states

NP-Completeness. NP-Completeness 1

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

Design and Analysis of Algorithms

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Lecture 20: conp and Friends, Oracles in Complexity Theory

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems

Lecture 22: PSPACE

Transcription:

Intractable Problems [HMU06,Chp.10a] Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions A 10 Minute Motivation https://www.youtube.com/watch?v=yx40hbahx3s 1

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. 2

The Class P 3

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). 4

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(T 2 (n)) of its own steps. If T(n) is a polynomial, so is T 2 (n). 5

Examples of Problems in P Is w in L(G), for a given CFG G? Input = w. Use CYK algorithm, which is O(n 3 ). 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. 6

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(n 2 ). 7

A Tricky Case: Knapsack The Knapsack Problem is: given positive integers i 1, i 2,, i n, can we divide them into two sets with equal sums? It appears no algorithm can solve Knapsack in polynomial time. 8

The Class NP 17

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. 18

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. Others: Traveling Salesman Problem, and many others. 19

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. Note: Problems in NP\P are solvable in 20 exponential time on a DTM.

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. 21

Complete Problems Intuition A complete problem for a class embodies every problem in the class, even if it does not appear so. Compare: PCP embodies every TM computation, even though it does not appear to do so. Strange but true: Knapsack embodies every polytime NTM computation. 22

Polynomial-Time Reductions 23

Polytime Reductions Goal: find a way to show problem L to be NP-complete by reducing every language/problem in NP to L in such a way that if we had a deterministic polytime algorithm for L, then we could construct a deterministic polytime algorithm for any problem in NP. 24

Polytime Reductions (2) We need the notion of a polytime transducer a TM that: 1. Takes an input of length n. 2. Operates deterministically for some polynomial time p(n). 3. Produces an output on a separate output tape. Note: output length is at most p(n). 25

Polytime Transducer state input n scratch tapes output < p(n) Remember: important requirement is that time < p(n). 26

Polytime Reductions (3) Let L and M be languages. Say L is polytime reducible to M if there is a polytime transducer T such that for every input w to T, the output x=t(w) M iff w L. 27

Picture of Polytime Reduction in L not in L T in M not in M 28

NP-Complete Problems A problem/language M is said to be NPcomplete 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. 29

All of NP polytime reduces to SAT, which is therefore NP-complete The Plan SAT polytime reduces to 3-SAT SAT 3- SAT NP 3-SAT polytime reduces to many other problems; they re all NP-complete 30

Proof That Polytime Reductions Work Suppose M has an algorithm of polynomial time q(n). Let L have a polytime transducer T to M, taking polynomial time p(n). The output of T, given an input of length n, is at most of length p(n). The algorithm for M on the output of T takes time at most q(p(n)). 31

Proof (2) We now have a polytime algorithm for L: 1. Given w of length n, use T to produce x of length < p(n), taking time < p(n). 2. Use the algorithm for M to tell if x is in M in time < q(p(n)). 3. Answer for w is whatever the answer for x is. Total time < p(n) + q(p(n)) = a polynomial. 32