secondly. 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.<br>
正在翻译中..