Consider a weighted undirected graph with positive edge weights and let (u, v)…
20072012
Consider a weighted undirected graph with positive edge weights and let (u, v) be an edge in the graph. It is known that the shortest path from the source vertex s to u has weight 53 and the shortest path from s to v has weight 65. Which one of the following statements is always true?
Answer: D. weight (u, v) ≥ 12 — Conclusion: weight(u, v) ≥ 12. Reason: By the triangle inequality for shortest paths, the shortest distance from the source to v is at most the shortest…
- A.
weight (u, v) < 12
- B.
weight (u, v) ≤ 12
- C.
weight (u, v) > 12
- D.
weight (u, v) ≥ 12
Attempted by 175 students.
Show answer & explanation
Correct answer: D
Conclusion: weight(u, v) ≥ 12.
Reason:
By the triangle inequality for shortest paths, the shortest distance from the source to v is at most the shortest distance to u plus the edge weight: 65 ≤ 53 + weight(u, v).
Rearranging gives weight(u, v) ≥ 65 − 53 = 12.
Thus the only statement that is always true is that the edge weight is at least 12. The edge weight could equal 12 (so statements claiming strictly greater than 12 are false) and it could be larger than 12 if the direct edge is not used by the shortest path to v (so statements claiming ≤ 12 are false).
Example to illustrate equality: if the shortest path to u is 53 and the edge (u, v) has weight 12 and that edge is used on the shortest path to v, then the shortest path to v is 53 + 12 = 65, so weight(u, v) = 12 is possible.
A video solution is available for this question — log in and enroll to watch it.
Explore the full course: Iocl Engineers Officers Grade A Paper 2