If G is a forest with n vertices and k connected components, how many edges does G have? A. |n/k| B. (n - k)/2 C. n - k D. n + k - 1

GATE 2014 · Discrete Mathematics · Graph Connectivity · medium

Answer: C. n - k

  1. Edge count per tree component: Component i has n_i vertices and n_i - 1 edges. This holds for all k components.
  2. Sum over all components: Total edges = sum_{i=1}^{k} (n_i - 1) = (n_1 + n_2 + ... + n_k) - k = n - k.