I have a directed weighted graph, with positive weights, which looks something like this :-
What I am trying to do is:-
- Find all possible paths between two nodes.
- Arrange the paths in ascending order, based on their path length (as given by the edge weights), say top 5 atleast.
- Use an optimal way to do so, so that even in cases of larger number of nodes, the program won't take much time computing.
E.g.:- Say my initial node is d, and final node is c. So the output should be something like
d to c = 11
d to e to c = 17
d to b to c = 25
d to b to a to c = 31
d to b to a to f to c = 38
How can I achieve this?