The Wayback Machine - https://web.archive.org/web/20240605235427/https://www.geeksforgeeks.org/proof-that-clique-decision-problem-is-np-complete/
Open In App

Proof that Clique Decision problem is NP-Complete

Last Updated : 13 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite: NP-Completeness

A clique is a subgraph of a graph such that all the vertices in this subgraph are connected with each other that is the subgraph is a complete graph. The Maximal Clique Problem is to find the maximum sized clique of a given graph G, that is a complete graph which is a subgraph of G and contains the maximum number of vertices. This is an optimization problem. Correspondingly, the Clique Decision Problem is to find if a clique of size k exists in the given graph or not.

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:

  1. Certificate – Let the certificate be a set S consisting of nodes in the clique and S is a subgraph of G.
  2. 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).

Therefore, the Clique Decision Problem has polynomial time verifiability and hence belongs to the NP Class.

The Clique Decision Problem belongs to NP-Hard – A problem L belongs to NP-Hard if every NP problem is reducible to L in polynomial time. Now, let the Clique Decision Problem by C. To prove that C is NP-Hard, we take an already known NP-Hard problem, say S, and reduce it to C for a particular instance. If this reduction can be done in polynomial time, then C is also an NP-Hard problem. The Boolean Satisfiability Problem (S) is an NP-Complete problem as proved by the Cook’s theorem. Therefore, every problem in NP can be reduced to S in polynomial time. Thus, if S is reducible to C in polynomial time, every NP problem can be reduced to C in polynomial time, thereby proving C to be NP-Hard.

Proof that the Boolean Satisfiability problem reduces to the Clique Decision Problem
Let the boolean expression be – F = (x1 v x2) ^ (x1‘ v x2‘) ^ (x1 v x3)  where x1, x2, x3 are the variables, ‘^’ denotes logical ‘and’, ‘v’ denotes logical ‘or’ and x’ denotes the complement of x. Let the expression within each parentheses be a clause. Hence we have three clauses – C1, C2 and C3. Consider the vertices as – <x1, 1>; <x2, 1>; <x1’, 2>; <x2’, 2>; <x1, 3>; <x3, 3> where the second term in each vertex denotes the clause number they belong to. We connect these vertices such that –

  1. No two vertices belonging to the same clause are connected.
  2. 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.


Previous Article
Next Article

Similar Reads

Proof that Clique Decision problem is NP-Complete | Set 2
Prerequisite: NP-Completeness, Clique problem. A clique in a graph is a set of vertices where each vertex shares an edge with every other vertex. Thus, a clique in a graph is a subgraph which is a complete graph. Problem: Given a graph G(V, E) and an integer K, the problem is to determine if the graph contains a clique of size K. Explanation: An in
5 min read
Prove that a problem consisting of Clique and Independent Set is NP Complete
Prerequisite: NP-Completeness, NP Class, Clique, Independent Set Problem: Given an undirected graph G = (V, E) and an integer K, determine if a clique of size K as well as an independent set (IS) of size K, exists. Demonstrate that it is an NP Complete. Explanation: A Clique is a subgraph of a graph in which all of the vertices are connected, formi
6 min read
Two Clique Problem (Check if Graph can be divided in two Cliques)
A Clique is a subgraph of graph such that all vertices in subgraph are completely connected with each other. Given a Graph, find if it can be divided into two Cliques. Examples: Input : G[][] = {{0, 1, 1, 0, 0}, {1, 0, 1, 1, 0}, {1, 1, 0, 0, 0}, {0, 1, 0, 0, 1}, {0, 0, 0, 1, 0}}; Output : Yes This problem looks tricky at first, but has a simple and
13 min read
Maximal Clique Problem | Recursive Solution
Given a small graph with N nodes and E edges, the task is to find the maximum clique in the given graph. A clique is a complete subgraph of a given graph. This means that all nodes in the said subgraph are directly connected to each other, or there is an edge between any two nodes in the subgraph. The maximal clique is the complete subgraph of a gi
14 min read
Proof that Subgraph Isomorphism problem is NP-Complete
Subgraph Isomorphism Problem: We have two undirected graphs G1 and G2. The problem is to check whether G1 is isomorphic to a subgraph of G2. Graph Isomorphism: Two graphs A and B are isomorphic to each other if they have the same number of vertices and edges, and the edge connectivity is retained. There is a bijection between the vertex sets of the
4 min read
Proof that Collinearity Problem is NP Complete
Problem: Given 3 points a, b, c, the task is to check if these three points are collinear. Explanation: An instance of the problem is an input specified to the problem. An instance of the collinearity problem is three points ((ax, ay), (bx, by), (cx, cy)). Since an NP-Complete is a problem which is both in NP and NP-hard, the proof for the statemen
2 min read
Proof that traveling salesman problem is NP Hard
Pre-requisite: Travelling Salesman Problem, NP Hard Given a set of cities and the distance between each pair of cities, the travelling salesman problem finds the path between these cities such that it is the shortest path and traverses every city once, returning back to the starting point. Problem - Given a graph G(V, E), the problem is to determin
2 min read
Java Program to Find the Largest Clique in a Planar Graph
Independent set of Graph as a pre-requisite is the set of vertices where no two are adjacent to each other. It is just opposite in definition to clique, Hence knowledge about the complements of a graph is necessary in order to go further. Basically, the idea of a planar graph is not of utmost importance but can be referred. Hence, we will be using
12 min read
Proof that vertex cover is NP complete
Prerequisite - Vertex Cover Problem, NP-Completeness Problem - Given a graph G(V, E) and a positive integer k, the problem is to find whether there is a subset V’ of vertices of size at most k, such that every edge in the graph is connected to some vertex in V’. Explanation - First let us understand the notion of an instance of a problem. An instan
5 min read
Proof that Hamiltonian Cycle is NP-Complete
Prerequisite: NP-Completeness, Hamiltonian cycle. Hamiltonian Cycle: A cycle in an undirected graph G=(V, E) traverses every vertex exactly once. Problem Statement: Given a graph G=(V, E), the problem is to determine if graph G contains a Hamiltonian cycle consisting of all the vertices belonging to V. Explanation: An instance of the problem is an
4 min read