Shortest path is cycle-free

Shortest path is cycle-free

Content #

Shortest path cannot contain a negative-weight cycle, nor cat it contain a positive-weight cycle, since removing the cycle from the path produces a path with the same source and destination vertices and a lower path weight.

Shortest path have no cycles, that is, they are simple paths. Since any acyclic path in a graph G=(V,E) contains at most |V| distinct vertices, it also contains at most |V|-1 edges. Therefore, any shortest path contains at most |V|-1 edges;

From #