Computability Theory

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

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

BBM402-Lecture 11: The Class NP

CS154, Lecture 13: P vs NP

Computational Models Lecture 11, Spring 2009

CS154, Lecture 13: P vs NP

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

Chapter 7: Time Complexity

Lecture 19: Finish NP-Completeness, conp and Friends

Time Complexity. CS60001: Foundations of Computing Science

CISC 4090 Theory of Computation

Theory of Computation Time Complexity

CSE 135: Introduction to Theory of Computation NP-completeness

Computability and Complexity

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

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

Lecture 16: Time Complexity and P vs NP

1 Non-deterministic Turing Machine

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Lecture 20: conp and Friends, Oracles in Complexity Theory

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation

conp, Oracles, Space Complexity

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

22c:135 Theory of Computation. Analyzing an Algorithm. Simplifying Conventions. Example computation. How much time does M1 take to decide A?

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

Finish K-Complexity, Start Time Complexity

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

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

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

Computational complexity

1 Computational Problems

Computability Theory

Time and space classes

Notes for Lecture Notes 2

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

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

Could we potentially place A in a smaller complexity class if we consider other computational models?

Computational Complexity

Lecture 3: Nondeterminism, NP, and NP-completeness

Chapter 2 : Time complexity

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Complexity (Pre Lecture)

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Advanced Topics in Theoretical Computer Science

Complexity Theory Part II

1 Computational problems

CS 6505, Complexity and Algorithms Week 7: NP Completeness

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

Intro to Theory of Computation

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Computability Theory

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

NP-Complete Problems. More reductions

Essential facts about NP-completeness:

CS5371 Theory of Computation. Lecture 18: Complexity III (Two Classes: P and NP)

NP-problems continued

NP Complete Problems. COMP 215 Lecture 20

Formal definition of P

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Introduction. Pvs.NPExample

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

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

Theory of Computation Chapter 9

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

Week 2: Defining Computation

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

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

Advanced topic: Space complexity

Introduction to Complexity Theory

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007

Lecture 13, Fall 04/05

Design and Analysis of Algorithms

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Computability Theory

q FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring L. Blum. REVIEW for Midterm 2 TURING MACHINE

NP-problems continued

13.1 Nondeterministic Polynomial Time

Intro to Theory of Computation

CPSC 421: Tutorial #1

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

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

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

Problems, and How Computer Scientists Solve Them Manas Thakur

Theory of Computation

Lecture Notes: The Halting Problem; Reductions

CMPT307: Complexity Classes: P and N P Week 13-1

Lecture Notes 4. Issued 8 March 2018

Limits of Feasibility. Example. Complexity Relationships among Models. 1. Complexity Relationships among Models

6.045 Final Exam Solutions

Computer Sciences Department

Complexity, P and NP

Data Structures in Java

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

Transcription:

CS:4330 Theory of Computation Spring 2018 Computability Theory The class NP Haniel Barbosa

Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Section 7.3.

Question Why are we unsuccessful in finding polynomial time algorithms for some problems? Did not try hard enough? Perhaps such problems have, as yet undiscovered, polynomial time algorithms that rely on unknown principles Maybe some of such problems simply cannot be solved in polynomial time. They may be intrinsically difficult. Trying to answer this central question we start to realize how the complexities of many problems are linked. We further investigate these connections now. 1 / 17

Example Hamiltonian path problem: A Hamiltonian path in a directed graph G is a path that goes through each node of G exactly once Hamiltonian path problem consists of testing whether a directed graph G contains a Hamiltonian path connecting two specified nodes HAMPATH = { G,s,t G is a directed graph with a Hamiltonian path from s to t} It is easy to obtain an exponential algorithm to solve HAMPATH, however nobody knows whether a polynomial one exists. 2 / 17

Polynomial Verifiability The HAMPATH problem has a feature called polynomial verifiability which is important for understanding its complexity: If a Hamiltonian path in a graph G is discovered (no matter how) we could easily convince someone else of its existence, simply by presenting it! This is, verifying the existence of a Hamiltonian graph may be much easier than determining its existence. 3 / 17

Another example Another example of polynomially verifiable problem is number compositeness. A natural number is composite if it is not prime. Let COMPOSITES = {x x N and x = pq s.t. p,q N, p > 1 and q > 1} It can easily be verified that a number x is composite, all that is needed is a divisor of x 4 / 17

Note There are problems that may not be polynomially verifiable For example, HAMPATH, the complement of HAMPATH, is not polynomial time verifiable Even if we could determine that a graph did not have a Hamiltonian path we don t know a way for verifying its nonexistence without using the same exponential time algorithm that determined its nonexistence! 5 / 17

Verifier Definition A verifier for a language A is a an algorithm V such that A = {w V accepts w,c for some string c} We measure the time of a verifier only in terms of the length of w, so a polymial time verifier runs in polynomial time in the length of w. A language A is polynomially verifiable if it has a polynomial time verifier. A verifier uses additional information, represented by c in the definition This information is called a certificate, or proof, of membership The certificate must have polynomial length w.r.t. the length of w For example, the certificate for G,s,t HAMPATH is a Hamiltonian path between s and t; the certificate for x COMPOSITES is a divisor p of x 6 / 17

