Tractable & Intractable Problems

Similar documents
VIII. NP-completeness

NP-Complete Problems and Approximation Algorithms

CMSC 441: Algorithms. NP Completeness

ECS122A Handout on NP-Completeness March 12, 2018

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

NP Complete Problems. COMP 215 Lecture 20

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

CS/COE

Computational Complexity

Computational Complexity

P,NP, NP-Hard and NP-Complete

July 18, Approximation Algorithms (Travelling Salesman Problem)

Data Structures in Java

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

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

Algorithms Design & Analysis. Approximation Algorithm

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

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

P, NP, NP-Complete. Ruth Anderson

Design and Analysis of Algorithms

NP Completeness and Approximation Algorithms

NP-Completeness. NP-Completeness 1

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

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

CSC 1700 Analysis of Algorithms: P and NP Problems

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

Complexity - Introduction + Complexity classes

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

Lecture 4: NP and computational intractability

Nondeterministic Polynomial Time

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

DAA Unit IV Complexity Theory Overview

Limitations of Algorithm Power

Unit 1A: Computational Complexity

Decision Problems TSP. Instance: A complete graph G with non-negative edge costs, and an integer

ABHELSINKI UNIVERSITY OF TECHNOLOGY

NP-Complete Problems. More reductions

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

from notes written mostly by Dr. Matt Stallmann: All Rights Reserved

Introduction to Complexity Theory

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

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

Turing Machines and Time Complexity

Lecture 24: How to become Famous with P and NP

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

CS 583: Algorithms. NP Completeness Ch 34. Intractability

CSE 326: Data Structures NP Completeness

Problem Complexity Classes

8.3 Hamiltonian Paths and Circuits

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

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

Data Structures and Algorithms (CSCI 340)

Problems and Solutions. Decidability and Complexity

CS 350 Algorithms and Complexity

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

NP-completeness. Chapter 34. Sergey Bereg

Computational complexity theory

Graduate Algorithms CS F-21 NP & Approximation Algorithms

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

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

ECS 120 Lesson 24 The Class N P, N P-complete Problems

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

CS 241 Analysis of Algorithms

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

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

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

SAT, Coloring, Hamiltonian Cycle, TSP

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

Graph Theory and Optimization Computational Complexity (in brief)

CS 350 Algorithms and Complexity

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

Polynomial-time Reductions

1. Introduction Recap

Algorithms Re-Exam TIN093/DIT600

Week Cuts, Branch & Bound, and Lagrangean Relaxation

DAA 8 TH UNIT DETAILS

Computational complexity theory

More on NP and Reductions

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

Introduction. Pvs.NPExample

Analysis of Algorithms. Unit 5 - Intractable Problems

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

Lecture Notes 4. Issued 8 March 2018

Travelling Salesman Problem

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

1 Primals and Duals: Zero Sum Games

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

Notes for Lecture 21

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

CSCI3390-Lecture 14: The class NP

Who Has Heard of This Problem? Courtesy: Jeremy Kun

1.1 P, NP, and NP-complete

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

Intractable Problems [HMU06,Chp.10a]

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

CS 6505, Complexity and Algorithms Week 7: NP Completeness

13.1 Nondeterministic Polynomial Time

Computational Complexity

Transcription:

Tractable & Intractable Problems We will be looking at : What is a P and NP problem NP-Completeness The question of whether P=NP The Traveling Salesman problem again Programming and Data Structures 1

Polynomial Time (P) Most of the algorithms we have looked at so far have been polynomial-time algorithms On inputs of size n, their worst-case running time is O(n k ) for some constant k The question is asked can all problems be solved in polynomial time? From what we ve covered to date the answer is obviously no. There are many examples of problems that cannot be solved by any computer no matter how much time is involved There are also problems that can be solved, but not in time O(n k ) for any constant k Programming and Data Structures 2

Non-Polynomial Time (NP) Another class of problems are called NP problems These are problems that we have yet to find efficient algorithms in Polynomial Time for, but given a solution we can verify that solution in polynomial time Can these problems be solved in polynomial time? It has not been proved if these problems can be solved in polynomial time, or if they would require superpolynomial time This so-called P!= NP question is one which is widely researched and has yet to be settled Programming and Data Structures 3

