Minimum Spanning Tree · Algorithms
40 questions · asked in 23 of 27 years (2000–2026)
MCQ 26 · MSQ 3 · NAT 111-mark 16 · 2-mark 24
2000Questions per year2026
Questions 26–30 of 40
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry in the matrix W below is the weight of the edge {i, j}.
What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T?
What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T?
Answer: (D)
First find the MST on the vertices {1, 2, 3, 4}. After that, add vertex 0 as a leaf.
MST of {1, 2, 3, 4}: edges 3-4 (2), 2-4 (3) and 1-3 (4). Their sum is 9.
Now join 0 using its cheapest edge. This is 0-1 or 0-3, with weight 1.
Total = 9 + 1 = 10
Answer: 10
MST of {1, 2, 3, 4}: edges 3-4 (2), 2-4 (3) and 1-3 (4). Their sum is 9.
Now join 0 using its cheapest edge. This is 0-1 or 0-3, with weight 1.
Total = 9 + 1 = 10
Answer: 10
Consider the following graph:
Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskal's algorithm?
Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskal's algorithm?
Answer: (D)
Kruskal's algorithm looks at the edges in non-decreasing order of weight. The weights are: b-e 2; a-c 3, e-f 3; b-c 4, f-g 4; a-b 5, c-d 5, e-g 5; the rest are 6.
The MST has 6 edges: b-e (2), then a-c and e-f (3, either order), then b-c and f-g (4, either order), then c-d (5). The edges a-b and e-g (5) are rejected because they close a cycle (a-c-b and e-f-g).
(A), (B) and (C) have weights 2, 3, 3, 4, 4, 5 in order, so all are valid sequences.
(D) adds b-c (weight 4) before a-c (weight 3). At that point a-c would join two different components, so Kruskal would take it first. So (D) is not a possible sequence.
Answer: (D)
The MST has 6 edges: b-e (2), then a-c and e-f (3, either order), then b-c and f-g (4, either order), then c-d (5). The edges a-b and e-g (5) are rejected because they close a cycle (a-c-b and e-f-g).
(A), (B) and (C) have weights 2, 3, 3, 4, 4, 5 in order, so all are valid sequences.
(D) adds b-c (weight 4) before a-c (weight 3). At that point a-c would join two different components, so Kruskal would take it first. So (D) is not a possible sequence.
Answer: (D)
For the undirected, weighted graph given below, which of the following sequences of edges represents a correct execution of Prim's algorithm to construct a Minimum Spanning Tree?
Answer: (C)
Prim's algorithm grows one tree. It starts at any vertex and at each step adds the lightest edge that joins a vertex in the tree to a vertex outside it.
(C) is valid. Start at d.
- Tree {d}: lightest edge out is d-f (2).
- Tree {d, f}: lightest is f-c (3).
- Tree {d, f, c}: lightest is d-a (5).
- Tree {d, f, c, a}: lightest is a-b (1).
- Tree {d, f, c, a, b}: lightest is c-e (7).
- Add e. Lightest is f-h (8).
- Add h. Lightest is h-g (7).
- Add g. Lightest is g-i (3).
These are the edges (d,f), (f,c), (d,a), (a,b), (c,e), (f,h), (g,h), (g,i) in the same order.
(A) picks (a,b) and then (d,f), but neither d nor f is in the tree {a, b}.
(B) picks (g,h) when neither g nor h is in the tree built so far.
(D) picks (f,c) after (h,f), but at that point (f,d) is the lighter edge out of the tree.
Answer: (C)
(C) is valid. Start at d.
- Tree {d}: lightest edge out is d-f (2).
- Tree {d, f}: lightest is f-c (3).
- Tree {d, f, c}: lightest is d-a (5).
- Tree {d, f, c, a}: lightest is a-b (1).
- Tree {d, f, c, a, b}: lightest is c-e (7).
- Add e. Lightest is f-h (8).
- Add h. Lightest is h-g (7).
- Add g. Lightest is g-i (3).
These are the edges (d,f), (f,c), (d,a), (a,b), (c,e), (f,h), (g,h), (g,i) in the same order.
(A) picks (a,b) and then (d,f), but neither d nor f is in the tree {a, b}.
(B) picks (g,h) when neither g nor h is in the tree built so far.
(D) picks (f,c) after (h,f), but at that point (f,d) is the lighter edge out of the tree.
Answer: (C)
G is a graph on n vertices and 2n-2 edges. The edges of G can be partitioned into two edge-disjoint spanning trees. Which of the following is NOT true for G?
Answer: (D)
G has edges, and each of the two edge-disjoint spanning trees has edges, so every edge of G is in one of the trees.
(A) True. Take any vertices. Each tree, restricted to them, has no cycle, so it has at most edges. Two trees give at most edges.
(B) True. Each spanning tree is connected, so it has at least one edge across any cut. The trees share no edge, so every cut has at least 2 edges.
(C) True. The path between two vertices inside tree 1 and the path inside tree 2 use different edges.
(D) Not always true. Take two copies of sharing one vertex : and edges. Each splits into two edge-disjoint paths (1-2-3-4 and 3-1-4-2). Joining one such path from each copy gives a spanning tree, so G has two edge-disjoint spanning trees. But is a cut vertex: every path between a vertex in one copy and a vertex in the other passes through , so there are not two vertex-disjoint paths.
Answer: (D)
(A) True. Take any vertices. Each tree, restricted to them, has no cycle, so it has at most edges. Two trees give at most edges.
(B) True. Each spanning tree is connected, so it has at least one edge across any cut. The trees share no edge, so every cut has at least 2 edges.
(C) True. The path between two vertices inside tree 1 and the path inside tree 2 use different edges.
(D) Not always true. Take two copies of sharing one vertex : and edges. Each splits into two edge-disjoint paths (1-2-3-4 and 3-1-4-2). Joining one such path from each copy gives a spanning tree, so G has two edge-disjoint spanning trees. But is a cut vertex: every path between a vertex in one copy and a vertex in the other passes through , so there are not two vertex-disjoint paths.
Answer: (D)
What is the largest integer m such that every simple connected graph with n vertices and n edges contains at least m different spanning trees ?
Answer: (C)
A connected graph with n vertices and n edges has exactly one cycle (a spanning tree has edges, so there is one extra edge).
A spanning tree is got by removing exactly one edge, and the removed edge must be on the cycle (otherwise the graph is disconnected or the cycle stays). Removing a different cycle edge gives a different tree. So the number of spanning trees equals the length of the cycle.
In a simple graph a cycle has at least 3 edges, so every such graph has at least 3 spanning trees.
This graph (a triangle with one extra edge, ) has a cycle of length 3, so it has exactly 3 spanning trees. So 3 is reached, and no such graph has fewer. The largest m is 3. Option (D), n, is too big: this graph has but only 3 spanning trees.
Answer: (C)
A spanning tree is got by removing exactly one edge, and the removed edge must be on the cycle (otherwise the graph is disconnected or the cycle stays). Removing a different cycle edge gives a different tree. So the number of spanning trees equals the length of the cycle.
In a simple graph a cycle has at least 3 edges, so every such graph has at least 3 spanning trees.
This graph (a triangle with one extra edge, ) has a cycle of length 3, so it has exactly 3 spanning trees. So 3 is reached, and no such graph has fewer. The largest m is 3. Option (D), n, is too big: this graph has but only 3 spanning trees.
Answer: (C)
Keep practising