Intro to Theory of Computation

Similar documents
NP and Computational Intractability

COP 4531 Complexity & Analysis of Data Structures & Algorithms

Intro to Theory of Computation

Algorithm Design and Analysis

Algorithm Design and Analysis

4/22/12. NP and NP completeness. Efficient Certification. Decision Problems. Definition of P

4/19/11. NP and NP completeness. Decision Problems. Definition of P. Certifiers and Certificates: COMPOSITES

Algorithms Design & Analysis. Approximation Algorithm

CS154, Lecture 13: P vs NP

8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability. Classify Problems

Chapter 2 : Time complexity

CS154, Lecture 13: P vs NP

3/22/2018. CS 580: Algorithm Design and Analysis. 8.3 Definition of NP. Chapter 8. NP and Computational Intractability. Decision Problems.

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

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

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

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

Lecture 19: Finish NP-Completeness, conp and Friends

CSE 135: Introduction to Theory of Computation NP-completeness

BBM402-Lecture 11: The Class NP

Computational Intractability 2010/4/15. Lecture 2

CSE 105 THEORY OF COMPUTATION

Lecture 4: NP and computational intractability

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

7.8 Intractability. Overview. Properties of Algorithms. Exponential Growth. Q. What is an algorithm? A. Definition formalized using Turing machines.

Chapter 7: Time Complexity

Announcements. Analysis of Algorithms

Chapter 8. NP and Computational Intractability. CS 350 Winter 2018

CSE 105 THEORY OF COMPUTATION

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

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

Theory of Computation Time Complexity

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

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

CSE 105 Theory of Computation

Time Complexity. CS60001: Foundations of Computing Science

NP-Complete problems

Algorithm Design and Analysis

Intro to Theory of Computation

Lecture 20: conp and Friends, Oracles in Complexity Theory

Essential facts about NP-completeness:

7.8: Intractability. Overview. Exponential Growth. Properties of Algorithms. What is an algorithm? Turing machine.

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

NP and NP Completeness

1 Non-deterministic Turing Machine

10.3: Intractability. Overview. Exponential Growth. Properties of Algorithms. What is an algorithm? Turing machine.

Topics in Complexity Theory

P and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.

Lecture 18: PCP Theorem and Hardness of Approximation I

Computability Theory

SAT, NP, NP-Completeness

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

CSCI3390-Lecture 14: The class NP

On the Computational Hardness of Graph Coloring

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

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

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Lecture 16: Time Complexity and P vs NP

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

Introduction to Complexity Theory. Bernhard Häupler. May 2, 2006

CSE 105 THEORY OF COMPUTATION

1. Introduction Recap

More NP-Complete Problems

Umans Complexity Theory Lectures

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

conp = { L L NP } (1) This problem is essentially the same as SAT because a formula is not satisfiable if and only if its negation is a tautology.

Computational Models Lecture 11, Spring 2009

NP completeness and computational tractability Part II

Complexity Theory Part II

P and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides

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

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

Lecture 3: Nondeterminism, NP, and NP-completeness

P, NP, NP-Complete, and NPhard

Computability and Complexity

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

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

fsat We next show that if sat P, then fsat has a polynomial-time algorithm. c 2010 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 425

NP-Completeness. Until now we have been designing algorithms for specific problems

Computability and Complexity Theory: An Introduction

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

Computational complexity

NP-Complete Reductions 1

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

Approximation Algorithms

CSCI3390-Second Test with Solutions

Chapter 34: NP-Completeness

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

NP-Complete Problems. More reductions

Approximation and Randomized Algorithms (ARA) Lecture 2, September 1, 2010

Complexity, P and NP

CP405 Theory of Computation

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

conp, Oracles, Space Complexity

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

Sparse analysis Lecture II: Hardness results for sparse approximation problems

A An Overview of Complexity Theory for the Algorithm Designer

NP-problems continued

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

Intro to Theory of Computation

Transcription:

Intro to Theory of Computation LECTURE 24 Last time Relationship between models: deterministic/nondeterministic Class P Today Class NP Sofya Raskhodnikova Homework 9 due Homework 0 out 4/5/206 L24.

I-clicker question (frequency: AC) Consider the following algorithm A for PRIMES. Given b, try to divide b by 2,3,, b. If one of them divides b, accept; o.w. reject. If n = input length, # of divisions A performs is A. Θ( n ) B. Θ(n ) C. 2 Θ(n) Θ( n) D. 2 E. None of the above. 3/7/206 L22.2

