GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 34

Count all labelled spanning trees of K4

Discrete Mathematics · Trees & Connectivity · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q34 1 mark · NAT
Report issue

Trees & Connectivity

Question 34, GATE 2024: How many spanning trees does the complete graph on four labelled vertices A, B, C and D have?
Tap to enlarge
Answer & solution

Official answer: 16

Approach: A spanning tree uses all vertices, is connected and has no cycle. Since the graph is complete, every labelled tree on these vertices is available.
1. Cayley's formula states that the complete graph Kn has nn−2 labelled spanning trees. Substituting n=4 gives 4²=16.
2. We can verify this without the formula by classifying four-vertex tree shapes. A tree has three edges. It is either a star with one vertex of degree 3 or a path with degrees 1,2,2,1.
3. There are four stars, one for each choice of centre. For a path, arrange all four labels in an order. Reversing the order describes the same undirected path, so there are 4!/2=12 paths.
4. These shapes are disjoint and exhaustive, giving 4+12=16.
Answer: 16. Counting arbitrary three-edge subsets would also include disconnected or cyclic selections, so not every such subset is a spanning tree.

Original paper, page 21 · Answer key