Dijkstra algoritm coding on multileg itineraries
1 view (last 30 days)
Show older comments
Hi to everybody, I'm a fresh newby in this forum and actually to Matlab too.
I'm looking for a solution to a problem I heard would be resolvable with the Dijkstra algoritm, but I am not really sure if it would be the real solution.
My problem is the following:
- I got a list of 764 ocurrencies (Variables: Code, County_name, Lon, Lat);
- an another matrix with the distances between pairwise of 32 nodes
- The geodesic distance between pairwise of any singular origin/destination (764) and the nodes
I need to perform the calculation tha allow me to find the minimum distance between all the pairwise of the 764 ocurrencies passing by the two of the 32 nearest nodes
I'm working on it for a very lasting time, and also if I can conceptualise that in my mind, I'm looking to a good solution that could allow to me to manage all the new 500k+ and I think the Dijkstra algoritm would be a good solution, but I can't find right way to code it.
Hope someone could help, thanks
0 Comments
Accepted Answer
Yongjian Feng
on 27 Nov 2021
Dijkstra algorithm actually gives you the seudo-code of the implementation. Just need to translate that seudo-code into matlab. What do you mean "the right way" then?
3 Comments
Yongjian Feng
on 27 Nov 2021
My understanding is that Dijkstra's algorithm doesn't need node values. The nodes need indices to identify them, but no values needed.
But I think Dijkstra's algorithm uses fixed source node. Or say it gives you only the shortest pathes between the selected source node and another node.
More Answers (0)
See Also
Categories
Find more on Dijkstra algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!