Central ideas Poly-time as feasible most natural problems either are easy (say in TIME(n 3 )) or have no known poly-time algorithms P =languages that can be decided in poly-time NP = languages for which the membership in the language is easy to verify given a hint EXP = languages that can be decided in exponential time Poly-time Reductions: X is no harder than Y for poly-time TMs 4/5/206 L24.3

The class P P is the class of languages decidable in polynomial time on a deterministic -tape TM: P = k TIME n k. 4/5/206 L24.4

Examples of languages in P Problem Description Algorithm Yes No MULTIPLE Is x a multiple of y? Grade school division 5, 7 5, 6 RELPRIME Are x and y relatively prime? Euclid (300 BCE) 34, 39 34, 5 PRIMES Is x prime? AKS (2002) 53 5 all CFLs (e.g. the language of balanced parentheses and brackets) Is the string in the given CFL? (e.g., is the string of parentheses and brackets balanced?) Dynamic programming Depends on the language; e.g. (([])[]) Depends on the language; e.g. ([)], (() LSOLVE Is there a vector x that satisfies Ax = b? Gauss-Edmonds elimination 0 2 0 4 3 2 5, 2 4 36 0 0 0, 4/7/206 L24.5

Class NP Verification algorithm intuition Verifier views things from "managerial" viewpoint. Verifier doesn't determine whether w L on its own; rather, it checks with a proposed hint whether w L. Algorithm V( w, c ) is a verifier for language L if for every string w, w L iff there exists a string c such that V( w, c ) accepts. "certificate" or "witness" The running time of a verifier is measured only in terms of length of w. A polynomial-time verifier runs in time polynomial in w and has certificate c of length polynomial in w: i.e., c =O( w k ) for some constant k. 4/5/206 L24.6

The class NP NP is the class of languages that have polynomial-time verifiers. 4/5/206 L24.7

Examples of languages in NP COMPOSITES = { x x = pq, for int p, q > } certificate: integer p > that divides x such a certificate exists iff x is composite verifier V = `` On input x, p, where x and p are integers:. If p or p x, reject. 2. Else if (x is a multiple of p, accept. O.w. reject. 4/5/206 L24.8

Examples of languages in NP UHamCycle = { G G is an undirected graph that contains a cycle C that visits each node exactly once} certificate C: Hamiltonian cycle (i.e., permutation of the nodes) graph G certificate C 4/5/206 L24.9

Examples of languages in NP UHamCycle = { G G is an undirected graph that contains a cycle C that visits each node exactly once} certificate C: Hamiltonian cycle (i.e., permutation of the nodes) verifier V = `` On input G, C :. Accept if 2. each node of G appears in C exactly once 3. there is an edge between every pair of adjacent nodes in C 4. O.w. reject. 4/5/206 L24.0

Examples of languages in NP: SAT Boolean variables: variables that can take on values T/F (or /0) Boolean operations:,, and Boolean formula: expression with Boolean variables and ops Example: x x 2 x 3 An assignment of 0s and s to the variables satisfies formula φ if it makes it evaluate to. φ is satisfiable if there exists an assignment that satisfies it. Prove: SAT NP. SAT ={ φ φ is a satisfiable Boolean formula}. 4/5/206 L24.

Classes P, NP, EXP P. Languages for which there is a poly-time algorithm. algorithm that runs in time O(n k ) for some k EXP. Languages for which there is an exponential-time algorithm. algorithm that runs in time O(2 nk ) for some k NP. Languages for which there is a poly-time verifier. Lemma. P NP. Lemma. NP EXP. Lemma. A language L is in NP iff L can be decided by a polynomial-time nondeterministic TM. 4/7/206 L24.2

P vs. NP Does P = NP? [Cook 97, Edmonds, Levin, Yablonski, Gödel] Is the decision problem as easy as the verification problem? Clay $ million prize. EXP P NP EXP P = NP If P NP If P = NP If yes: Efficient algorithms for UHamPath, SAT, TSP, factoring If no: No efficient algorithms possible for these problems. Consensus opinion on P = NP? Probably no. would break RSA cryptography (and potentially collapse economy) 4/5/206 L24.3