Computational Complexity

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

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

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

NP-Completeness. NP-Completeness 1

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

Lecture 5: Computational Complexity

Limitations of Algorithm Power

1. Introduction Recap

Polynomial-time reductions. We have seen several reductions:

NP-Completeness. NP-Completeness 1

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

The Complexity of Optimization Problems

Computational complexity theory

Unit 1A: Computational Complexity

VIII. NP-completeness

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

Problem Complexity Classes

CSC 1700 Analysis of Algorithms: P and NP Problems

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

Computational complexity theory

ECS122A Handout on NP-Completeness March 12, 2018

COP 4531 Complexity & Analysis of Data Structures & Algorithms

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness

Computers and Intractability

Algorithms Design & Analysis. Approximation Algorithm

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

Lecture 4: NP and computational intractability

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

Determine the size of an instance of the minimum spanning tree problem.

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Non-Deterministic Time

P, NP, NP-Complete, and NPhard

IE418 Integer Programming

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

Data Structures in Java

Theory of Computation Chapter 1: Introduction

Lecture 19: Finish NP-Completeness, conp and Friends

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

6-1 Computational Complexity

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness

Chapter 34: NP-Completeness

Graph Theory and Optimization Computational Complexity (in brief)

Umans Complexity Theory Lectures

NP Completeness and Approximation Algorithms

5. Complexity Theory

Turing Machines and Time Complexity

Introduction to Complexity Theory

COMP Analysis of Algorithms & Data Structures

Algorithms. Grad Refresher Course 2011 University of British Columbia. Ron Maharik

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

Reductions. Reduction. Linear Time Reduction: Examples. Linear Time Reductions

Computability and Complexity Theory

NP-Complete problems

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?

THE COMMUNICATIONS COMPLEXITY HIERARCHY IN DISTRIBUTED COMPUTING. J. B. Sidney + and J. Urrutia*

Complexity of domain-independent planning. José Luis Ambite

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

NP and Computational Intractability

Analysis of Algorithms. Unit 5 - Intractable Problems

1. (a) Explain the asymptotic notations used in algorithm analysis. (b) Prove that f(n)=0(h(n)) where f(n)=0(g(n)) and g(n)=0(h(n)).

Complexity and NP-completeness

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

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

Correctness of Dijkstra s algorithm

NP-Complete Problems and Approximation Algorithms

This means that we can assume each list ) is

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

Algorithm Design and Analysis

4/30/14. Chapter Sequencing Problems. NP and Computational Intractability. Hamiltonian Cycle

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

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

Spring Lecture 21 NP-Complete Problems

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

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

34.1 Polynomial time. Abstract problems

NP Complete Problems. COMP 215 Lecture 20

NP and NP Completeness

NP and Computational Intractability

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

Complexity Theory of Polynomial-Time Problems

CS/COE

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

Polynomial-time Reductions

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

Complexity - Introduction + Complexity classes

Multiple Sequence Alignment: Complexity, Gunnar Klau, January 12, 2006, 12:

M is a TM with start state s defined over the alphabet {#,(,),0,1,a,q,,}:

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

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

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

Supporting hyperplanes

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

CS 583: Algorithms. NP Completeness Ch 34. Intractability

P,NP, NP-Hard and NP-Complete

1.1 P, NP, and NP-complete

CS 350 Algorithms and Complexity

Tractable & Intractable Problems

IE418 Integer Programming

Transcription:

Computational Complexity

Algorithm performance and difficulty of problems So far we have seen problems admitting fast algorithms flow problems, shortest path, spanning tree... and other problems for which we could not do better than solving with less efficient algorithms knapsack, TSP, integer programming... Can we classify problems depending on that?

Easy and difficult problems Border between easy and difficult problems: existence of a polynomial time algorithm in the input size The existence of a polynomial time algorithm is easy to certify (the algorithm itself is the certificate) The non existence of a polynomial time algorithm cannot be certified Computational complexity theory [Garey and Johnson 1979]

A few definitions Problem: question expressed in abstract terms whose answer depends on a set of input parameters Instance of a problem: specification of the input parameters Algorithm for problem P: finite set of instructions that, if applied to any instance of P, provides in a finite number of steps a solution to the input instance or indicate that no solution exists

Computational models Simple models with infinite memory that can simulate any (sequential) real computer Turing machine Random Access Machine Pointer machine...

Complexity measure of one algorithm Number of elemental operations performed by the algorithm worst case express the number of operations in function of the input size give the asymptotic measure (neglect the constants and the lower order term) O(f(n)) notation

Why polynomial algorithms are better Computer performing 1M operations per second Size of the input 10 30 60 n 0.00001s 0.00003s 0.00006s n 2 0.0001s 0.0009s 0.0036s n 5 0.1s 24.3s 13m 2 n 0.001s 17.9m 36600y 3 n 0.059s 6.5y 1.3x10 15 y Computing time

Why polynomial algorithms are better present computer 100 times faster 1000 times faster n N1 100 N1 1000 N1 n 2 N2 10 N2 31.6 N2 n 5 N3 2.5 N3 3.98 N3 2 n N4 N4 + 6 N4 + 9 3 n N5 N5 + 4 N5 + 6 size of the largest solvable instance in 1 h

Pseudopolynomial algorithms Example: algorithm that solves the knapsack reducing the problem to a shortest (longest) path on an acyclic graph O(nb) complexity Polynomial in the input but not in the input size (unless unary encoding is considered)

Classification of the problems Problems in decision form: the expected answer is yes or no Examples connectivity problem scheduling problem SAT How to deal with optimization problems? Decision version of the problem: fix an additional parameter k. Does there exist a solution with value k? (for min problems) If we are able to solve the decision version of the problem we can solve efficiently also the optimization version by binary search over k

Class NP A problem P belongs to the class NP if it is in decision form it is certifiable in polynomial time Given an instance of problem P and one possible solution x There is a polynomial time algorithm that checks that solution x gives a YES answer to the given instance

Class P A problem P belongs to the class P if it belongs to NP there is a polynomial time algorithm that solves any instance of P P NP

Polynomial reduction Let P and Q NP P reduces in polynomial time to Q P Q Supposing that there exist a polynomial time (including constant) algorithm AQ solving Q then we can devise one algorithm AP that calls AQ a polynomial number of times and solves P Given an instance of P we can transform it in polynomial time into an instance of Q. The solution of Q can be transformed into a solution of P in polynomial time

Consequences of polynomial reductions P Q if there is a polynomial algorithm for Q P P if we can prove that P has no polynomial algorithm (hard to say) Q P is reflexive and transitive

Class NP-complete Q NP-complete if Q NP for each problem P NP P Q This implies that if Q could be solved in polynomial time then any problem could be solved in polynomial time thus P = NP

How can we prove that a problem is NP-complete? Making the reductions from all NP problems (even those which have not been conceived yet) seems impractical Exploit the transitivity of make the reduction from a known NP-complete problem SAT is NP-complete [Cook-Levin 1971]