If G is the forest with n vertices and k connected components, how many edges does G have? A. floor(n/k). B. ceil(n/k). C. n - k. D. n - k + 1.
GATE 2014 · Discrete Mathematics · Graph Connectivity · medium
Answer: n - k edges -> Option C.
- Edges of each tree: sum over i: sum (p_i - 1) = (sum p_i) - k
- Substitute the vertex total: sum p_i = n, so total edges = n - k