find all possible paths of length K from source node to any other nodes????
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want the the code to find all paths of length K originating from source node to other nodes in the graph , where source node is the node that the path of length K will start in it ,and the other node are all nodes the path will end in it . note no edge appear more than once in path
0 Kommentare
Antworten (1)
Walter Roberson
am 27 Mär. 2014
Read about the Dijkstra algorithm. It will not be exactly what you need in order to record all the paths, but it will form the mathematical basis for finding those paths.
See also:
With the breadth-first approach mentioned above, you could stop after descending K deep.
Steve Lord examined a number of shortest path approaches.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!