What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,

Slides:



Advertisements
Similar presentations
Limitation of Computation Power – P, NP, and NP-complete
Advertisements

1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Odds and Ends HP ≤ p HC (again) –Turing reductions Strong NP-completeness versus Weak NP-completeness Vertex Cover to Hamiltonian Cycle.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
P, NP, and NP-Complete Suzan Köknar-Tezel.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
MCS312: NP-completeness and Approximation Algorithms
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
Polynomial-time reductions We have seen several reductions:
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
Lecture 12 P and NP Introduction to intractability Class P and NP Class NPC (NP-complete)
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Introduction to NP Instructor: Neelima Gupta 1.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
NP-completeness Ch.34.
Lecture 22 Complexity and Reductions
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
P, NP and NP-Complete Problems
P, NP and NP-Complete Problems
Our old list of problems
RAIK 283 Data Structures & Algorithms
Presentation transcript:

What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1, runs in exponential time. n  An O(n ) algorithm runs in polynomial time. k not efficient (intractable) polynomial timeefficient (tractable) exponential time

NP-Completeness Question 2: If I can’t find a polynomial time algorithm, is the problem intractable? Don’t really know! Maybe … NP-completeness gives strong (but not definitive) evidence. No polynomial-time algorithm has been found. Neither has a proof that no such algorithm exists.

Decision Problems Recasting needed before applying NP-completeness theory: decision problems A question with Yes/No answer inputs with “Yes” answer inputs with “No” answer optimization problems

Ex a) Minimum Spanning Tree Input: Edge-weighted graph G, number N. Q: Does G have a spanning tree of total cost ≤ N ?  Solve the optimization problem (using Kruskal or Prim).  If M ≤ N, Yes; otherwise, No.  Let the solution tree have weight M.

Ex b) Longest Common Subsequence Input: Two sequences P and Q and integer k > 0. Q: Do P and Q have a common sequence of length  k?  Run the LCS algorithm (dynamic programming).  If l  k, Yes; otherwise, No.  Let the solution subsequence have length l.

Class P Why a decision problem? It is  no harder than its optimization version  cleaner  answering question like If A is hard, then is B hard too? Class P : the set of all problems solvable in polynomial time. Ex. a) and b) belong to class P.

Ex c) Subset Sum Q: Is there a set S'  S such that  x  S' x = t ? For instance, S = {1, 3, 5, 11} t = 10  No t = 15  Yes Input: a set of integers S = { a, a, …, a } and integer t 1 2 n

Solution of Subset Sum  Enumerate subsets S' of S  Verify the certificate S' (e.g., {1, 3, 11}) (a solution guess)              a 1 a 3 a 2 a 1 a 2 a 1 a 1 a 1 a 2 a 2 a 2 a 3 a 3 a 3 a 3 2 n subsets  exponential time

Faster Solution? Is there a faster polynomial-time solution? Probably not in P! A knapsack formulation:  knapsack capacity t  1$/lb for each item Running time O(nt). But t maybe exponential in n!

Ex d) Hamiltonian Cycle (HC) Input: Undirected graph G. Q: Does G have a cycle that goes through each vertex exactly once? Enumerate all permutations of vertices and check? Subset Sum and HC are NP-complete (NPC)! non-deterministic polynomial time hardest in NP (if such a problem can be efficiently solved, all problems in NP can.) Yes No