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-Completeness: Understanding the Complexity of Decidable Languages, Slides of Theory of Automata

An overview of np-completeness, a concept in computer science that deals with the complexity of decidable languages. Np-completeness compares the problem classes p and np, discussing languages like clique, is, vc, and sat, and their equivalence. The document also covers polynomial-time reductions and their significance in determining the complexity of problems.

Typology: Slides

2012/2013

Uploaded on 04/29/2013

shamir_69
shamir_69 🇮🇳

5

(4)

66 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NP-completeness
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download NP-Completeness: Understanding the Complexity of Decidable Languages and more Slides Theory of Automata in PDF only on Docsity!

NP-completeness

P and NP

languages that can be decided on a TM

with polynomial running time

P =

(problems that admit efficient algorithms)

NP = languages decidable on a nondeterministic

TM with polynomial running time

(solutions can be checked efficiently)

decidable

NP P

We believe that NP is bigger than P,

but we are not 100% sure

Equivalence of certain NP languages

  • We strongly suspect that problems like

CLIQUE, SAT, etc. require time ≈2 n^ to solve

  • We do not know how to prove this, but what

we can prove is that

If any one of them is tractable (by a polynomial-

time algorithm), then all of them are tractable

Equivalence of certain NP languages

  • All these problems are as hard as one another
  • Moreover, they are at the “frontier” of NP
    • They are at least as hard as any problem in NP NP

P

Polynomial-time reductions

• Theorem

If CLIQUE has a

polynomial-time

algorithm, so does IS

CLIQUE = {(G, k ): G is a graph with a clique of k vertices}

IS = {(G, k ): G is a graph with an independent set of k vertices}

1 2

3 4

{1, 4}, {2, 3, 4}, {1} are cliques {1, 2}, {1, 3}, {4} are independent sets

Polynomial-time reductions

• Proof: Suppose CLIQUE has an algorithm A

• We want to use it to solve IS

If CLIQUE has a polynomial-time

algorithm, so does IS

G, k

reject if not

accept if G has IS of size k

A

G, k ’ reject if not

accept if G’ has clique of size k

Reducing IS to CLIQUE

G, k R G’, k’

On input ( G , k ) Construct G ’ by flipping all edges of G Set k ’ = k Output ( G ’, k ’)

independent sets in G (^) cliques in G’

If G ’ has a clique of size k ’, then G has an IS of size k

If G ’ does not have a clique of size k ’,

then G has no IS of size k ✓

Reduction recap

• We showed that

by converting an imaginary algorithm for

CLIQUE into one for IS

• To do this, we came up with a reduction that

transforms instances of IS into ones for CLIQUE

If CLIQUE has a polynomial-time algorithm,

so does IS

Meaning of poly-time reductions

• Saying L reduces to L ’ means L is easier than

L’

  • In other words, if we can solve L’ , then we can also

solve L

• Theorem

• Proof

If L reduces to L’ and L’ ∈ P, then L ∈ P

x y

xL yL

R algorithm for L’

acc rej

algorithm accepts

Notes about reductions

• The direction of the reduction is very

important

  • This makes sense, because “A is easier than B” and

“B is easier than A” mean different things

• However, it is possible that L reduces to L’

and L’ reduces to L

  • This means that L and L’ are as hard as one

another

  • For example, IS and CLIQUE reduce to one

Interpretation of Cook-Levin

Theorem

• Optimistic view:

• Pessimistic view:

If we manage to solve SAT, then we can also solve

CLIQUE, scheduling, and almost anything

Since we do not believe P = NP, it is unlikely that

we will ever have a fast algorithm for SAT