The class NP Definition NP is the class of languages that have polynomial time verifiers. The term NP comes from nondeterministic polynomial time and is derived from an alternative characterization using nondeterministic polynomial time Turing machines NP class is important because it contains many problems of practical interest. For example HAMPATH, COMPOSITES NP Moreover, COMPOSITES P, but proving it is more difficult 7 / 17

An NTM deciding HAMPATH N 1 = On input string G,s,t where G is a directed graph containing nodes s,t: 1. Write a list of m numbers p 1,..., p m where m is the number of nodes in G. Each p i is nondeterministically selected between 1 and m. 2. Check for repetitions in the list. If any are found, reject 3. Check whether s = p 1 and t = p m. If either fails, reject 4. For each i, 1 i m, check whether p 1,p i+1 is an edge of G. If any are not, reject. Otherwise, accept. Each stage clearly runs ins nondeterministic polynomial time, thus so does N 1. 8 / 17

Redefining NP in terms of NTMs Theorem A language is in NP iff it is decided by some nondeterministic polynomial time Turing machine. Proof idea We show how to convert a polynomial time verifier to an equivalent polynomial time NTM and vice-versa The verifier simulates the NTM by using the accepting branches as certificates 9 / 17

Proof For the forward direction we consider a language A NP and show that A is decidable by a polynomial time NTM Assume V is a polynomial time verifier deciding A in time n k. The NTM N V equivalent to V works as follows: N V = On input string w of length n: 1. Nondeterministically select a string c of length at most n k 2. Run V on input w,c 3. If V accepts, accept. Otherwise, reject. For the other direction, assume that A is decided by a polynomial time NTM and construct a polynomial verifier V N that decides A: V N = On input w,c where w and c are strings: 1. Simulate N on input w using each symbol of c as a description of the nondeterministic choice to make at each step (see NTM computation simulation) 2. If this branch of N s computation accepts, accept. Otherwise, reject. 10 / 17

Class NTIME(t(n)) Definition The nondeterministic time complexity class NTIME(t(n)) is defined by NTIME(t(n)) = {L L is a language decided by an O(t(n)) NTM} With this definition a corollary of the previous theorem is that Corollary NP = NTIME(n k ) k 11 / 17

Observations The class NP is insensitive to the choice of reasonable nondeterministic computation model because all such models are polynomially equivalent When describing and analyzing nondeterministic polynomial time algorithms we follow the notation conventions set up for deterministic polynomial time algorithms Each must have an obvious implementation in nondeterministic polynomial time on a reasonable nondeterministic computational model Algorithm analysis must show that every branch uses at most polynomially many stages 12 / 17

Example: Undirected graphs and cliques A clique in an undirected graph is a subgraph wherein every two nodes are connected by an edge A k-clique is a clique containing k nodes The clique problem is to determine whether a graph contains a clique of a specified size. Let CLIQUE = { G,k G is an undirected graph with a k-clique} Theorem CLIQUE NP 13 / 17

Example: Undirected graphs and cliques Proof idea: The clique is the certificate. The following is a verifier V for CLIQUE: V = On input G,k,c : 1. Test whether c is a set of k nodes in G 2. Test whether G contains all edges connecting nodes in c 3. If both pass, accept. Otherwise, reject. Alternative proof idea: If one prefers to think in terms of polynomial time NTM one can construct the following NTM N that decides CLIQUE: N = On input G, k where G is an undirected graph: 1. Nondeterministically select a subset C of k nodes of G 2. Test whether all nodes in c are connected and whether G contains all edges connecting nodes in C 3. If yes, accept. Otherwise, reject. 14 / 17

Example: SUBSET-SUM problem A collection of k integers x 1,..., x k and a target number t are given. We want to determine whether this collection contains a subcollection that adds up to t S,t S = {x 1,..., x k } and for some C = {y 1,..., y l } S we have SUBSET-SUM = i=l y i = t i=1 Example: {4,11,16,21,27},25 SUBSET-SUM since 4 + 21 = 25 {x 1,..., x k } and {y 1,..., y l } may be multisets (i.e. elements may be repeated) Theorem SUBSET-SUM NP 15 / 17

Example: SUBSET-SUM problem Proof idea: the subset is the certificate. The following is a verifier V for SUBSET-SUM: V = On input S,t,c : 1. Test whether c is a collection of numbers that sum to t 2. Test whether S contains all the numbers in C 3. If both pass, accept. Otherwise, reject. Alternative proof idea: We can also prove this theorem given the NTM N that decides SUBSET-SUM: N = On input S,t : 1. Nondeterministically select a subset C of numbers in S 2. Test whether C is a collection of numbers that sum to t 3. If the test passes, accept. Otherwise, reject. 16 / 17

Observations Generally, verifying that something is not present is more difficult than that it is present Note that CLIQUE and SUBSET-SUM are not obviously members of NP A separate complexity class denoted conp contains all languages that are complements of languages in NP class It is an open question whether NP is different from conp 17 / 17