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

Similar documents
Essential facts about NP-completeness:

1. Introduction Recap

Lecture 4: NP and computational intractability

CSE 135: Introduction to Theory of Computation NP-completeness

NP and NP Completeness

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Correctness of Dijkstra s algorithm

No Harder Than. We want these transformations to effectively be a problem-hardness version of #, which we will call No Harder Than.

Lecture 19: Finish NP-Completeness, conp and Friends

NP and Computational Intractability

NP-Complete Reductions 1

SAT, NP, NP-Completeness

Computational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness

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

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

SAT, Coloring, Hamiltonian Cycle, TSP

COP 4531 Complexity & Analysis of Data Structures & Algorithms

Time Complexity. CS60001: Foundations of Computing Science

Complexity, P and NP

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

NP Complete Problems. COMP 215 Lecture 20

More NP-Complete Problems

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

Computational Complexity

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

CSE 105 THEORY OF COMPUTATION

Algorithm Design and Analysis

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

CS 5114: Theory of Algorithms

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

conp, Oracles, Space Complexity

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

Problem Complexity Classes

Design and Analysis of Algorithms

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

NP-Completeness. NP-Completeness 1

More on NP and Reductions

Computational Complexity

VIII. NP-completeness

Introduction to Computational Complexity

DAA 8 TH UNIT DETAILS

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

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

NP Completeness and Approximation Algorithms

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

CMSC 441: Algorithms. NP Completeness

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

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm

1.1 P, NP, and NP-complete

Algorithm Design and Analysis

ECS122A Handout on NP-Completeness March 12, 2018

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 2 : Regular Expressions & DFAs

Limitations of Algorithm Power

P vs. NP. Data Structures and Algorithms CSE AU 1

CS21 Decidability and Tractability

Computational Complexity

Algorithm Design and Analysis

CS 583: Algorithms. NP Completeness Ch 34. Intractability

BBM402-Lecture 11: The Class NP

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

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

1 Primals and Duals: Zero Sum Games

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

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

CSL 356: Analysis and Design of Algorithms. Ragesh Jaiswal CSE, IIT Delhi

Polynomial-time reductions. We have seen several reductions:

CSE 105 Theory of Computation

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

Intro to Theory of Computation

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

Computational Intractability 2010/4/15. Lecture 2

CS154, Lecture 13: P vs NP

COMP 382. Unit 10: NP-Completeness

P,NP, NP-Hard and NP-Complete

Intro to Theory of Computation

Data Structures and Algorithms

6-1 Computational Complexity

P, NP, NP-Complete, and NPhard

CSC 1700 Analysis of Algorithms: P and NP Problems

Polynomial-time Reductions

Quantum Complexity Theory. Wim van Dam HP Labs MSRI UC Berkeley SQUINT 3 June 16, 2003

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

CSE 548: (Design and) Analysis of Algorithms

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

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

CS 5114: Theory of Algorithms. Tractable Problems. Tractable Problems (cont) Decision Problems. Clifford A. Shaffer. Spring 2014

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

CS 350 Algorithms and Complexity

DAA Unit IV Complexity Theory Overview

Turing Machines and Time Complexity

Computability Theory

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

Graph Theory and Optimization Computational Complexity (in brief)

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

5. Complexity Theory

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

Introduction to Complexity Theory

NP-problems continued

Transcription:

Complexity

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

Complexity class A complexity class is a set All problems within that set can be solved within certain resource bounds There are a lot of them (https://complexityzoo.uwaterloo.ca/complexity_zoo) However a few are more important P NP PSPACE

P The class of problems solvable in O(n c ) time for some real c. Matrix multiplication Dijkstra, Prim, Kruskal Almost all major algorithms we have talked about so far

NP Problems where checking if a possible answer is correct can be done in Polynomial time Note: If you can solve a problem correctly in poly time, you can check if it is correct in poly time Thus P NP

Other definitions Deterministic - Programs that must always behave the same way on the same input. Nondeterministic - Program has the ability to simulate multiple branches at the same time NP - Nondeterministic Polynomial time

How to prove algs are in certain classes P NP Give an algorithm that solves the problem Prove that the algorithm runs in polynomial time Idea of a certificate, some sort of proof of a solution State what the certificate is Show that verifying the certificate can be done in polynomial time

Examples - Which class? Hamiltonian path Composite number Cycle detection Longest path in a graph

P vs NP Most famous unsolved problem in CS $1,000,000 prize from Clay Institute Fame Fortune Bragging rights Does P=NP? If it is easy to check if a solution is correct is it also easy to solve the problem?

Reductions Some problems can be solved using other problems Example: Assume that we know how to solve the s-t cut problem Note that we can use that to solve the global max cut problem by making n 2 calls If you can take a problem A, convert it to another problem B in polynomial time, and solve the original problem as the new problem, we say that A p B A polynomially reduces to B A can be solved using B

Remarks Note that poly(x) * poly(x) is a polynomial If we can take problem A, convert in poly time, and then solve in poly time as B, then A can be solved in poly time

NP-Completeness Is there a problem that can solve all problems in NP? I.e. for any arbitrary problem A, A p B Yes!

Cook-Levin Theorem All problems in NP can be polynomially reduced to SAT SAT: Boolean Satisfiability Problem All problems in NP reduce to SAT

NP-Complete We say that SAT is NP-Complete Meaning: All problems in NP can be solved with SAT with a polynomial time reduction Are there other NP-Complete problems? Yes! Lots!

NP-Complete In the same way that problems can be solved using SAT, SAT can be solved using many other problems If you can use a problem in NP to solve sat with a poly reduction, that problem is also NP-Complete

NP-Complete reductions Proofs follow the following form To prove something is NP-Complete 1. Prove that the problem is in NP 2. Prove that if you can solve this new problem, you can solve another NP-Complete problem

Examples Independent Set reduces to Vertex Cover Hamiltonian Cycle Pebbling Game

Co-NP Problems where verifying that a claim is false takes polynomial time Primality Testing

PSPACE Polynomial Space instead of polynomial time

The big picture

And a much scarier version

Pseudopolynomial Time How do you check if a number is prime (easy way)

Pseudopolynomial time Some problems are polynomial in the value of the input But we want it to be polynomial in the representation of the input The representation of a number n has value n but representation length log n Problems solvable in polynomial time of the value but not in the representation are called pseudopolynomial time algorithms So don t fall for that trap!

List of NP-Complete Problems Knapsack Hamiltonian path/cycle SAT 3SAT Independent set Clique Vertex Cover Max Cut

A bit more practice Prove that Clique is NP-Complete