知识卡片
前驱矩阵用于还原全点对路径
前驱矩阵 Π 的元素 π_ij 记录从 i 到 j 某条最短路上 j 的前一个顶点;i=j 或不可达时为空。
固定一行对应以 i 为源的最短路径树,可沿前驱递归打印路径。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第23章 所有结点对的最短路径 · 查看原书依据
A full solution to the all-pairs shortest-paths problem includes not only the shortest-path weights but also a predecessor matrix Π = (πij), where πij is NIL if either i = j or there is no path from i to j, and otherwise π
参考来源
- 位置:《算法导论(第4版)》第23章《所有结点对的最短路径》(OEBPS/chapter023.xhtml,文本字符[0,5000))。
- 结论依据:原文定义Π元素及每行的前驱子图与打印过程。
- 原始内容:A full solution to the all-pairs shortest-paths problem includes not only the shortest-path weights but also a predecessor matrix Π = (π ij ), where π ij is NIL if either i = j or there is no path from i to j , and otherwise π