知识卡片
Prim键值记录入树最轻边
Prim 对尚未入树顶点 v 保存 key:连接 v 与当前树的最小边权;父指针记录这条边的树内端点。
按 key 取最小者入树,再用新顶点的邻边更新其他键。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第21章 最小生成树 · 查看原书依据
For each vertex v, the attribute v.key is the minimum weight of any edge connecting v to a vertex in the tree, where by convention, v.key = ∞ if there is no such edge. The attribute v.π names the parent of v in the tree. The
参考来源
- 位置:《算法导论(第4版)》第21章《最小生成树》(OEBPS/chapter021.xhtml,文本字符[15000,20000))。
- 结论依据:原文定义 key 和父指针,并说明最小优先队列存全部未入树顶点。
- 原始内容:For each vertex v , the attribute v.key is the minimum weight of any edge connecting v to a vertex in the tree, where by convention, v.key = ∞ if there is no such edge. The attribute v .π names the parent of v in the tree. The