Dijkstra's algorithm - shortest path problem
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Dijkstra algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!