如何利用Dijkstra计算次短路径

利用Dijkstra可以计算最短路径,那么次短路径和次次短路径呢,下面wiki说明了实现方法,与之前自己的想象一致。

来源:wiki:http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Related problems and algorithms[edit]

The functionality of Dijkstra’s original algorithm can be extended with a variety of modifications. For example, sometimes it is desirable to present solutions which are less than mathematically optimal. To obtain a ranked list of less-than-optimal solutions, the optimal solution is first calculated. A single edge appearing in the optimal solution is removed from the graph, and the optimum solution to this new graph is calculated. Each edge of the original solution is suppressed in turn and a new shortest-path calculated. The secondary solutions are then ranked and presented after the first optimal solution.

计算K Shortest Path最短路径还有专门的方法:

http://en.wikipedia.org/wiki/K_shortest_path_routing

    原文作者:Dijkstra算法
    原文地址: https://blog.csdn.net/yanhc519/article/details/39854577
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