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!