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

Similar documents
NP Completeness and Approximation Algorithms

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

CMSC 441: Algorithms. NP Completeness

Design and Analysis of Algorithms

Limitations of Algorithm Power

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity

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

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

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

NP Complete Problems. COMP 215 Lecture 20

CS 583: Algorithms. NP Completeness Ch 34. Intractability

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

CSC 1700 Analysis of Algorithms: P and NP 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.

Tractable & Intractable Problems

DAA 8 TH UNIT DETAILS

1. Introduction Recap

COSE215: Theory of Computation. Lecture 21 P, NP, and NP-Complete Problems

NP-Complete Problems. More reductions

Data Structures in Java

INTRO TO COMPUTATIONAL COMPLEXITY

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

Polynomial-time reductions. We have seen several reductions:

Automata Theory CS Complexity Theory I: Polynomial Time

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

CSE 3500 Algorithms and Complexity Fall 2016 Lecture 25: November 29, 2016

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

Polynomial-time Reductions

P, NP, NP-Complete, and NPhard

Computational Complexity

CSC 421: Algorithm Design & Analysis. Spring 2018

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

NP-Completeness. NP-Completeness 1

Introduction to Complexity Theory

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

VIII. NP-completeness

Notes for Lecture 21

Algorithms Design & Analysis. Approximation Algorithm

NP-Completeness. NP-Completeness 1

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

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

Analysis of Algorithms. Unit 5 - Intractable Problems

Correctness of Dijkstra s algorithm

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

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

Intractable Problems [HMU06,Chp.10a]

Spring Lecture 21 NP-Complete Problems

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

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

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

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

Computational Complexity

Turing Machines and Time Complexity

The Beauty and Joy of Computing

ECS122A Handout on NP-Completeness March 12, 2018

SAT, Coloring, Hamiltonian Cycle, TSP

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

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

Computational Intractability 2010/4/15. Lecture 2

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

CS 5114: Theory of Algorithms

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

Lecture 19: Finish NP-Completeness, conp and Friends

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

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

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

Computability and Complexity Theory: An Introduction

Graph Theory and Optimization Computational Complexity (in brief)

NP-Complete Reductions 1

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

The Beauty and Joy of Computing

Review of unsolvability

1 Primals and Duals: Zero Sum Games

COMP Analysis of Algorithms & Data Structures

NP-Completeness. Subhash Suri. May 15, 2018

NP-Completeness. Dr. B. S. Panda Professor, Department of Mathematics IIT Delhi, Hauz Khas, ND-16

Lecture 4: NP and computational intractability

NP-Completeness Theory

CSE 135: Introduction to Theory of Computation NP-completeness

Complexity - Introduction + Complexity classes

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

P, NP, NP-Complete. Ruth Anderson

Data Structures and Algorithms

More on NP and Reductions

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

NP and NP Completeness

CS/COE

Lecture 14 - P v.s. NP 1

NP and Computational Intractability

CSCI3390-Lecture 16: NP-completeness

6-1 Computational Complexity

NP Completeness and Approximation Algorithms

Instructor N.Sadagopan Scribe: P.Renjith

BBM402-Lecture 11: The Class NP

Problems, and How Computer Scientists Solve Them Manas Thakur

Lecture 4 : Quest for Structure in Counting Problems

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

Complexity, P and NP

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

Transcription:

Tractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?» Standard working definition: polynomial time» On an input of size n the worst-case running time is O(n k ) for some constant k» O(n 2 ), O(n 3 ), O(1), O(n lg n), O(2 n ), O(n n ), O(n!)» Polynomial time: O(n 2 ), O(n 3 ), O(1), O(n lg n)» Not in polynomial time: O(2 n ), O(n n ), O(n!) 1

Polynomial-Time Algorithms Are some problems solvable in polynomial time?» Of course: many algorithms we ve studied provide polynomial-time solutions to some problems Are all problems solvable in polynomial time?» No: Turing s Halting Problem is not solvable by any computer, no matter how much time is given Most problems that do not yield polynomial-time algorithms are either optimization or decision problems. 2

