algorithm - 有向图所有路径中的最小权重边

标签 algorithm directed-graph

给定一个有向图,其边的权重为 -ve 或 +ve,找到从顶点 s 到顶点 d 的所有路径中权重最小的边的算法是什么?

最佳答案

来自 Wikipedia

您描述的是单一来源最短路径问题。如果边缘仅是正数,则可以使用 Dijkstra 解决;如果边缘也允许为负数,则可以使用 Bellman-Ford 来解决。

The most important algorithms for solving this problem are:

  1. Dijkstra's algorithm solves the single-source shortest path problem.
  2. Bellman–Ford algorithm solves the single-source problem if edge weights may be negative.
  3. A* search algorithm solves for single pair shortest path using heuristics to try to speed up the search.
  4. Floyd–Warshall algorithm solves all pairs shortest paths.
  5. Johnson's algorithm solves all pairs shortest paths, and may be faster than Floyd–Warshall on sparse graphs.
  6. Viterbi algorithm solves the shortest stochastic path problem with an additional probabilistic weight on each node.

关于algorithm - 有向图所有路径中的最小权重边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47251811/

相关文章:

c# - LRU页面置换算法C#

sql - 我可以使用 SQL 在下面给出的示例表中查找缺失的数字吗?

c++ - 如何从 CGAL::Triangulation_3 有效访问 std::list 中的顶点的 vertex_handle?

algorithm - 如何对深度优先搜索中未遍历的边进行分类?

algorithm - 在有向图和无向图上工作以检测循环的单一算法?

algorithm - 将二进制数组分成三部分,使每个部分代表相同的小数

java - Dictionary of unknown size - 查找一个词是否在字典中

r - igraph:定位标签并删除网格布局中的空白空间

algorithm - 确定有向图是否是单边的

algorithm - 将无向图转换为具有特定条件的有向图