




































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Some concept of Data Structures are Abstract, Balance Factor, Complete Binary Tree, Dynamically, Storage, Implementation, Sequential Search, Advanced Data Structures, Graph Coloring Two, Insertion Sort. Main points of this lecture are: Np-Complete Problem, Decision, Require, Concern, Single Bit Output, Decision Problems, Directed Graph Acyclic, Undirected Graph, Bipartite, Pattern
Typology: Slides
1 / 44
This page cannot be seen from the preview
Don't miss anything!





































Decision Problems
To keep things simple, we will mainly concern ourselves with decision problems. These problems only require a single bit output: yes'' andno''.
How would you solve the following decision problems?
Is this directed graph acyclic? Is there a spanning tree of this undirected graph with total weight less than w? Does this bipartite graph have a perfect (all nodes matched) matching? Does the pattern p appear as a substring in text t?
Nice Puzzle
The class NP (meaning non-deterministic polynomial time) is the set of problems that might appear in a puzzle magazine: ``Nice puzzle.''
What makes these problems special is that they might be hard to solve, but a short answer can always be printed in the back, and it is easy to see that the answer is correct once you see it.
Example... Does matrix A have an LU decomposition?
No guarantee if answer is ``no''.
Good Guessing
Another way of thinking of NP is it is the set of problems that can solved efficiently by a really good guesser.
The guesser essentially picks the accepting certificate out of the air (Non-deterministic Polynomial time). It can then convince itself that it is correct using a polynomial time algorithm. (Like a right-brain, left-brain sort of thing.)
Clearly this isn't a practically useful characterization: how could we build such a machine?
Exponential Upperbound
Another useful property of the class NP is that all NP problems can be solved in exponential time (EXP).
This is because we can always list out all short certificates in exponential time and check all O(2nk) of them.
Thus, P is in NP, and NP is in EXP. Although we know that P is not equal to EXP, it is possible that NP = P, or EXP, or neither. Frustrating!
(a very informal introduction) Good starting points for precise definitions and formal introduction are Papadimitriou: Computational Complexity , Adison-Wesley, 1994 Garey and Johnson: Computers and Intractability , Freeman 1979 Schrijver: Theory of Linear and Integer Programming , Wiley, 1986, (Chapter 2)
P : Collection Z of problems is in P (polynomial-time solvable) if there exists a polynomial-time algorithm that solves any problem in Z, i.e, the algorithm that requires at most f(s) basic steps where s =size of the input and f is a polynomial.
NP: Collection Z of decision problems is in NP (nondeterministic polynomial- time solvable) if there exists a polynomial time algorithm to check the correctness of the YES answer.
co-NP: replace YES by NO in the above definition.