JHF_Dijkstra-Algorithm_withUserHandling
版本 1.0 (14.5 KB) 作者:
Jacob Foster
Implementation of Dijkstra’s Algorithm with user handling
If your graphical representation of your network is in 0...inf format then this code will be able to handle user inputs of 0...inf since MATLAB is in 1...inf format. The outputs are even converted back to 0...inf format for easy analysis with your visualization. If your graphical representation is in 1...inf then no actions/conversions are taken on the source and destination node.
The default node map***
(1,2) = distance from 0 to vertex #1 which equals 4
(2,8) = distance from 1 to vertex #7 which equals 11
This code also has extra features. This code will ask the user for the desired source node, destination node, and if the code should find the shortest distance to all nodes or just the destination node. One extra feature is checking for out of range source and destination nodes that the user inputs. The other feature is exit handling in case the user wants to exit the program after the program has been started. These features are mostly unnecessary for the Dijkstra’s Algorithm but have some utility.
The cost matrix can be changed and defined manually.
引用格式
Jacob Foster (2024). JHF_Dijkstra-Algorithm_withUserHandling (https://github.com/JHFoster11/JHF_Dijkstra-s-Algorithm/releases/tag/1.0), GitHub. 检索来源 .
MATLAB 版本兼容性
创建方式
R2021a
兼容任何版本
平台兼容性
Windows macOS Linux标签
致谢
参考作品: dijkstra very simple
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0 |
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库。
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库。