Tractable and Intractable Generally we think of problems that are solvable by polynomial time algorithms as being tractable, and problems that require superpolynomial time as being intractable. Sometimes the line between what is an easy problem and what is a hard problem is a fine one. For example, Find the shortest path from vertex x to vertex y in a given weighted graph. This can be solved efficiently without much difficulty. However, if we ask for the longest path (without cycles) from x to y, we have a problem for which no one knows a solution better than an exhaustive search Programming and Data Structures 4

Deterministic v Non-Deterministic Let us now define some terms P: The set of all problems that can be solved by deterministic algorithms in polynomial time By deterministic we mean that at any time during the operation of the algorithm, there is only one thing that it can do next A nondeterministic algorithm, when faced with a choice of several options, has the power to guess the right one. Using this idea we can define NP problems as, NP:The set of all problems that can be solved by nondeterministic algorithms in polynomial time. Programming and Data Structures 5

Is P = NP? Obviously, any problem in P is also in NP, but not the other way around To show that a problem is in NP, we need only find a polynomial-time algorithm to check that a given solution (the guessed solution) is valid. But the idea of nondeterminism seems silly. A problem is in NP if we can guess a solution and verify it in polynomial time!! No one has yet been able to find a problem that can be proven to be in NP but not in P Is the set P = NP? We don t know. If it is, then there are many efficient algorithms out there just waiting to be discovered. Most researchers believe that P!= NP, but a proof remains to be shown Programming and Data Structures 6

NP-Completeness NP-complete problems are set of problems that have been proved to be in NP That is, a nondeterministic solution is quite trivial, and yet no polynomial time algorithm has yet been developed. This set of problems has an additional property which does seem to indicate that P = NP If any of the problems can be solved in polynomial time on a deterministic machine, then all the problems can be solved in NP(Cook's Theorem) It turns out that many interesting practical problems have this characteristic Programming and Data Structures 7

Examples of NP-Complete Travelling Salesman Problem: Given a set of cities and distances between all pairs, find a tour of all the cities of distance less than M. Hamiltonian Cycle: Given a graph, find a simple cycle that includes all the vertices. Partition: Given a set of integers, can they be divided into two sets whose sum is equal? Integer Linear Programming: Given a linear program is there an integer solution? Vertex Cover: Given a graph and an integer N, is there a set of fewer than N vertices which touches all the edges? Programming and Data Structures 8

Solving These Problems At present no algorithms exist that are guaranteed to solve any of the NPcomplete problems efficiently Remember if we could find one then we could solve all the NP-Complete problems In the meantime can we find adequate solutions? One approach is to seek an approximate solution which may not be the optimal but is close to the optimal Another approach is to focus on the average case and develop an algorithm that works for most, but not all, cases Programming and Data Structures 9

Approximation Algorithms Here is an approximation algorithm for the travelling salesman problem, Approx-TSP-Tour(G, c) - select a vertex r V[G] to be a root vertex - grow a minimum spanning tree T for G from root r using MST-Prim(G,c,r) - Let L be the list of vertices visited in a preorder tree walk of T - return the Hamiltonian cycle H that visits the vertices in the order L endalg This approximation if implemented correctly returns a tour whose cost is not more than twice the cost of an optimal tour Programming and Data Structures 10

Programming and Data Structures 11 TSP Example a f c h b d g e a f c h b d g e a f c h b d g e a f c h b d g e a f c h b d g e b. MST c.preorder d. Tour by preorder e. Optimum Tour a. Given points

Summary Polynomial problems are problems for which algorithms can be found that solve the problem in polynomial time Non deterministic Polynomial problems are problems for which nondeterministic algorithms can be found NP-Complete problems are problems that are in NP, but which have the added property that if one can be solved, they all can be solved It is thought that NP-Complete problems may be insoluble using deterministic methods One approach is to develop approximation algorithm, as we did with TSP Programming and Data Structures 12