Bellman-Ford: all shortest paths
I've successfully implemented Bellman-Ford to find the distance of the shortest path when edges have negative weights/distances. I've not been able to get it to return all shortest paths (when there are ties for shortest). I managed to get all shortest paths (between a given pair of nodes) with Dijkstra. Is this possible with Bellman-Ford? (just want to know if I'm wasting my time trying) If you alter the second step of the Bellman-Ford algorithm a little bit you can achieve something very similar: for i from 1 to size(vertices)-1: for each edge uv in edges: // uv is the edge from u to v u :=