Let 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 be a vertex in . For every and for every , let denote the weight of a shortest path (in terms of weight) from to of length at most . If there is no path from to of length at most , then .
Consider the statements:
S1: For every and .
S2: For every , if is part of a shortest path (in terms of weight) from to , then for every .
Which one of the following options is correct?
View worked solution
Answer: A
Statement S1: True
Let be the set of all paths from to of length at most . Any path of length at most is also a path of length at most . Therefore, we have the subset relation:
Since is the minimum weight over the set , taking the minimum over a larger set cannot increase the minimum weight. Thus, always holds.
Statement S2: False
We can disprove this statement using a counterexample with positive integer weights. Consider an undirected graph with vertices and the following edge weights:
The shortest path from to is with a total weight of . The edge is part of this shortest path.
Now, let us evaluate and for :
- (via the direct path of length 1)
- (via the direct path of length 1)
Since , the condition is violated for . Thus, is false.
Free practice · Your answers on this page are not saved.
