GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 47

Maximizing the number of minimum spanning trees

Algorithms · Graph Algorithms · Full GATE CSE 2018 paper

GATE 2018, Q47 2 marks · NAT
Report issue

Graph Algorithms

Question 47, GATE 2018: Name graph vertices top T, left L, bottom-left B, bottom-right C, right R. Edges: TL=4,LB=4,TB=1,BC=4,TC=3,TR=x,CR=5. Choose x to maximize the number of minimum-weight spanning trees; report that number.
Tap to enlarge
Answer & solution

Official answer: 4

Method

The cut property forces a uniquely lightest edge across a cut into every MST. Across {B}, TB=1 is strictly less than LB=4 and BC=4; across {C}, TC=3 is less than BC=4 and CR=5. Contract these two forced edges to a central component. Connecting L has two tied cost-4 choices. Connecting R has two choices only when x=5. These choices are independent and each yields four edges with no cycle, so their product counts actual spanning trees, not merely edge subsets.

Solution

Name the top vertex T, bottom-left B, bottom-right C, left L and right R. Edge TB of weight 1 is uniquely cheapest across the cut {B}; TC of weight 3 is uniquely cheapest across {C}. Both must be in every MST, independently of x. Contract them. L can connect to that component by either of its two weight 4 edges. R can connect by TR of weight x or CR of weight 5. At x=5 both choices tie, giving 2*2=4 MSTs. Otherwise only one right edge is cheapest and there are 2. The remaining BC edge would form a cycle with the two mandatory edges and cannot be chosen. Thus the maximum count is 4.

Original paper, page 20 · Answer key