知识卡片

普通读书笔记卡 · 3645.i.3

前驱矩阵用于还原全点对路径

理解等级:中级

前驱矩阵 Π 的元素 π_ij 记录从 i 到 j 某条最短路上 j 的前一个顶点;i=j 或不可达时为空。

固定一行对应以 i 为源的最短路径树,可沿前驱递归打印路径。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《算法导论(第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 π