algorithm - 用A*算法找出几条最短路径

标签 algorithm graph routes shortest-path

我正在制作一个使用 A* 算法寻找路线的路线选择应用程序。 我不仅要提供一条路线,还要提供几条备选路线。例如,比最佳路线稍长的路线。

由于 A*(和许多其他)只能找到一条路线,我该如何搜索这些备选路线?我应该使用其他算法吗?

最佳答案

您可能需要研究关于 K shortest paths 的研究问题,也就是寻找两个节点之间的k条最短路径的问题。维基百科页面上描述的算法是 Dijkstra's algorithm 的概括。 .

To find the shortest path one can use shortest path algorithms such as Dijkstra’s algorithm or Bellman Ford algorithm and extend them to find more than one path. The K Shortest path routing algorithm is a generalization of the shortest path problem. The algorithm not only finds the shortest path, but also K other paths in order of increasing cost. K is the number of shortest paths to find. The problem can be restricted to have the K shortest path without loops (loopless K shortest path) or with loop.

一些关键论文和概念:

关于algorithm - 用A*算法找出几条最短路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28739853/

相关文章:

algorithm - 存储树和图的数据?

php - 最小化 Zend 框架路由

logging - 创建一个中间件 Controller 以处理Dart中对Aqueduct的所有请求

algorithm - 如何选择加权项目以实现利润最大化?

c - 如何从二维数组中删除位于 C 主对角线上的负元素

python - 使用 NetworkX 的社区检测算法

c++ - 用 2x1 榻榻米垫填充 HxW 房间有多少种方法?

java - TGF 图创建和查看

java - Swagger UI 和 Play 路由 *path

c++ - 以最低成本在城市中 build 街道的算法?