Optimization/Decision Problems Optimization Problems» An optimization problem is one which asks, What is the optimal solution to problem X?» Examples: 0-1 Knapsack Fractional Knapsack Minimum Spanning Tree Decision Problems» An decision problem is one with yes/no answer» Examples: Does a graph G have a MST of weight W? 3

Optimization/Decision Problems An optimization problem tries to find an optimal solution A decision problem tries to answer a yes/no question Many problems will have decision and optimization versions» Eg: Traveling salesman problem optimization: find hamiltonian cycle of minimum weight decision: is there a hamiltonian cycle of weight k Some problems are decidable, but intractable: as they grow large, we are unable to solve them in reasonable time» Is there a polynomial-time algorithm that solves the problem? 4

The Class P P: the class of decision problems that have polynomial-time deterministic algorithms.» That is, they are solvable in O(p(n)), where p(n) is a polynomial on n» A deterministic algorithm is (essentially) one that always computes the correct answer Why polynomial?» if not, very inefficient» nice closure properties the sum and composition of two polynomials are always polynomials too 5

Sample Problems in P Fractional Knapsack MST Sorting Others? 6

The class NP NP: the class of decision problems that are solvable in polynomial time on a nondeterministic machine (or with a nondeterministic algorithm) (A determinstic computer is what we know) A nondeterministic computer is one that can guess the right answer or solution» Think of a nondeterministic computer as a parallel machine that can freely spawn an infinite number of processes Thus NP can also be thought of as the class of problems» whose solutions can be verified in polynomial time Note that NP stands for Nondeterministic Polynomial-time 7

Sample Problems in NP Fractional Knapsack MST Sorting Others?» Hamiltonian Cycle (Traveling Salesman)» Graph Coloring» Satisfiability (SAT) the problem of deciding whether a given Boolean formula is satisfiable 8

The Satisfiability (SAT) Problem Satisfiability (SAT):» Given a Boolean expression on n variables, can we assign values such that the expression is TRUE?» Ex: ((x 1 x 2 ) (( x 1 x 3 ) x 4 )) x 2» Seems simple enough, but no known deterministic polynomial time algorithm exists» Easy to verify in polynomial time! 9

Example: CNF satisfiability This problem is in NP. Nondeterministic algorithm:» Guess truth assignment» Check assignment to see if it satisfies CNF formula Example: (A B C ) ( A B) ( B D F ) (F D) Truth assignments: A B C D E F 1. 0 1 1 0 1 0 2. 1 0 0 0 0 1 3. 1 1 0 0 0 1 4.... (how many more?) Checking phase: Θ(n) 10

Review: P And NP Summary P = set of problems that can be solved in polynomial time» Examples: Fractional Knapsack, NP = set of problems for which a solution can be verified in polynomial time» Examples: Fractional Knapsack,, Hamiltonian Cycle, CNF SAT, 3-CNF SAT Clearly P NP Open question: Does P = NP?» Most suspect not» An August 2010 claim of proof that P NP, by Vinay Deolalikar, researcher at HP Labs, Palo Alto, has flaws 11

NP-complete problems A decision problem D is NP-complete iff 1. D NP 2. every problem in NP is polynomial-time reducible to D Cook s theorem (1971): CNF-sat is NP-complete 12

Reduction A problem R can be reduced to another problem Q if any instance of R can be rephrased to an instance of Q, the solution to which provides a solution to the instance of R» This rephrasing is called a transformation Intuitively: If R reduces in polynomial time to Q, R is no harder to solve than Q Example: lcm(m, n) = m * n / gcd(m, n), lcm(m,n) problem is reduced to gcd(m, n) problem 13

NP-Hard and NP-Complete If R is polynomial-time reducible to Q, we denote this R p Q Definition of NP-Hard and NP-Complete:» If all problems R NP are polynomial-time reducible to Q, then Q is NP-Hard» We say Q is NP-Complete if Q is NP-Hard and Q NP If R p Q and R is NP-Hard, Q is also NP-Hard (why?) 14

Practical Implication Given a problem that is known to be NP-Complete» Try to solve it by designing a polynomial-time algorithm? Prove P=NP» Alleviate the intractability of such problems To make some large instances of the problem solvable (like solving some instances of Knapsack problem in polynomial time) 15

16

17