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

Similar documents
Computers and Intractability

NP-Completeness. NP-Completeness 1

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

Computational complexity theory

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

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

CMSC 441: Algorithms. NP Completeness

1.1 P, NP, and NP-complete

Computational complexity theory

Computational Complexity

Introduction to Complexity Theory

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

ECS122A Handout on NP-Completeness March 12, 2018

Polynomial-time Reductions

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

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

CS/COE

Data Structures in Java

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

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

8.5 Sequencing Problems

Limitations of Algorithm Power

Design and Analysis of Algorithms

8.5 Sequencing Problems. Chapter 8. NP and Computational Intractability. Hamiltonian Cycle. Hamiltonian Cycle

COMP Analysis of Algorithms & Data Structures

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle

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

Chapter 8. NP and Computational Intractability

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

Computational Complexity

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Spring Lecture 21 NP-Complete Problems

NP Complete Problems. COMP 215 Lecture 20

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Lecture 4: NP and computational intractability

Complexity, P and NP

1. Introduction Recap

Comparison of several polynomial and exponential time complexity functions. Size n

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

NP Completeness and Approximation Algorithms

Correctness of Dijkstra s algorithm

Chapter 34: NP-Completeness

Problem Complexity Classes

Analysis of Algorithms. Unit 5 - Intractable Problems

More on NP and Reductions

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

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

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

Chapter 3: Proving NP-completeness Results

INTRO TO COMPUTATIONAL COMPLEXITY

VIII. NP-completeness

Computability and Complexity Theory

Unit 1A: Computational Complexity

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

NP-completeness. Chapter 34. Sergey Bereg

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

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

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

Data Structures and Algorithms (CSCI 340)

2 COLORING. Given G, nd the minimum number of colors to color G. Given graph G and positive integer k, is X(G) k?

Metode şi Algoritmi de Planificare (MAP) Curs 2 Introducere în problematica planificării

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

Polynomial-time reductions. We have seen several reductions:

NP-Complete Problems. More reductions

NP-Completeness. NP-Completeness 1

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

NP and Computational Intractability

CSC 1700 Analysis of Algorithms: P and NP Problems

P, NP, NP-Complete. Ruth Anderson

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

Polynomial-Time Reductions

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

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

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

SAT, Coloring, Hamiltonian Cycle, TSP

A difficult problem. ! Given: A set of N cities and $M for gas. Problem: Does a traveling salesperson have enough $ for gas to visit all the cities?

An Approach to Computational Complexity in Membrane Computing

Intractability. A difficult problem. Exponential Growth. A Reasonable Question about Algorithms !!!!!!!!!! Traveling salesperson problem (TSP)

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

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

Tractable & Intractable Problems

NP-Completeness. Subhash Suri. May 15, 2018

Automata Theory CS Complexity Theory I: Polynomial Time

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

CS 5114: Theory of Algorithms

5. Complexity Theory

APTAS for Bin Packing

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

Non-Deterministic Time

COMPUTATIONAL COMPLEXITY

Theory of Computation Chapter 1: Introduction

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

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

Algorithms: COMP3121/3821/9101/9801

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

Partition is reducible to P2 C max. c. P2 Pj = 1, prec Cmax is solvable in polynomial time. P Pj = 1, prec Cmax is NP-hard

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

Transcription:

Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory Background: Find a good method for determining whether or not any given set of specifications for a new bandersnatch component can be met and, if so, for constructing a design that meets them. M. R. Garey and D. S. Johnson W. H. Freeman and Company, 17 Initial attempt: Pull down your reference books and plunge into the task with great enthusiasm. Some weeks later... Your office is filled with crumpled-up scratch paper, and your enthusiasm has lessened considerable because Approach #1: Take the loser s way out the solution seems to be to examine all possible designs! New problem: How do you convey the bad information to your boss? Drawback: Could seriously damage your position within the company 1

Approach #2: Prove that the problem is inherently intractable Approach #3: Prove that the problem is NP-complete Drawback: Proving inherent intractability can be as hard as finding efficient algorithms. Even the best theoreticians have failed! Advantage: This would inform your boss that it is no good to fire you and hire another expert on algorithms. NP-complete problems NP-complete problems: Problems that are just as hard as a large number of other problems that are widely recognized as being difficult by algorithmic experts. NP-complete problems Problem: A general question to be answered Example: The traveling salesman optimization problem Parameters: Free problem variables, whose values are left unspecified Example: A set of cities C = { c 1,...,c n } and a distance d( c i,c j ) between each pair of cities c i and c j Instance: An instance of a problem is obtained by specifying particular values for all the problem parameters Example: C = { c 1,c 2,c 3,c 4 },d( c 1,c 2 )=10,d( c 1,c 3 )= 5,d( c 1,c 4 )=, d( c 2,c 3 )= 6,d( c 2,c 4 )=,d( c 3,c 4 )= 3 2

