Dijkstra's algorithm - shortest path problem
조회 수: 6 (최근 30일)
이전 댓글 표시
I calculated the shortest paths in a grid network of links with the same length in the smaller grid and the same length in the bigger grid in a digraph using 'positive' method explained in "shortest path MATLAB documentation". The network formation is shown in the attached figure. If I calculate the shortest path from node 19 to 32, it gives me one path. But if I calculate from 32 to 19, it gives me two paths.(The network is a digraph but only for visual purpose, it is a single line graph)
This problem can be solved by renaming the nodes in a sequence. Which means that (number 7) which is appearing between node 19 and 32 will not be there, rather a sequential number.
The problem is solved but I want to know why it is like this. Why Dijkstra's algorithm takes into account the node numbers.. shouldn't it be independent of them?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dijkstra algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!