NP-complete Problems Three - 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 Problems Three, Decision, Keep Things Simple, Mainly Concern, Decision, Graph Acyclic, Directed, Spanning Tree, Undirected Graph, Perfect

Typology: Slides

2012/2013

Uploaded on 04/30/2013

patel
patel 🇮🇳

3.8

(15)

80 documents

1 / 50

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NP-complete Problems
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
pf2d
pf2e
pf2f
pf30
pf31
pf32

Partial preview of the text

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

NP-complete Problems

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?

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! NP-hardness

As we will see, some problems are at least as hard to solve as any problem in NP. We call such problems NP-hard.

How might we argue that problem X is at least as hard (to within a polynomial factor) as problem Y? Docsity.com

Cook's Theorem

The Satisfiability problem

x = ((A+B)C)((ABC')+C)(ABC')

Can you assign boolean (true or false) values to each of A, B, and C so that x is true?

If so, we say that the circuit is 'satisfiable.'

This circuit (which could also be drawn with AND/OR/NOT gates) is unsatisfiable. (Make sure you review how to draw an AND/OR/NOT circuit from a boolean equation. You've usually seen the equations written with x, y, and z instead of A, B, and C.)