NP-complete problems Intractability The Traveling Salesman Optimization Problem: c 2 10 6 c 1 5 c 3 3 c 4 Minimum tour length = 27 Minimize the length of the tour that visits each city in sequence, and then returns to the first city. Input length: Expresses the number of information symbols needed for describing a problem instance using a reasonable encoding scheme Largest number: The magnitude of the largest number in a problem instance Time-complexity function: Expresses an algorithm s time requirements giving, for each possible input length, the largest amount of time needed by the algorithm to solve a problem instance of that size Intractability Polynomial-time algorithm: An algorithm whose time-complexity function is O( p(n)) for some polynomial function p, where n is the input length. Exponential-time algorithm: Any algorithm whose time-complexity function cannot be so bounded. A problem is said to be intractable if it is so hard that no polynomial-time algorithm can possibly solve it. Intractability Reasonable encoding scheme: Conciseness: The encoding of an instance I should be concise and not padded with unnecessary information or symbols Numbers occurring in I should be represented in binary (or decimal, or octal, or in any fixed base other than 1) Decodability: It should be possible to specify a polynomial-time algorithm that can extract a description of any component of I. 3

Decision problems Decision problems The Traveling Salesman Decision Problem: The theory of NP-completeness applies only to decision problems, where the solution is either a Yes or a No. 10 c 1 5 If an optimization problem asks for a structure of a certain type that has minimum cost among such structures, we can associate with that problem a decision problem that includes a numerical bound B as an additional parameter and that asks whether there exists a structure of the required type having cost no more than B. c 2 6 c 3 Is there a tour of all the cities in C having a total length of no more than B? 3 c 4 Class P Class NP Deterministic algorithm: (Deterministic Turing Machine) Finite-state control: The algorithm can pursue only one computation at a time Given a problem instance I, some structure (= solution) S is derived by the algorithm The correctness of S is inherent in the algorithm The class P is the class of all decision problems Π that, under reasonable encoding schemes, can be solved by polynomial-time deterministic algorithms. Non-deterministic algorithm: (Non-Deterministic Turing Machine) 1. Guessing stage: Given a problem instance I, some structure S is guessed. The algorithm can pursue an unbounded number of independent computational sequences in parallel. 2. Checking stage: The correctness of S is verified in a normal deterministic manner The class NP is the class of all decision problems Π that, under reasonable encoding schemes, can be solved by polynomial-time non-deterministic algorithms. 4

Relationship between P and NP NP-complete problems Observations: 1. P NP Proof: use a polynomial-time deterministic algorithm as the checking stage and ignore the guess... 2. P NP This is a wide-spread belief, but no proof of this conjecture exists! The question of whether or not the NP-complete problems are intractable is now considered to be one of the foremost open questions of contemporary mathematics and computer science! Reducibility: A problem Π is reducible to problem Π if, for any instance of Π, an instance of Π can be constructed in polynomial time such that solving the instance of Π will solve the instance of Π as well. When Π is reducible to Π, we write Π Π A decision problem Π is said to be NP-complete if Π NP and, for all other decision problems Π NP, Π polynomially reduces to Π. NP-hard problems NP-hard problems Turing reducibility: A problem Π is Turing reducible to problem Π if there exists an algorithm A that solves Π by using a hypothetical subroutine S for solving Π such that, if S were a polynomial time algorithm for Π, then A would be a polynomial time algorithm for Π as well. When Π is Turing reducible to Π, we write Π T Π A search problem Π is said to be NP-hard if there exists some decision problem Π NP that Turing-reduces to Π. Observations: All NP-complete problems are NP-hard Given an NP-complete decision problem, the corresponding optimization problem is NP-hard To see this, imagine that the optimization problem (that is, finding the optimal cost) could be solved in polynomial time. The corresponding decision problem (that is, determining whether there exists a solution with a cost no more than B) could then be solved by simply comparing the found optimal cost to the bound B. This comparison is a constant-time operation. 5

