# CMI2012-B-05b

504 views
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

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
0

i think statement should be true because in this question it says weight of every edge in graph is increased by 1 . so spanning tree and shortestpath will remain same.

1
if spanning tree is unique then it will not change ,,,,but , shortest path will change as mentioned solution is right
0
Is this a valid min spanning tree? with 6 vertices it should not any cycle and therefore not more than 5 edges.

## Related questions

1 vote
1
139 views
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 ... argument if you claim the statement is true or a counterexample if the statement is false. $T$ is still a minimum cost spanning tree of $G$.
2
766 views
Let $A$ be an array of $n$ integers, sorted so that $A[1] \leq A[2] \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there exist indices $k$ and $l$ such that $A[k]+A[l] = x$. Design an $O(n)$ algorithm for this problem.
1 vote
3
589 views
A certain string-processing language offers a primitive operation which splits a string into two pieces. Since this operation involves copying the original string, it takes $n$ units of time for a string of length $n$, regardless of the location of the cut. Suppose, now, that you ... $m + 1$ pieces. You may assume that all m locations are in the interior of the string so each split is non-trivial.
Let $A$ be an array of $n$ integers, sorted, so that $A[1] \leq A[2] \leq \dots A[n]$. Suppose you are given a number $x$ and you wish to find out if there are indices $k$ and $l$ such that $A[k]+A[l] = x$. Design an $O(n \log n)$ time algorithm for this problem.