Linked answer questions
Statement for Linked Answer Questions 54 and 55:
An undirected graph contains () nodes named . Two nodes are connected if and only if . Each edge is assigned a weight . A sample graph with is shown below.
Shared with question 55.
Question
What will be the cost of the minimum spanning tree (MST) of such a graph with nodes?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2011 answer key
Solution
Apply Kruskal's algorithm to find which edges are included in the MST and evaluate the closed-form summation of their weights.
- The graph contains vertices . An edge exists with weight if and only if .
- List candidate edges in increasing order of weight:
- Weight 3: . Included in MST.
- Weight 4: . Included in MST.
- Weight 5: . Forms cycle with and , so discarded.
- Weight 6: . Connects to the tree. Included in MST.
- Weight 7: . Forms cycle with paths, discarded.
- Weight 8: . Connects to the tree. Included in MST.
- In general, for any step , the edge of weight connects new vertex to the tree without creating cycles, while edges of the form have larger weight and would create cycles.
- The complete set of edges in the MST consists of:
- with weight 3.
- with weight for all .
- Compute total MST cost:
Notice that for , , which is the weight of .
Evaluating the sum:
Adding the first edge of weight 3:
- Verification for small :
- For : . Edges are of weight 3 and of weight 4, sum = 7.
- For : . Edges are of weight 3, of weight 4, and of weight 6, sum = 13.
The formula holds for all .
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2011 Computer Science and Information Technology (CS)
- Question
- 54 of 65, printed as CS Q.54
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.