NP-complete Problem - Data Structures - Lecture Slides, Slides of Data Structures and Algorithms

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

2012/2013

Uploaded on 04/30/2013

patel
patel 🇮🇳

3.8

(15)

80 documents

1 / 44

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NP-complete Problem
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download NP-complete Problem - Data Structures - Lecture Slides and more Slides Data Structures and Algorithms in PDF only on Docsity!

NP-complete Problem

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!

HARD AND EASY PROBLEMS

(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.