1. let G=(V,E) be an undirected weighted graph, and let T be the shortest path
spanning tree rooted at a vertex v. Suppose now that all the edge weights in G
are increased by a constant number c. Is T still the shortest path spanning
tree from v ?
網路上的解答說: Yes, 當用Dijkstra時都是選最小的edge加到shortest path, 故選到
的edge仍相同
可是我覺得怪怪的 不是提到Johnson的reweighting都會介紹每條edge增加固定的值
最短路徑會跟著改變 因為path上的edge數不一樣 這樣這題應該是No吧?
2. Can we modify Dijkstra's algorithm to solve the single source longest path
problem by changing minimum to maximum?
網路上的解答說: Yes, 把relax的小於改成大於
可是我找到一個反例:
1 1
B