Skip to content
Official PYQ · 2022

GATE CS 2022 Q48 — Minimum Spanning Trees

Explain with AI
Let G(V,E)\textit{G(V,E)} be a directed graph, where V={1,2,3,4,5}\textit{V} = \{ 1, 2, 3, 4, 5 \} is the set of vertices and E\textit{E} is the set of directed edges, as defined by the following adjacency matrix A.\textit{A}.
A[i][j]={1,1≤j≤i≤50,otherwiseA [i][j] = \left\{\begin{matrix} 1, & 1 \leq j \leq i \leq 5 \\ 0, & \text{otherwise}\end{matrix}\right. A[i][j]=1A[i][j] = 1 indicates a directed edge from node ii to node j.j. A directed spanning tree\textit{directed spanning tree} of G,G, rooted at r∈V,r \in V, is defined as a subgraph TT of GG such that the undirected version of TT is a tree, and TT contains a directed path from rr to every other vertex in V.V. The number of such directed spanning trees rooted at vertex 55 is __________________.
View worked solution

Answer: 24

A directed spanning tree (or arborescence) rooted at vertex 55 is a subgraph where every vertex v≠5v \neq 5 has exactly one incoming edge, and there is a directed path from 55 to every other vertex.

From the given adjacency matrix AA, a directed edge exists from ii to jj if and only if i≥ji \geq j. Excluding self-loops, a directed edge i→ji \to j exists only when i>ji > j. This means edges always go from a higher-numbered vertex to a lower-numbered vertex, which naturally prevents any cycles.

To construct a directed spanning tree rooted at 55, we must choose exactly one incoming edge (parent) for each vertex j∈{1,2,3,4}j \in \{1, 2, 3, 4\} from the set of vertices {i∣i>j}\{i \mid i > j\}:

  • Vertex 4: Parent must be in {5}\{5\}   ⟹  1\implies 1 choice.
  • Vertex 3: Parent can be in {4,5}\{4, 5\}   ⟹  2\implies 2 choices.
  • Vertex 2: Parent can be in {3,4,5}\{3, 4, 5\}   ⟹  3\implies 3 choices.
  • Vertex 1: Parent can be in {2,3,4,5}\{2, 3, 4, 5\}   ⟹  4\implies 4 choices.

Since these choices are independent and always guarantee a path from the root 55 to all other vertices, the total number of directed spanning trees is:

1×2×3×4=241 \times 2 \times 3 \times 4 = 24

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Minimum Spanning Trees questions