The Wayback Machine - https://web.archive.org/web/20240718043932/https://www.geeksforgeeks.org/proof-that-independent-set-in-graph-theory-is-np-complete/
Open In App

Proof that Independent Set in Graph theory is NP Complete

Last Updated : 13 Jul, 2022
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report
Prerequisite: NP-Completeness, Independent set. An Independent Set S of graph G = (V, E) is a set of vertices such that no two vertices in S are adjacent to each other. It consists of non- adjacent vertices. Problem: Given a graph G(V, E) and an integer k, the problem is to determine if the graph contains an independent set of vertices of size >=k. Explanation: An instance of the problem is an input specified to the problem. An instance of the Independent Set problem is a graph G (V, E) and a positive integer k, and the problem is to check whether an independent set of size k exists in G. Since an NP-Complete problem, by definition, is a problem which is both in NP and NP-hard, the proof for the statement that a problem is NP-Complete consists of two parts:
  1. The problem itself is in NP class.
  2. All other problems in NP class can be polynomial-time reducible to that. (B is polynomial-time reducible to C is denoted as B$\leqslant_P$C)
If the 2nd condition is only satisfied then the problem is called NP-Hard. But it is not possible to reduce every NP problem into another NP problem to show its NP-Completeness all the time. That is why if we want to show a problem is NP-Complete we just show that the problem is in NP and any NP-Complete problem is reducible to that then we are done, i.e. if B is NP-Complete and B$\leqslant_P$C for C in NP, then C is NP-Complete.
  1. Independent Set is NP If any problem is in NP, then, given a ‘certificate’, which is a solution to the problem and an instance of the problem (a graph G and a positive integer k, in this case), we will be able to verify (check whether the solution given is correct or not) the certificate in polynomial time. The certificate is a subset V’ of the vertices, which comprises the vertices belonging to the independent set. We can validate this solution by checking that each pair of vertices belonging to the solution are non-adjacent, by simply verifying that they don’t share an edge with each other. This can be done in polynomial time, that is O(V +E) using the following strategy of graph G(V, E):
    flag=true
    For every pair {u, v} in the subset V’:
        Check that these two don’t
        have an edge between them
        If there is an edge,
        set flag to false and break
    If flag is true:
        Solution is correct
    Else:
        Solution is incorrect
    
  2. Independent Set is NP-Hard. In order to prove that the Independent Set problem is NP-Hard, we will perform a reduction from a known NP-Hard problem to this problem. We will carry out a reduction from which the Clique Problem can be reduced to the Independent Set problem. Every instance of the clique problem consisting of the graph G (V, E) and an integer k can be converted to the required graph G’ (V’, E’) and k’ of the Independent Set problem. We will construct the graph G’ in the following way:
    V’ = V i.e. all the vertices of graph G are a part of the graph G’ E’ = complement of the edges E, i.e. the edges not present in the original graph G.
    The graph G’ is the complementary graph of G. The time required to compute the complementary graph G’ requires a traversal over all the vertices and edges. The time complexity of this is O (V+E). We will now prove that the problem of computing the independent set indeed boils down to the computation of the clique. The reduction can be proved by the following two propositions:
    • Let us assume that the graph G contains a clique of size k. The presence of clique implies that there are k vertices in G, where each of the vertices is connected by an edge with the remaining vertices. This further shows that since these edges are contained in G, therefore they can’t be present in G’. As a result, these k vertices are not adjacent to each other in G’ and hence form an Independent Set of size k.
    • We assume that the complementary graph G’ has an independent set of vertices of size k’. None of these vertices shares an edge with any other vertices. When we complement the graph to obtain G, these k vertices will share an edge and hence, become adjacent to each other. Therefore, the graph G will have a clique of size k.
Thus, we can say that there is an independent set of size k in graph G if there is a clique of size k in G’ (complement graph). Therefore, any instance of the independent set problem can be reduced to an instance of the clique problem. Thus, the independent set is NP-Hard. Conclusion: Since the Independent Set problem is both NP and NP-Hard, therefore it is an NP-Complete problem.

For more details, please refer: Design and Analysis of Algorithms.


Previous Article
Next Article

Similar Reads

Proof that Dominant Set of a Graph is NP-Complete
Pre-requisite: Dominant Set of a Graph, NP-Complete A dominating set in a graph G = (V, E) is a subset of vertices V’ following the condition that the vertices not belonging in V’ are adjacent to some vertex in V’. Problem: Given a graph G(V, E) and an integer k, the problem is to determine if the graph has a Dominating Set of size k. Explanation:
5 min read
Find if an undirected graph contains an independent set of a given size
Given an undirected graph, check if it contains an independent set of size k. Print 'Yes' if there exists an independent set of size k. Print 'No' otherwise. Independent Set: An independent set in a graph is a set of vertices that are not directly connected to each other. Example 1: Input : K = 4, graph = [[1, 1, 0, 0, 0], [1, 1, 1, 1, 1], [0, 1, 1
10 min read
Maximal Independent Set in an Undirected Graph
Given an undirected graph defined by the number of vertex V and the edges E[ ], the task is to find Maximal Independent Vertex Set in an undirected graph. Independent Set: An independent set in a graph is a set of vertices which are not directly connected to each other. Note: It is a given that there is at least one way to traverse from any vertex
11 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
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
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
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 Clique Decision problem is NP-Complete
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 ve
4 min read
Proof that NAE-4-SAT is NP Complete
Problem Statement: Given a 4-CNF formula f, the task is to check if there is every clause such that at least one literal is TRUE and the other is FALSE. Explanation: An instance of the problem is an input specified to the problem. An instance of the NAE-4-SAT Problem is a boolean 4-CNF formula. Since an NP-complete problem is a problem which is bot
4 min read
three90RightbarBannerImg