GATE / CS ARCHIVE

GATE CSE 2026 SET 1 / QUESTION 41

Shortest paths with a bounded edge budget

Algorithms · Graph Algorithms · Full GATE CSE 2026 Set 1 paper

GATE 2026 Set 1, Q41 2 marks · MCQ
Report issue

Graph Algorithms

Question 41, GATE 2026: In an undirected integer-weighted graph, d_k(u) is the minimum weight of an s-to-u path with at most k edges, or infinity if none exists. S1 says d_(k+1)(u)≤d_k(u). S2 says that if edge (u,v) lies on a shortest s-to-v path, then d_k(u)≤d_k(v) for every k. Classify S1 and S2.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

In an undirected integer-weighted graph, dk(u) is the minimum weight of an s-to-u path with at most k edges, or infinity if none exists. S1 says dk+1(u)≤dk(u). S2 says that if edge (u,v) lies on a shortest s-to-v path, then dk(u)≤dk(v) for every k. Classify S1 and S2.

Approach

Compare nested feasible path sets for S1 and use an explicit small edge-budget counterexample for S2.

Step-by-step solution

1. Every path using at most k edges also uses at most k+1 edges. The feasible set for dk(u) is therefore contained in the feasible set for dk+1(u).
2. Minimizing over a larger set cannot increase the minimum. Hence dk+1(u)≤dk(u), including the situation where an unavailable path of value infinity becomes available. S1 is true without assuming positive weights.
3. For S2, consider four vertices s,a,u,v with edges s—a of weight 1, a—u of weight 1, u—v of weight 1, and s—v of weight 10. The shortest s-to-v path is s—a—u—v, of total weight 3, and it includes (u,v).
4. Impose budget k=1. There is no one-edge s-to-u path, so d₁(u)=∞. But the direct edge s—v is permitted, giving d₁(v)=10. The asserted inequality ∞≤10 is false.
5. Thus only S1 holds, option A. Being a prefix of an unrestricted shortest path does not imply being reachable under the same smaller edge budget. The counterexample uses strictly positive integer weights, so the failure does not depend on negative cycles or an ambiguity about repeated vertices.

Original paper, page 30 · Answer key