Question
Let be a directed graph, where is the set of vertices and E is the set of directed edges, as defined by the following adjacency matrix A.
indicates a directed edge from node to node . A directed spanning tree of , rooted at , is defined as a subgraph of such that the undirected version of is a tree, and contains a directed path from to every other vertex in . 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 . A directed edge exists if and only if .
A directed spanning tree rooted at vertex 5 (an arborescence oriented away from the root) satisfies:
- The root vertex 5 has in-degree 0.
- Every other vertex has in-degree exactly 1 (meaning it chooses exactly one parent ).
- The edge must be directed from parent to child, so with , which requires .
Examining the available parent choices for each vertex:
- Vertex 4: Parent (1 choice).
- Vertex 3: Parent (2 choices).
- Vertex 2: Parent (3 choices).
- Vertex 1: Parent (4 choices).
Because every edge goes strictly from a higher-numbered vertex to a lower-numbered vertex (), 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:
24
Allowing self-loops 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.