Overview

Problem Statement

Prove that the following problem is NP-complete: given an undirected graph G=(V,E)G = (V, E) and an integer kk, return a clique of size kk as well as an independent set of size kk, provided both exist.

Approach

We call the problem CIS for brevity.

First, we show that the problem is in the NP computational class. Next, we show we can reduce the known NP-complete problem Clique →\rightarrow CIS. Finally, we provide a bidirectional proof to prove that the reduction is correct, which also proves that CIS∈NPCIS\in NP-complete.

CIS in NP

We need to show that for any solution SS for and instance II of CIS can be verified in polynomial time.

  • To validate the SS clique, we first check that there are not more than kk vertices in SS. This takes O(n)O(n) time.
  • Next, we check that all pairs are strongly connected (to satisfy the definition of a clique). We do this by looking at each x,yx,y vertex and ensuring there is an edge between them. This takes O(n2)O(n^2) time.

The above is poly-time to the input, thus we can assert CIS∈NPCIS\in NP.

CIS in NP-complete

Clique -> CIS

We now reduce a known NP-complete problem, Clique, to CIS. We must take care of the wording of the problem: it will only return IFF there is both a clique and an independent set of size kk.

Clique takes a graph, G=(V,E)G=(V,E) and a goal gg.

We can take the GG and modify it. We add vertices to the graph which are not connected to any edges, such that there are gg new vertices, for a total of: ∥V′∥=∥V∥+g\|V'\|=\|V\|+g.

Now we pass G′G' (the transformed graph) and gg to CIS. If there is a clique of size gg, CIS will return that clique as well as an independent set of size gg (which we guaranteed by the above). Our illustration captures what’s going on.

The transformation is poly-time, taking at most O(n+m) to add vertices to the graph.

Illustration of our graph transformation{: height=“550” }

Clique <==> CIS

Now we have to prove correctness. We do this by proving both directions. That is Clique  ⟺  CISClique\iff CIS:

  • Show that if CIS has a solution, then Clique has a solution: CIS returns the clique of size gg and an independent set of size gg if both exist. We have guaranteed a independent set of size gg by the above construction, therefore CIS will only return if there is a valid clique in GG, which is also the solution for Clique (since both demand a goal of the same size gg).
  • Show that if Clique has a solution, then CIS has a solution: Clique will only have a solution if GG has a clique of at least size gg. But by construction, we’ve also added an independent set to G′G', which means that CIS is also guaranteed a solution.

Thus CIS∈NPCIS\in NP-complete by reduction. □\square