We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byBobby Garretson
Modified over 2 years ago
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…
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.
Programming & Data Structures
Analysis of Algorithms CS 477/677
Analysis of Algorithms
CSC 413/513: Intro to Algorithms NP Completeness.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
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,
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
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.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
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.
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.
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.
Limitation of Computation Power – P, NP, and NP-complete
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
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.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
NP-Complete Problems CSC 331: Algorithm Analysis NP-Complete Problems.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
P, NP, NP-Complete Problems
NP-COMPLETE PROBLEMS. Admin Two more assignments… No office hours on tomorrow.
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
MCS312: NP-completeness and Approximation Algorithms
NP-complete and NP-hard problems
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.
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.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
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:
NP-Complete Problems Problems in Computer Science are classified into
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
© 2017 SlidePlayer.com Inc. All rights reserved.