Strong NP-completeness Pseudo-polynomial-time algorithm: An algorithm whose time-complexity function is O( p(n,m)) for some polynomial function p, where n is the input length and m is the largest number. Number problem: A decision problem for which there exists no polynomial function p such that m p(n) for all instances of the problem. Examples: PARTITION, KNAPSACK, TRAVELING SALESMAN MULTIPROCESSOR SCHEDULING Strong NP-completeness If a decision problem Π is NP-complete and is not a number problem, then it cannot be solved by a pseudo-polynomial-time algorithm unless P = NP. Assuming P NP, the only NP-complete problems that are potential candidates for being solved by pseudo-polynomial-time algorithms are those that are number problems. A decision problem Π which cannot be solved by a pseudopolynomial-time algorithm, unless P = NP, is said to be NP-complete in the strong sense. Circumventing NP-completeness History of NP-completeness Tricks for circumventing the intractability: 1. Limiting the largest number m 2. Redefining the problem (e.g. edge vs vertex cover) 3. Exploiting problem structure (e.g. limits on vertex degrees, intree vs outtree task graphs) 4. Fixing problem parameters (e.g. fixed # of processors in multiprocessor scheduling) S. Cook: (171) The Complexity of Theorem Proving Procedures Every problem in the class NP of decision problems polynomially reduces to the SATISFIABILITY problem: Given a set U of Boolean variables and a collection C of clauses over U, is there a satisfying truth assignment for C? R. Karp: (172) Reducibility among Combinatorial Problems Decision problem versions of many well-known combinatorial optimization problems are just as hard as SATISFIABILITY. 6

History of NP-completeness Proving NP-completeness D. Knuth: (174) A Terminological Proposal Initiated a researcher s poll in search of a better term for at least as hard as the polynomial complete problems. One suggestion by S. Lin was PET problems: Probably Exponential Time (if P = NP remain open question) Provably Exponential Time (if P NP) Previously Exponential Time (if P = NP) Proving NP-completeness for a decision problem Π: 1. Show that Π is in NP 2. Select a known NP-complete problem Π 3. Construct a transformation from Π to Π 4. Prove that is a (polynomial) transformation Basic NP-complete problems SATISFIABILITY Uniprocessor scheduling with offsets and deadlines: 3-DIMENSIONAL MATCHING 3-SATISFIABILITY KNAPSACK MINIMUM COVER VERTEX COVER 3-PARTITION CLIQUE LONGEST PATH ANNIHILATION BIN PACKING HAMILTONIAN CIRCUIT PARTITION CLUSTERING MAX CUT Independent tasks with individual offsets and deadlines. Transformation from 3-PARTITION (Garey and Johnson, 177) NP-complete in the strong sense. Solvable in pseudo-polynomial time if number of allowed values for offsets and deadlines is bounded by a constant. Solvable in polynomial time if execution times are identical, preemptions are allowed, or all offsets are 0. INTEGER PROGRAMMING DEADLOCK AVOIDANCE JOB-SHOP SCHEDULING REGISTER SUFFICIENCY MULTIPROCESSOR SCHEDULING TRAVELING SALESMAN GRAPH COLORABILITY PREEMPTIVE SCHEDULING 7

Multiprocessor scheduling: Independent tasks with an overall deadline. Transformation from PARTITION (Garey and Johnson, 17) NP-complete in the strong sense for arbitrary number of processors. NP-complete in the normal sense for two processors. Solvable in pseudo-polynomial time for any fixed number of processors. Solvable in polynomial time if execution times are identical. Precedence-constrained multiprocessor scheduling: Precedence-constrained tasks with identical execution times and an overall deadline. Transformation from 3-SATISFIABILITY (Ullman, 175) NP-complete in the normal sense for arbitrary number of processors. Solvable in polynomial time for two processors, or for arbitrary number of processors and forest-like precedence constraints. Remains an open problem for fixed number of processors ( 3). Multiprocessor scheduling with individual deadlines: Precedence-constrained tasks with identical execution times and individual deadlines. Transformation from VERTEX COVER (Brucker, Garey and Johnson, 177) NP-complete in the normal sense for arbitrary number of processors. Solvable in polynomial time for two processors or in-tree precedence constraints. Preemptive uniprocessor scheduling of periodic tasks: Independent tasks with individual offsets and periods, and preemptive dispatching. Transformation from CLIQUE (Leung and Merrill, 180) NP-complete in the normal sense. 8

Non-preemptive uniprocessor scheduling of periodic tasks: Independent tasks with individual offsets and periods, and non-preemptive dispatching. Transformation from 3-PARTITION (Jeffay, Stanat and Martel, 11) NP-complete in the strong sense. Additional reading: Read the paper by Jeffay, Stanat and Martel (RTSS 1) Study particularly how the transformation from 3-PARTITION is used for proving strong NP-completeness (Theorem 5.2)