To prove that a problem is NP-Complete, we have to show that it belongs to both NP and NP-Hard Classes. (Since NP-Complete problems are NP-Hard problems which also belong to NP)
The Clique Decision Problem belongs to NP - If a problem belongs to the NP class, then it should have polynomial-time verifiability, that is given a certificate, we should be able to verify in polynomial time if it is a solution to the problem.
Proof:
- Certificate - Let the certificate be a set S consisting of nodes in the clique and S is a subgraph of G.
- Verification - We have to check if there exists a clique of size k in the graph. Hence, verifying if number of nodes in S equals k, takes O(1) time. Verifying whether each vertex has an out-degree of (k-1) takes O(k2) time. (Since in a complete graph, each vertex is connected to every other vertex through an edge. Hence the total number of edges in a complete graph = kC2 = k*(k-1)/2 ). Therefore, to check if the graph formed by the k nodes in S is complete or not, it takes O(k2) = O(n2) time (since k<=n, where n is number of vertices in G).
- No two vertices belonging to the same clause are connected.
- No variable is connected to its complement.
Thus, the graph G (V, E) is constructed such that - V = { <a, i> | a belongs to Ci } and E = { ( <a, i>, <b, j> ) | i is not equal to j ; b is not equal to a’ } Consider the subgraph of G with the vertices <x2, 1>; <x1’, 2>; <x3, 3>. It forms a clique of size 3 (Depicted by dotted line in above figure) . Corresponding to this, for the assignment - <x1, x2, x3> = <0, 1, 1> F evaluates to true. Therefore, if we have k clauses in our satisfiability expression, we get a max clique of size k and for the corresponding assignment of values, the satisfiability expression evaluates to true. Hence, for a particular instance, the satisfiability problem is reduced to the clique decision problem.
Therefore, the Clique Decision Problem is NP-Hard. Conclusion The Clique Decision Problem is NP and NP-Hard. Therefore, the Clique decision problem is NP-Complete.For more details, please refer: Design and Analysis of Algorithms.