GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 22

Enumerating all minimum spanning trees

Algorithms · Graph Algorithms · Full GATE CSE 1995 paper

GATE 1995, Q22 5 marks · Descriptive
Report issue

Graph Algorithms

Question 22, GATE 1995: The weighted undirected graph has vertices A,B,C,D,E and edges AB=2, AE=3, BC=3, BD=4, CD=4, DE=5. Draw and count all minimum spanning trees. These are the edges visibly present in GFG p8. GateForum p15 omits the AB line while retaining a detached weight 2; also analyze that literal graph.
Tap to enlarge
Answer & solution

Answer: 2 minimum spanning trees, each of weight 12: {AB, AE, BC, BD} and {AB, AE, BC, CD} (no official key was published)

A spanning tree on five vertices has four edges. Graph, AB is the unique cheapest edge crossing the cut {A}, so it belongs to every MST. AE is the unique cheapest edge crossing {E}, and BC is the unique cheapest edge crossing {C}; these too are forced by the cut property. The three edges AB,AE,BC form a tree on A,B,C,E, with D still isolated. Connect D using either BD or CD, each of weight 4. Using DE of weight 5 instead would cost more. Thus the optimum total is 2+3+3+4=12 and there are exactly two choices.

Draw tree1 as E−(3)−A−(2)−B−(3)−C, with an additional B−(4)−D branch. Draw tree2 as the path E−(3)−A−(2)−B−(3)−C−(4)−D. The edge sets in the answer uniquely specify every diagram and show that both graphs are connected and acyclic. Forced edges plus the only two minimum connectors prove completeness, rather than merely exhibiting two examples.

If interpreted literally, A has only neighbor E, and {A,E} connects to the rest only through ED. Consequently AE=3 and ED=5 are forced. In the remaining BCD triangle, choose BC=3 and either BD=4 or CD=4. This gives exactly two spanning trees of minimum weight 15. The count happens to remain 2, but the trees and weights differ.

Original paper, page 8