![]() |
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.
Proof: 1. Input Conversion: We need to convert the input from Clique to the input of the Dense Subgraph.
We are going to transform the input from Clique for Dense Subgraph such that
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.
![]() 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. Conclusion:
For more details, please refer: Design and Analysis of Algorithms. |
Reffered: https://www.geeksforgeeks.org
Analysis Of Algorithms |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |