Firstly, the adjacency matrix or adjacency table is used to store the graph in the shortest path problem of single source. Secondly, Dijkstra algorithm, Bellman Ford algorithm and its improved algorithm, SPFA algorithm, are used to find the shortest path from a certain source point to other vertices. Then, Matlab is used as the development platform to code the algorithm of single source shortest path mining, and the simulation and implementation of the algorithm are completed. Finally, through the test and comparison of these three algorithms, the following conclusions are drawn:<br>(1) Dijkstra: single source shortest path for graphs with nonnegative weight values.<br>(2) Bellman Ford: it is applicable to the single source shortest path of graphs with negative weights, and can detect negative cycles.<br>(3) SPFA: it is applicable to the single source shortest path of graphs with negative weights and no negative cycles.
正在翻译中..