Skip to content
GATEiit

GATE CSE 2022 Q58: Directed spanning trees rooted at vertex 5

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 EE is the set of directed edges, as defined by the following adjacency matrix AA.

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_____________.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 24 (official GATE 2022 final answer key)

Concept used: In a rooted directed spanning tree, every non-root vertex has exactly one incoming edge, and edges only go from higher to lower (or equal) labels.

First step: Vertex v<5v < 5 can take its incoming tree edge from any of v+1,…,5v+1, \ldots, 5; multiply the number of choices.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2022 CS question paper and final answer key, organised by IIT Kharagpur. Question paper · Answer key