Consider the following two problems on undirected graphs:
- : Given , does have an independent set of size |V| - ?
- : Given , does have an independent set of size ?
Which one of the following is TRUE?
View worked solution
Answer: D
To determine the complexity of the two problems, we analyze the time complexity of solving them on an undirected graph with vertices and edges.
1. Analysis of Problem
Problem: Does have an independent set of size ?
- The size of the independent set is a fixed constant, .
- The number of candidate subsets of vertices of size is given by the binomial coefficient:
- For each subset of size , we can verify if it forms an independent set by checking if there are any edges between the pairs of vertices. This verification takes constant time.
- Thus, the total time complexity to find if such an independent set exists is , which is polynomial in terms of the input size.
Therefore, is in P.
2. Analysis of Problem
Problem: Does have an independent set of size ?
- Recall the fundamental graph theory property: A subset of vertices is an independent set of if and only if its complement is a vertex cover of .
- If has an independent set of size , then the remaining vertices must form a vertex cover of .
- Thus, the problem is equivalent to: Does have a vertex cover of size ?
- Since the size of the vertex cover is a fixed constant (), we can check all possible subsets of size :
- For each subset of size , we can verify if it covers all edges in time.
- The total time complexity is , which is polynomial in terms of the input size.
Therefore, is in P.
Conclusion
Since both problems can be solved in polynomial time, both and are in class P.
Free practice · Your answers on this page are not saved.
