If G is a forest with n vertices and k connected components, how many edges does G have?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2014 Set 3 · Q51
Time
Select one answerSingle correct
Solution
Official answer: C) n - k
Graph TheoryA forest is a disjoint union of trees.
Let the -th connected component (tree) have vertices. A tree on vertices has exactly edges.
The total number of vertices in the forest is:
The total number of edges in the forest is:
Thus, the number of edges is , which corresponds to option (C).
Try the question first, then check your work.
Examiner trap
Each connected component of a forest is a tree, and a tree with vertices has edges.
This Graph Theory previous year question is Q51 of the GATE CSE 2014 Set 3 paper. Find more GATE CSE PYQs on Graph Theory in Engineering Mathematics, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Graph Theory PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Graph Theory has 21 GATE CSE PYQs across 14 papers from 2012 to 2026. 6 of them are 2-mark MCQs like this one, and GATE CSE 2014 Set 3 has 2.
How GATE tests Graph TheoryIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.