形式陈述
Floyd–Warshall 求所有点对最短路。令
按
直觉
任一最短路径要么不用新允许的中间点
例子与边界
三顶点中即使直接边
推论与应用
Floyd–Warshall 适合稠密图、传递闭包、最短路径矩阵和小规模动态网络,也是 min-plus 代数与区间动态规划的经典实例。
参考资料
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein, Introduction to Algorithms, 4th ed., MIT Press, 2022,Parts I–VI。
- Jon Kleinberg and Éva Tardos, Algorithm Design, Pearson, 2005,Chs. 1–13。