CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

P, NP, NP-Complete Problems
NP-Complete Problems CIT 596, Spring Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound.
Limitation of Computation Power – P, NP, and NP-complete
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,
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
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.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
P, NP, and NP-Complete Suzan Köknar-Tezel.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
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
NP-Complete Problems CSC 331: Algorithm Analysis NP-Complete Problems.
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:
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
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.
RESOURCES, TRADE-OFFS, AND LIMITATIONS Group 5 8/27/2014.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CSC 413/513: Intro to Algorithms NP Completeness.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
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.
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.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NPC.
David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions.
CSC 413/513: Intro to Algorithms
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
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.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
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
Complexity Classes.
NP-Complete Problems.
NP-completeness Ch.34.
Chapter 10 NP-Complete Problems.
Analysis and design of algorithm
ICS 353: Design and Analysis of Algorithms
Approximation Algorithms
Chapter 11 Limitations of Algorithm Power
The Theory of NP-Completeness
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Presentation transcript:

CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter

2 © 2004 Goodrich, Tamassia Complexity Classes 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 n, then the worst-case running time is O(n c ) for constant c. problems in P are considered “tractable” (if not in P, then not tractable)

3 © 2004 Goodrich, Tamassia Some Examples of P and Non-P Problems Single-source shortest path problem in a directed graph, even with negative edge weights, is in P (i.e., O(VE) time) Finding the longest simple path between two nodes is Non-P because exhaustive search is “superpolynomial time”. Even finding whether a graph has a simple path of length n is “intractable”. An Euler tour of a connected, directed graph is a cycle that traverses each edge of G exactly once, although it may visit a vertex more than once. We can determine whether a graph has an Euler tour and find the edges of such a tour in O(E) time. A hamiltonian cycle of a directed graph is a simple cycle that contains each vertex in V (each vertex only once). Determining whether a directed graph has a hamiltonian cycle is a Non-P problem.

4 © 2004 Goodrich, Tamassia Complexity Classes The class NP: class of problems with solutions that can be verified in time that is polynomial in the size of the input. Imagine we are given a “certificate” of a solution (really a potential solution) of a problem. Then the problem is in NP if we can verify that the certificate is a valid solution in polynomial time. Relies on the fact that checking a solution is easier than computing it (e.g., check that a list is sorted, rather than sorting it.)

5 © 2004 Goodrich, Tamassia NP-Completeness The class NP-Complete (NPC): class of the “hardest” problems in NP. this class has property that if any NPC problem can be solved in polynomial time (p-time), then all problems in NP could be solved in p-time. actual status of NPC problems is unknown -No p-time algorithms have been discovered for any NPC problem - No one has been able to prove that no p-time algorithm can exist for any of them Informally, a problem is in NPC if it is in NP and is as “hard” as any problem in NP. we will use reductions, to grow our set of NPC problems from one initial problem.

6 © 2004 Goodrich, Tamassia P, NP, NPC...how are they related? Any problem in P is also in NP, since if a problem is in P then we can solve it in polynomial-time without even being given a certificate. So P  NP. By definition, NPC  NP

7 © 2004 Goodrich, Tamassia P, NP, NPC...how are they related? Is NP  P ??? open problem, but intuition says no probably the most famous open problem in CS seems plausible that the ability to guess and verify a solution in p-time is more powerful than computing a solution from scratch (deterministic p-time) so...we think P ≠ NP, but no one has proven it one way or the other (despite enormous effort). Note: It is known that if P ≠ NP, there must exist NP problems that neither are in P nor are NPC

8 © 2004 Goodrich, Tamassia P, NP, NPC...why do we care? So...why do we care to know whether a problem is NP-Complete? if it is, then finding a p-time algorithm to solve it is unlikely. better to spend your time looking for: oan efficient approximation algorithm to find solution close to optimal oheuristics that give correct answer with high probability

9 © 2004 Goodrich, Tamassia P, NP, NPC...why do we care? The set of "hardest" problems, the NPC problems, includes many problems of importance in science, engineering, operations research, and business, e.g.: traveling salesman bin packing knapsack problem vertex cover (graph coloring) integer linear programming etc…