知识卡片
重复平方把扩展次数降为对数
只需最终 L^(n−1),不必逐层保存所有矩阵。利用最小加法矩阵乘法的结合性,反复把路径矩阵自乘,使可覆盖边数翻倍;约 log n 次乘法,总时间 Θ(n³log n)。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第23章 所有结点对的最短路径 · 查看原书依据
In fact, we can compute L(n−1) with only ⌈lg(n – 1)⌉ matrix products by using the technique of repeated squaring: Since 2⌈lg(n – 1)⌉ ≥ n – 1, the final product is . The procedure FASTER-APSP implements this idea. It
参考来源
- 位置:《算法导论(第4版)》第23章《所有结点对的最短路径》(OEBPS/chapter023.xhtml,文本字符[10000,15000))。
- 结论依据:原文FASTER-APSP按 r 倍增,结束时 r≥n−1;每次矩阵乘法为 Θ(n³)。
- 原始内容:In fact, we can compute L ( n −1) with only ⌈ lg( n – 1) ⌉ matrix products by using the technique of repeated squaring : Since 2 ⌈ lg( n – 1) ⌉ ≥ n – 1, the final product is . The procedure F ASTER -APSP implements this idea. It