GATE CSE 2018 Q57: Choosing x to maximize number of minimum spanning trees
- Algorithms
- 2 marks
- NAT
- No negative marking
Syllabus topic: Graph traversals, minimum spanning trees and shortest paths
Question
Consider the following undirected graph G:

Choose a value for that will maximize the number of minimum weight spanning trees (MWSTs) of G. The number of MWSTs of G for this value of is ______.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 4 (official GATE 2018 final answer key)
Concept used: Ties in edge weights create multiple MSTs; the number of MSTs is the product of the independent tie choices Kruskal's algorithm can make.
First step: Run Kruskal: take the edges of weight 1 and 3 first, then see how many ways the weight-4 edges can attach the left vertex, and choose so the right vertex also has a tie.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Graph traversals, minimum spanning trees and shortest paths
Every PYQ on this topic →Share this question
Source: official GATE 2018 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs