知识卡片
BF逐轮松弛并验负环
- Bellman-Ford 初始化后,对全部边重复松弛 |V|−1 轮;
- 末尾再检查是否仍有边可降低估计。
若有,则报告从源点可达的负权环;否则返回最短路结果。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第22章 单源最短路径 · 查看原书依据
The Bellman-Ford algorithm solves the single-source shortest-paths problem in the general case in which edge weights may be negative. Given a weighted, directed graph G = (V, E) with source vertex s and weight function w : E
参考来源
- 位置:《算法导论(第4版)》第22章《单源最短路径》(OEBPS/chapter022.xhtml,文本字符[15000,20000))。
- 结论依据:原文伪代码先重复扫描边,再用一轮不等式检查并返回布尔值。
- 原始内容:The Bellman-Ford algorithm solves the single-source shortest-paths problem in the general case in which edge weights may be negative. Given a weighted, directed graph G = ( V , E ) with source vertex s and weight function w : E