GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A weighted undirected graph has vertices A–F and edges AB 1, BC 1, CA 1, CD 2, DE 2, EC 2, EF 3, FD 3, AF 7. How many distinct minimum spanning trees does it have?
- A. 18
- B. 9
- C. 12
- D. 27
Correct answer: A. 18
The MST weight is 9. Triangle ABC (all weights 1) contributes any 2 of its 3 edges (3 ways), triangle CDE (all weights 2) any 2 of 3 (3 ways), and F attaches by exactly one of the two weight-3 edges (2 ways): 3 × 3 × 2 = 18. The edge AF 7 never enters.
More Algorithms questions
- A weighted undirected graph on vertices A–G has edges AB 4, AC 8, BC 2, BD 5, CD 9, CE 10, DE 3, DF 11, EF 4, EG 7, FG 5, BG 20. Its MST…
- How many spanning trees does the wheel graph W₅ have (a hub joined to every vertex of a 5-cycle: 6 vertices, 10 edges)?
- How many spanning trees does the 3-dimensional hypercube Q₃ (8 vertices, 12 edges) have?
- A DAG on vertices 1–8 has edges 1→2, 1→3, 2→4, 3→4, 4→5, 4→6, 5→7, 6→7, 3→8, 8→7. How many different topological orderings does it have?
- A DFS on a directed graph processes vertices in alphabetical order and each adjacency list in alphabetical order. Edges: A→B, A→C, A→E…
- A directed graph on A–K has edges A→B, B→C, C→A, C→D, D→E, E→F, F→D, G→F, G→H, H→I, I→G, B→H, E→J, K→J, K→A. Let s be its number of…