The Complexity Classes P and NP. Andreas Klappenecker [partially based on slides by Professor Welch]

Similar documents
NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

CMSC 441: Algorithms. NP Completeness

Computational Intractability 2010/4/15. Lecture 2

NP Completeness and Approximation Algorithms

1. Introduction Recap

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

Limitations of Algorithm Power

NP-Complete problems

CS 241 Analysis of Algorithms

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

NP and Computational Intractability

NP-Complete Problems. More reductions

P versus NP. Math 40210, Spring April 8, Math (Spring 2012) P versus NP April 8, / 9

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

Complexity, P and NP

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

COP 4531 Complexity & Analysis of Data Structures & Algorithms

P, NP, NP-Complete, and NPhard

Analysis of Algorithms. Unit 5 - Intractable Problems

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

Polynomial-time Reductions

Lecture 4: NP and computational intractability

NP and NP Completeness

Introduction. Pvs.NPExample

P versus NP. Math 40210, Fall November 10, Math (Fall 2015) P versus NP November 10, / 9

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

NP-Complete Problems and Approximation Algorithms

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

Instructor N.Sadagopan Scribe: P.Renjith. Lecture- Complexity Class- P and NP

Algorithms Design & Analysis. Approximation Algorithm

Lecture 24: How to become Famous with P and NP

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

BBM402-Lecture 11: The Class NP

More on NP and Reductions

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

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

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

NP-Completeness. NP-Completeness 1

ECS122A Handout on NP-Completeness March 12, 2018

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

A Working Knowledge of Computational Complexity for an Optimizer

INTRO TO MATH PROGRAMMING MA/OR 504, FALL 2015 LECTURE 11

CS Fall 2011 P and NP Carola Wenk

Data Structures in Java

1 Primals and Duals: Zero Sum Games

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

Design and Analysis of Algorithms

Spring Lecture 21 NP-Complete Problems

Lecture 18: P & NP. Revised, May 1, CLRS, pp

CSE 135: Introduction to Theory of Computation NP-completeness

Complexity Theory: The P vs NP question

Algorithm Design and Analysis

NP Complete Problems. COMP 215 Lecture 20

Intro to Theory of Computation

Algorithm Design and Analysis

1 Computational Problems

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

Computational Complexity

Intractable Problems Part One

The P = NP Problem Bristol Teachers Circle, June P.D.Welch, University of Bristol

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

Notes for Lecture Notes 2

CS 350 Algorithms and Complexity

CS 583: Algorithms. NP Completeness Ch 34. Intractability

A An Overview of Complexity Theory for the Algorithm Designer

CS 350 Algorithms and Complexity

In complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size.

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

CSC 1700 Analysis of Algorithms: P and NP Problems

} } } Lecture 23: Computational Complexity. Lecture Overview. Definitions: EXP R. uncomputable/ undecidable P C EXP C R = = Examples

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

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1

Data Structures and Algorithms

CS6901: review of Theory of Computation and Algorithms

Algorithm Design and Analysis

P versus NP. Math 40210, Spring September 16, Math (Spring 2012) P versus NP September 16, / 9

6-1 Computational Complexity

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

Computational Complexity

VIII. NP-completeness

Instructor N.Sadagopan Scribe: P.Renjith

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

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

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

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time

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

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

Topics in Complexity Theory

Theory of Computer Science

Essential facts about NP-completeness:

Notes for Lecture 21

Theory of Computer Science. Theory of Computer Science. E1.1 Motivation. E1.2 How to Measure Runtime? E1.3 Decision Problems. E1.

Complexity Theory Part II

NP-problems continued

CSE 105 THEORY OF COMPUTATION

34.1 Polynomial time. Abstract problems

Computational Models Lecture 11, Spring 2009

SAT, NP, NP-Completeness

Agenda. What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class

Transcription:

The Complexity Classes P and NP Andreas Klappenecker [partially based on slides by Professor Welch]

P

Polynomial Time Algorithms Most of the algorithms we have seen so far run in time that is upper bounded by a polynomial in the input size sorting: O(n 2 ), O(n log n), matrix multiplication: O(n 3 ), O(n log 2 7 ) graph algorithms: O(V+E), O(E log V), In fact, the running time of these algorithms are bounded by small polynomials.

Categorization of Problems We will consider a computational problem tractable if and only if it can be solved in polynomial time.!!!

Decision Problems and the class P A computational problem with yes/no answer is called a decision problem. We shall denote by P the class of all decision problems that are solvable in polynomial time.

Why Polynomial Time? It is convenient to define decision problems to be tractable if they belong to the class P, since - the class P is closed under composition. - the class P is nearly independent of the computational model. [Of course, no one will consider a problem requiring an Ω(n 100 ) algorithm as efficiently solvable. However, it seems that most problems in P that are interesting in practice can be solved fairly efficiently. ]

NP

Efficient Certification An efficient certifier for a decision problem X is a polynomial time algorithm that takes two inputs, an putative instance i of X and a certificate c and returns either yes or no. there is a polynomial such that for every string i, the string i is an instance of X if and only if there exists a string c such that c <= p( i ) and B(d,c) = yes. The certifier does not produce a solution to the decision problem X, but it is verifying that i belongs to X given a correct, short certificate c.

NP The set of all decision problems that have an efficient certifier is called NP.!!

Sudoku The problem is given as an n 2 x n 2 array which is divided into blocks of n x n squares. Some array entries are filled with an integer in the range [1.. n 2 ]. The goal is to complete the array such that each row, column, and block contains each integer from [1..n 2 ].

Sudoku Finding the solution might be difficult, but verifying the solution is easy. The Sudoku decision problem is whether a given Sudoku problem has a solution.

Hamiltonian Cycle A Hamiltonian cycle in an undirected graph is a cycle that visits every node exactly once. Solving a problem: Is there a Hamiltonian cycle in graph G? Verifying a candidate solution: Is v 0, v 1,, v l a Hamiltonian cycle of graph G?

Solving vs. Verifying Intuitively it seems much harder (more time consuming) in some cases to solve a problem from scratch than to verify that a candidate solution actually solves the problem. If there are many candidate solutions to check, then even if each individual one is quick to check, overall it can take a long time

The Class NP NP is short for nondeterministic polynomial time, since the decision problem in NP are precisely the problems that can be solved on a nondeterministic Turing machine in polynomial time. NP does not stand for not P, as there are many problems that cannot even be verified in polynomial time.

P versus NP

P vs. NP Although poly-time verifiability seems like a weaker condition than poly time solvability, no one has been able to prove that it is describes a larger class of problems. So it is unknown whether P = NP. 13

P and NP all problems all problems P NP or P=NP

NP-Complete Problems NP-complete problems is class of "hardest" problems in NP.! If an NP-complete problem can be solved in polynomial time, then all problems in NP can be solve in polynomial time, and thus P = NP.

Possible Worlds all problems all problems NP P NPC or P=NP=NPC NPC = NP-complete

P = NP Question The question whether P=NP is open since the 70s. It is one of the central open problems in computer science. The question is of theoretical interest as well as of great practical importance. Pragmatic approach: If your problem is NP-complete, then don't waste time looking for an efficient algorithm, focus on approximations or heuristics.