Question

Let G(V,E)G(V, E) be a directed graph, where V={1,2,3,4,5}V = \{1, 2, 3, 4, 5\} is the set of vertices and E is the set of directed edges, as defined by the following adjacency matrix A.

A[i][j]={1,1≤j≤i≤50,otherwiseA[i][j] = \begin{cases} 1, & 1 \le j \le i \le 5 \\ 0, & \text{otherwise} \end{cases}

A[i][j]=1A[i][j] = 1 indicates a directed edge from node ii to node jj. A directed spanning tree of GG, rooted at r∈Vr \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 VV. The number of such directed spanning trees rooted at vertex 5 is_____________.

Official answer and solution
Official answer
24
From
Official GATE 2022 answer key

Solution

Determine the number of valid parent choices for each non-root vertex in a directed spanning tree (arborescence).

The graph has vertices V={1,2,3,4,5}V = \{1, 2, 3, 4, 5\}. A directed edge (i,j)(i, j) exists if and only if i≥ji \ge j.

A directed spanning tree rooted at vertex 5 (an arborescence oriented away from the root) satisfies:

  1. The root vertex 5 has in-degree 0.
  2. Every other vertex j∈{1,2,3,4}j \in \{1, 2, 3, 4\} has in-degree exactly 1 (meaning it chooses exactly one parent ii).
  3. The edge must be directed from parent to child, so (i,j)∈E(i, j) \in E with i≠ji \ne j, which requires i>ji > j.

Examining the available parent choices for each vertex:

  • Vertex 4: Parent i>4  ⟹  i∈{5}i > 4 \implies i \in \{5\} (1 choice).
  • Vertex 3: Parent i>3  ⟹  i∈{4,5}i > 3 \implies i \in \{4, 5\} (2 choices).
  • Vertex 2: Parent i>2  ⟹  i∈{3,4,5}i > 2 \implies i \in \{3, 4, 5\} (3 choices).
  • Vertex 1: Parent i>1  ⟹  i∈{2,3,4,5}i > 1 \implies i \in \{2, 3, 4, 5\} (4 choices).

Because every edge goes strictly from a higher-numbered vertex to a lower-numbered vertex (i>ji > j), there can be no directed or undirected cycles among any chosen parent edges. Furthermore, vertex 5 is the unique source with no incoming edges, and every vertex has a path from 5. Therefore, every combination of parent choices produces a valid directed spanning tree rooted at 5.

By the product rule:

Total directed spanning trees=1×2×3×4=24\text{Total directed spanning trees} = 1 \times 2 \times 3 \times 4 = 24
Final answer

24

Common trap

Allowing self-loops i=ji=j as tree edges, which would create cycles.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
58 of 65
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.