The GATE Grind

GATE Programming, Data Structures and Algorithms: Graph theory and basic graph algorithms – Previous Year Questions

5 GATE previous year questions on Graph theory and basic graph algorithms (Programming, Data Structures and Algorithms, Data Science and Artificial Intelligence) with answers and explanations, from every paper.

  1. GATE 2024 DA Q14 (1 mark, Multiple choice) – Consider performing depth-first search (DFS) on an undirected and unweighted graph G starting at vertex s. For any vertex u in G, d[u] is the length…
  2. GATE 2024 DA Q51 (2 marks, Multiple select) – Consider the directed acyclic graph (DAG) below: [Figure: a DAG with the edges P → Q, R → Q, Q → S, Q → V, S → U and V → T.] Which of the following…
  3. GATE 2025 DA Q58 (2 marks, Multiple select) – Let G be a simple, unweighted, and undirected graph. A subset of the vertices and edges of G are shown below. [Figure: Eight vertices in two rows. Top…
  4. GATE 2025 DA Q65 (2 marks, Numerical answer) – Consider a directed graph G = (V, E), where V = \0, 1, 2, , 100\ and E = \(i, j) : 0 < j - i 2, for all i, j V\. Suppose the adjacency list of each…
  5. GATE 2026 DA Q40 (2 marks, Multiple choice) – Consider a directed graph G = (V, E), where V is the finite set of vertices and E is the set of directed edges between the vertices. G may contain…