Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to find all possible paths between two nodes in a 246 nodes system.
조회 수: 1 (최근 30일)
이전 댓글 표시
ld=[1 2 2; 1 3 2; 1 4 3; 2 3 3; 3 4 2; 4 5 4; 4 6 4; 5 6 3];
first two column represent edge (node connectivity) of graph and third column represent distance between that line. For example: I want to know all paths from 3 to 4.
My answer will be :
[3 4]
[3 1 4]
[3 2 1 4]
Please help me to solve this. I already use Dijkstra algorithm but Dijkstra algorithm is in xy plane or xyz plane, which is not like my problem.
댓글 수: 2
Roger Stafford
2016년 5월 31일
The Dijkstra algorithm is concerned with finding the shortest path between a pair of nodes, or the shortest between a given source node and all the other nodes, and that would involve your column three. However, your request is different - you want all possible paths between a pair of nodes - so the Dijkstra algorithm would be of no use to you in any case, nor is there any use for your column three.
If you have a graph with 246 nodes, the chances are that you would have an astronomically large number of possible paths between nodes. What would you do with such a list after you have obtained it?
Walter Roberson
2016년 5월 31일
(Roger's comment has been copied there)
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!