GATE CS 2026, set 1 · Question 41 · Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

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 dₖ(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 dₖ(u) = ∞.
Consider the statements:
S1: For every k ≥ 0 and u ∈ V, dₖ₊₁(u) ≤ dₖ(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, dₖ(u) ≤ dₖ(v).
Which one of the following options is correct?

  1. (A) Only S1 is true
  2. (B) Only S2 is true
  3. (C) Both S1 and S2 are true
  4. (D) Neither S1 nor S2 is true
Answer

Answer (A)

Answer from the official GATE CS 2026 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes