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.

The Gateway to Computer Science Excellence

+4 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.

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

+12 votes

Best answer

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.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,306 answers

198,314 comments

105,010 users