Prove that Dense Subgraph is NP Complete by Generalisation
Last Updated :
17 Apr, 2024
Prerequisites: NP-Completeness, NP Class, Dense Subgraph
Problem: Given graph G = (V, E) and two integers a and b. A set of a number of vertices of G such that there are at least b edges between them is known as the Dense Subgraph of graph G.
Explanation: To prove the Dense Subgraph problem as NP-completeness by generalization, we are going to prove that it is a generalization of the known NP-complete problem. In this case, we are going to take Clique as the known problem which is already known to be NP-complete, and explained in Proof of Clique Is an NP-Complete and we need to show the reduction from Clique → Dense Subgraph.
Clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent.
Proof:
1. Input Conversion: We need to convert the input from Clique to the input of the Dense Subgraph.
Clique Input: An undirected graph G(V, E) and integer k.
Dense Subgraph Input : An undirected graph G'(V, E) and two integers a and b.
We are going to transform the input from Clique for Dense Subgraph such that
- G' = G(V, E)
- a = k
- b = (k * (k - 1))/2
This conversion is going to take O(1) time so it's polynomial in nature.
2. Output Conversion: We need to convert the solution from Dense Graph to the solution for the Clique problem.
Solution of Dense Graph will result in a set a which would be a Clique of size k as k = a. So direct output from Dense Graph can be used by Clique. Since no conversion is required so it's again polynomial in nature.
3. Correctness: We have restricted the range of input value b such that (k¦2) with value as (k * (k - 1))/2.
Now we are looking for a subgraph having k vertices and are connected by at least (k * (k - 1))/2 edges.
- Since in a complete graph, n vertices can have at most (n * (n - 1))/2 edges between them so we can say that we need to find a subgraph of k vertices that have exactly (k * (k - 1))/2 edges which means output graph should have an edge between each pair of vertices which is nothing but Clique of k vertices.
- Similarly, a Clique of k vertices on a graph G(V, E) must have (k * (k - 1))/2 edges which is nothing but the Dense-Subgraph of graph G(V, E)
Red Edges and Vertices denotes a Dense-Subgraph with a = 4 and b = 5 So, this means Dense-Subgraph has a solution↔ Clique has a solution.
The complete reduction takes polynomial time and Clique is NP complete so Dense Subgraph is also NP complete.
Conclusion:
Hence we can conclude that Dense-Subgraph is NP Complete
For more details, please refer: Design and Analysis of Algorithms.
Similar Reads
P, NP, CoNP, NP hard and NP complete | Complexity Classes In computer science, problems are divided into classes known as Complexity Classes. In complexity theory, a Complexity Class is a set of problems with related complexity. With the help of complexity theory, we try to cover the following.Problems that cannot be solved by computers.Problems that can b
5 min read
Introduction to NP-Complete Complexity Classes NP-complete problems are a subset of the larger class of NP (nondeterministic polynomial time) problems. NP problems are a class of computational problems that can be solved in polynomial time by a non-deterministic machine and can be verified in polynomial time by a deterministic Machine. A problem
5 min read
NP-Hard Class A 'P' problem is said to be NP-Hard when all 'Q' belonging in NP can be reduced in polynomial time (n^k where k is some constant) to 'P' assuming a solution for 'P' takes 1 unit time. NP-Hard is a computational complexity theory that acts as a defining property for the class of problems that are "at
2 min read
Difference between NP hard and NP complete problem All NP Complete Problems are NP-Hard but vice versa is not true. NP-Complete problems are subset of NP Problems. NP Problems : NP problems are a class of computational problems that can be solved in polynomial time by a non-deterministic machine and can be verified in polynomial time by a determinis
2 min read
NP-Complete Complexity Proofs
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 s
4 min read
Proof that Independent Set in Graph theory is NP Complete 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 co
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
6 min read
Prove that Dense Subgraph is NP Complete by Generalisation Prerequisites: NP-Completeness, NP Class, Dense Subgraph Problem: Given graph G = (V, E) and two integers a and b. A set of a number of vertices of G such that there are at least b edges between them is known as the Dense Subgraph of graph G. Explanation: To prove the Dense Subgraph problem as NP-c
3 min read
Prove that Sparse Graph is NP-Complete Prerequisite: NP-Completeness, NP Class, Sparse Graph, Independent Set Problem: Given graph G = (V, E) and two integers a and b. A set of a number of vertices of G such that there are at most b edges between them is known as the Sparse Subgraph of graph G. Explanation: Sparse Subgraph problem is def
4 min read