edited by
1,167 views
7 votes
7 votes
Given an undirected weighted graph $G = (V, E)$ with non-negative edge weights, we can compute a minimum cost spanning tree $T = (V, E')$. We can also compute, for a given source vertex $s \epsilon V$ , the shortest paths from s to every other vertex in $V$. We now increase the weight of every edge in the graph by $1$. Are the following true or false, regardless of the structure of $G$? Give a mathematically sound argument if you claim the statement is true or a counterexample if the statement is false.

All the shortest paths from $s$ to the other vertices are unchanged.
edited by

1 Answer

Best answer
14 votes
14 votes

 

The given statement  "All the shortest paths from s to the other vertices are unchanged."  is false . From the above graph it is clear that the shortest path from $S$ to $D$ is $S\implies A\implies B\implies C\implies D$  and the cost is $6$.

Now, we increment the edge cost of  all the edges by $1$.

After the increment, the shortest  path from S to D gets changed. Now the shortest path becomes $S \implies E \implies D$  and shortest path cost is $9$. The above graph is the proof.

edited by

Related questions

12 votes
12 votes
4 answers
2
go_editor asked May 27, 2016
1,450 views
Let $A$ be an array of $n$ integers, sorted so that $A \leq A \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there exist indices $k$ a...
5 votes
5 votes
1 answer
4
go_editor asked May 23, 2016
964 views
Let $A$ be an array of $n$ integers, sorted, so that $A \leq A \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there are indices $k$ an...