I need to find the count and enumerate ALL the shortest paths from a source node to a destination node. The edges may contain negative weights. I am unable to come up with an algorithm to do this.
Can someone help figure out how to go about this.
I need to find the count and enumerate ALL the shortest paths from a source node to a destination node. The edges may contain negative weights. I am unable to come up with an algorithm to do this.
Can someone help figure out how to go about this.
There are well known algorithms for finding the shortest path. Most notably Dijkstra's algorithm. Only Dijkstra's algorithm doesn't like negative edges (actually negative cycles). But Bellman-Ford doesn't mind them and it fairly simple to implement.