Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

NP-Complete Problems - Automata and Complexity Theory - Lecture Slides, Slides of Theory of Automata

Some concept of Automata and Complexity Theory are Administrivia, Closure Properties, Context-Free Grammars, Decision Properties, Deterministic Finite Automata, Intractable Problems, More Undecidable Problems. Main points of this lecture are: Np-Complete Problems, Np-Hard Problems, Tautology Problem, Node Cover, Knapsack, Number of Problems, Directly, Polytime, Transducer, Construction

Typology: Slides

2012/2013

Uploaded on 04/29/2013

shamir_69
shamir_69 🇮🇳

5

(4)

66 documents

1 / 49

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
More NP-Complete Problems
NP-Hard Problems
Tautology Problem
Node Cover
Knapsack
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

Partial preview of the text

Download NP-Complete Problems - Automata and Complexity Theory - Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

1

More NP-Complete Problems

NP-Hard Problems Tautology Problem

Node Cover

Knapsack

2

Next Steps

We can now reduce 3SAT to a large number of problems, either directly orindirectly.

Each reduction must be polytime.

Usually we focus on length of the output from the transducer, becausethe construction is easy.

But key issue: must be polytime.

4

Example: NP-Hard Problem

The

Tautology Problem

is: given a

Boolean formula, is it satisfied by alltruth assignments?

Example: x + -x + yz

Not obviously in

NP

, but it’s

complement is.

Guess a truth assignment; accept if thatassignment doesn’t satisfy the formula.

5

Key Point Regarding Tautology 

An NTM can guess a truth assignment and decide whether formula F issatisfied by that assignment inpolytime.

But if the NTM accepts when it guesses a satisfying assignment, it will accept Fwhenever F is in SAT, not Tautology.

7

Tautology is NP-Hard

While we can’t prove Tautology is in NP

, we can prove it is NP-hard.

Suppose we had a polytime algorithm for Tautology.

Take any Boolean formula F and convert it to -(F).

Obviously linear time.

8

Tautology is NP-Hard – (2)

F is satisfiable if and only -(F) is not a tautology.

Use the hypothetical polytime algorithm for Tautology to test if -(F) is atautology.

Say “yes, F is in SAT” if -(F) is not a tautology and say “no” otherwise.

Then SAT would be in

P

, and

P

NP

10

History – (2)

Cook used “if problem X is in

P

, then

P

NP

” as the definition of “X is NP-

hard.”

Today called

Cook completeness.

In 1972, Richard Karp wrote a paper showing many of the key problems inOperations Research to be NP-complete.

11

History – (3)

Karp’s paper moved “NP-completeness” from a concept about theorem provingto an essential for any study ofalgorithms.

But Karp used the definition of NP- completeness “exists a polytimereduction,” as we have.

Called

Karp completeness.

13

Cook Vs. Karp – (2)

But there is one important reason we prefer Karp-completeness.

Suppose I had an algorithm for some NP-complete problem that ran in timeO(n

log n

A function that is bigger than anypolynomial, yet smaller than theexponentials like 2

n

.

14

Cook Vs. Karp – (3)

If “NP-complete is Karp-completeness, I can conclude that all of

NP

can be

solved in time O(n

f(n)

), where f(n) is

some function of the form c log

k

n.

Still faster than any exponential, and fasterthan we have a right to expect.

But if I use Cook-completeness, I cannot say anything of this type.

16

Example: Node Cover

A

C

E

F

D

B

One possible node coverof size 3: {B, C, E}

17

NP-Completeness of Node Cover

Reduction from 3SAT.

For each clause (X+Y+Z) construct a “column” of three nodes, all connectedby

vertical

edges.

Add a

horizontal

edge between nodes

that represent any variable and itsnegation.

Budget = twice the number of clauses.

19

Example: Reduction – (2)

A node cover must have at least two nodes from every column, or somevertical edge is not covered.

Since the budget is twice the number of columns, there must be exactly twonodes in the cover from each column.

Satisfying assignment corresponds to the node in each column not selected.

20

Example: Reduction – (3)

(x + y + z)(-x + -y + -z)(x + -y +z)(-x + y + -z)Truth assignment: x = y = T; z = F

x y z

-x -y -z

x z -y

-x -z

y

Pick a true node in each column