If G is a forest with n vertices and k connected components, how many edges does G have?

If G is a forest with n vertices and k connected components, how many edges does G have? Correct Answer n - k

Concept:

  • A group of trees is nothing but forest.


Explanation:

Example:

  • In above graph G there are 3 tress, k=3 and total 6 nodes, n=6 so if we subtract k from n then we will get number of edges equal to 3.
  • General formula to get total number of edges will be n – k


Hence option 3 is the correct answer.

Related Questions

If G is a forest with n vertices and K connected components, then how many edges does G have?