No. For a path with edges, adding to every edge changes its cost to
Different paths can have different numbers of edges, so this transformation need not preserve their order.
For a concrete Directed acyclic graph, use edges of weight , of weight , and of weight . Originally the route through has cost and beats the direct edge of cost . Adding makes every edge positive, but the direct route now costs , while the route through costs . Dijkstra's algorithm on the modified graph therefore returns a path that is not shortest in the original graph.
Figure 1.
Adding a constant to edge weights reverses the shortest-path choice
. Details.
The two-edge path receives the added constant twice; the direct path receives it once. This is the failure of uniform edge shifts to preserve shortest paths.

Articles by others on the same topic (0)

There are currently no matching articles.