23
Additional NP-Complete Problems Lecture 40 Section 7.5 Mon, Dec 3, 2007

Additional NP-Complete Problems

Embed Size (px)

DESCRIPTION

Additional NP-Complete Problems. Lecture 40 Section 7.5 Mon, Dec 3, 2007. CLIQUE is NP-Complete. We have already seen that 3SAT is NP-complete and 3SAT can be reduced to CLIQUE. Therefore, CLIQUE is NP-complete. VERTEX-COVER is NP-complete. - PowerPoint PPT Presentation

Citation preview

Page 1: Additional NP-Complete Problems

Additional NP-Complete Problems

Lecture 40Section 7.5

Mon, Dec 3, 2007

Page 2: Additional NP-Complete Problems

CLIQUE is NP-Complete

• We have already seen that • 3SAT is NP-complete and• 3SAT can be reduced to CLIQUE.

• Therefore, CLIQUE is NP-complete.

Page 3: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• The Vertex-cover problem: Given a graph G and an integer k, does there exist a set S of k vertices such that every edge of G has at least one endpoint in S?

Page 4: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• We will now reduce CLIQUE to VERTEX-COVER to show that VERTEX-COVER is NP-complete.

• We have already shown that VERTEX-COVER is in NP.

Page 5: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Let G, k be an instance of CLIQUE.

• That is, G is a graph, k is an integer, and the question is whether G has a clique of size k.

Page 6: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Create the graph G as follows.• V(G ) = V(G)• e is an edge of G if and only if e is

not an edge of G.

• G is the complement of G.• We claim that G has a clique of

size k if and only if G has a vertex cover of size n – k.

Page 7: Additional NP-Complete Problems

Example

G

Page 8: Additional NP-Complete Problems

Example

G G

Page 9: Additional NP-Complete Problems

Example

G G

Page 10: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 11: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 12: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 13: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 14: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 15: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 16: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 17: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 18: Additional NP-Complete Problems

Example

G G

k = 3 n – k = 5

Page 19: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Proof• Let S be a vertex cover of G.• Let T = V – S.• We claim that T is a clique of G.• Let vertices i and j be in T.• Then i and j are not in S.• Therefore, there is no edge in G from

i to j because S is a vertex cover.

Page 20: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Then there is an edge from i to j in G.• Therefore, T is a clique in G.• Therefore, “yes” to vertex cover

implies “yes” to clique. vertex cover S of n – k in G

clique T of k in G.

Page 21: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Now we must show that( vertex cover S of n – k in G)

( clique T of k in G).• But this is the same as showing that

clique T of k in G vertex cover S of n – k in G.

Page 22: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• So now suppose that T is a clique of size k in G.

• Let S = V – T.• We claim that S is a vertex cover of

G.• Let e be an edge in G.• Then e must have at least one

endpoint in S.

Page 23: Additional NP-Complete Problems

VERTEX-COVER is NP-complete

• Therefore, S is a vertex cover of G.• So “yes” to clique implies “yes” to

vertex cover.• Therefore, “no” to vertex cover

implies “no” to clique.