![]() |
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 defined as follows:
Proof: 1. Sparse Graph belongs to NP Class: A problem is said to be in NP Class if the solution for the problem can be verified in polynomial time. Given an input G = (V, E) and two integer variables a and b.
So, verification of a solution for Sparse Graph takes at most O(|V|2) which is polynomial in nature so Sparse Graph belongs to NP Class. 2. Sparse Graph is an NP-Hard problem: Now we need to show Sparse Graph is at least as hard as a known NP-Complete Problem by reduction technique. Here the known problem is going to be the Independent Set problem which is already known to be NP-complete which is explained in Proof of Independent Set being the NP-Complete.
Input Conversion: We need to convert the input from Independent Set to the input of the Sparse Graph.
We are going to transform the input from Independent Set to Sparse Graph such that
This conversion is going to take O(1) time. So it’s polynomial in nature. Output Conversion: We need to convert the solution from Sparse Graph to the solution for the Independent Set problem. Solution of Sparse Graph will result in a set a which would be an Independent Set of size k as k = a. So direct output from Sparse Graph can be used by Independent Set. Since no conversion is required so it’s again polynomial in nature. Correctness: Forward implication: Consider any Independent Set S. This is a Sparse graph as well, since there is no edges between vertices of S(b <= 0 ) and |S| = k = a Reverse implication: A given Sparse Graph solution S, it is an Independent Set as well (number of edges between vertices is zero, and |S| = k = a. So, this means Sparse Graph has a solution ↔ Independent Set has a solution. Conclusion:
For more details, please refer: |
Reffered: https://www.geeksforgeeks.org
Analysis Of Algorithms |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |