• edited by
1,786 views
5 5 votes

S1: In a weighted graph, assume that the shortest path from a source 's' to a destination 't' is correctly calculated using a shortest path algorithm. Is the following statement true? If we increase weight of every edge by 1 , the shortest path always remains same.

S2: Given a graph, suppose we have calculated shortest path from a source to all other vertices. If we modify the graph such that weights of all edges become double of the original weight, then the shortest path remains same, only the total weight of path changes.

  1. True, true
  2. True, false
  3. False, true
  4. False, false

2 Answers

Best answer
5 5 votes

By using counter Example:

Here shortest path from s TO t is A to B and B to D. Let's increase edge weight of each edge by 3. Now the shortes path from s To t is A to D that is 7. So S1 is false.

if we multiply edge weights with same number the edge weights are increased in same ratio so No change in path but total weight has been changed.

So ans is option C.

• selected by
4 4 votes

Consider above graph,

S1)

Now suppose shortest path from S to A was S-B and then B-A. shortest path length = SB + BA = 5+5 =10

Now if we increase weight of each edge by 1, then new shortest path will be

shortest path length = min (SB + BA, SA)= min(6+6,11) =11

that means shortest path has changed. So S1 is wrong

S2)

Now even if we double the edge weight shortest path remains the same

shortest path length = min(SB + BA, SA) = min(10+10,20) = 20

that means shortest path is still S-B and then B-A

So S2 is correct

Hence answer should be C)

Position:
Show:

Related questions

1 1 vote
3 3 answers
5.3k
5.3k views
Rakesh K asked Nov 27, 2016
5,323 views
Consider the multistage graph with $\mathrm{K}=5$ then find out minimum cost from S to T ?$1 \rightarrow 3 \rightarrow 6 \rightarrow 8 \rightarrow 9$$1 \rightarrow 2 \rig...
1 1 vote
1 answers 1 answer
1.1k
1.1k views
jenny101 asked Oct 26, 2016
1,072 views
Q43.Given that s is the source vertex, what is the total length of the shortest path tree?
1 1 vote
1 1 answer
239
239 views
GO Classes asked Oct 16, 2024
239 views
Let $\text{G = (V, E)}$ be a weighted directed graph. The shortest path from a node $s \in \text{V}$ to a node $t \in \text{V}$ will remain unchanged if: (Multiple option...
0 0 votes
0 0 answers
716
716 views
Vaishnavi01 asked Nov 19, 2018
716 views