Graph Traversals, Minimum Spanning Trees & Shortest Paths — GATE CS Previous Year Questions
Practise GATE CS previous year questions on Graph Traversals, Minimum Spanning Trees & Shortest Paths in Algorithms. Filter by year, marks and question type.
Public question previews
- Let G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path. Let s ∈ V be a vertex in G. For every u ∈ V and for every k ≥ 0, let dk(u) denote the weight of a shortest path (in terms of weight) from s to u of length at most k. If there is no path from s to u of length at most k, then dk(u) = ∞. Consider the statements: S1: For every k ≥ 0 and u ∈ V, dk+1(u) ≤ dk(u). S2: For every (u, v) ∈ E, if (u, v) is part of a shortest path (in terms of weight) from s to v, then for every k ≥ 0, dk(u) ≤ dk(v). Which one of the following options is correct? (2026 · 2 marks · MCQ)
- Let G(V, E) be a simple, undirected, edge-weighted graph with unique edge weights. Which of the following statements about the minimum spanning trees (MST) of G is/are true? (2026 · 2 marks · MSQ)
- Consider a complete graph Kn with n vertices (n > 4). Note that multiple spanning trees can be constructed over Kn. Each of these spanning trees is represented as a set of edges. The Jaccard coefficient between any two sets is defined as the ratio of the size of the intersection of the two sets to the size of the union of the two sets. Which one of the following options gives the lowest possible value for the Jaccard coefficient between any two spanning trees of Kn ? (2026 · 2 marks · MCQ)
- Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s in G, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from s to all vertices that are reachable from s in G? (2026 · 2 marks · MCQ)
- Let G be any undirected graph with positive edge weights, and T be a minimum spanning tree of G. For any two vertices, u and v, let d1(u, v) and d2(u, v) be the shortest distances between u and v in G and T, respectively. Which ONE of the options is CORRECT for all possible G, T, u and v? (2025 · 1 mark · MCQ)