230 likes | 348 Views
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.
E N D
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 • 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?
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.
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.
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.
Example G
Example G G
Example G G
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
Example G G k = 3 n – k = 5
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.
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.
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.
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.
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.