|
Hi all,
I am trying to find all possible shortest paths ( the path itself not the distance) for a undirected graph for which all weights are equal. The function
"graphshortestpath" gives only one possible shortest path between any two nodes while there may be many. How can I find the rest??
For my data, I have 64-node undirected graph for which the shortest path between nodes 1 and 3:
[dist,path,pred] = graphshortestpath(UG,1,3,'directed',false);
path
path = 1 7 55 3
and funny enough if you try to exchange the nodes you get another possible root for the shortest path betwen nodes 1 and 3.
[dist,path,pred] = graphshortestpath(UG,3,1,'directed',false);
path
path = 3 13 61 1
I'll come back with a whole code if needed.
Any ideas please?
Many thanks
|