《演算法(英文版·第4版)》勘誤(第621頁)
《演算法(英文版·第4版)》第 621 頁:
It builds the MST as follows:
- Adds 0 to the MST and all edges in its adjacency list to the priority queue, since each such edge is the best (only) known connection between a tree vertex and a non-tree vertex.
- Adds 7 and 0-7 to the MST and 1-7 and 5-7 to the priority queue. Edges 4-7 and 2-7 do not affect the priority queue because their weights are not less than the weights of the known connections from the MST to 4 and 2, respectively.
- Adds 1 and 1-7 to the MST and 1-3 to the priority queue.
- Adds 2 and 0-2 to the MST, replaces 0-6 with 2-6 as the shortest edge from a tree vertex to 6, and replaces 1-3 with 2-3 as the shortest edge from a tree vertex to 3.
- Adds 3 and 2-3 to the MST.
- Adds 5 and 5-7 to the MST and replaces 0-4 with 4-5 as the shortest edge from a tree vertex to 4.
- Adds 4 and 4-5 to the MST.
- Adds 6 and 6-2 to the MST.
After having added V-1 edges, the MST is complete and the priority queue is empty.
上面的圖和文字說明都有錯誤,修改如下:
It builds the MST as follows:
- Adds 0 to the MST and all edges in its adjacency list to the priority queue, since each such edge is the best (only) known connection between a tree vertex and a non-tree vertex.
- Adds 7 and 0-7 to the MST and 1-7 and 5-7 to the priority queue. Replace 0-4 with 4-7 as the shortest edge from a tree vertex to 4, and 2-7 do not affect the priority queue because its weight is not less than the weight of 0-2.
- Adds 1 and 1-7 to the MST and 1-3 to the priority queue.
- Adds 2 and 0-2 to the MST, replaces 6-0 with 6-2 as the shortest edge from a tree vertex to 6, and replaces 1-3 with 2-3 as the shortest edge from a tree vertex to 3.
- Adds 3 and 2-3 to the MST.
- Adds 5 and 5-7 to the MST and replaces 4-7 with 4-5 as the shortest edge from a tree vertex to 4.
- Adds 4 and 4-5 to the MST.
- Adds 6 and 6-2 to the MST.
After having added V-1 edges, the MST is complete and the priority queue is empty.
上面是使用即時 Prim 演算法來計算示例加權圖的最小生成樹的軌跡。這個示例加權圖及其最小生成樹如下所示:
它的鄰接表表示如下所示:
相關文章
- 《演算法(英文版·第4版)》勘誤(第869頁)演算法
- 《演算法(英文版·第4版)》勘誤(第891頁)演算法
- 《演算法(英文版·第4版)》勘誤(第734頁)演算法
- 《演算法(英文版·第4版)》勘誤(第653頁)演算法
- 《演算法(英文版·第4版)》勘誤(第678頁)演算法
- 《演算法(英文版·第4版)》勘誤(第640頁)演算法
- 《演算法(英文版·第4版)》勘誤(第573頁)演算法
- 《演算法(英文版·第4版)》勘誤的那些事兒演算法
- 《具體數學:電腦科學基礎(第2版)》勘誤(第30頁)
- 《具體數學:電腦科學基礎(第2版)》勘誤(第15頁)
- 《演算法4》勘誤表演算法
- Java Persistence with Hibernate中文版Hibernate實戰第2版勘誤Java
- 圖書勘誤記錄(非圖靈)《Django Web 開發指南》第8章圖靈DjangoWeb
- 演算法(第4版)演算法
- 專家審讀第5期——《演算法(第4版)》演算法
- 「iOS 面試之道」勘誤(二)iOS面試
- RedHat-勘誤列表(轉)Redhat
- URLScan工具配置方法第1/2頁
- 第19章405頁: NOT NULL問題Null
- 《演算法》第4版 導讀演算法
- 演算法導論-第6章演算法
- 第2章 在網頁中使用JavaScript網頁JavaScript
- lfs(systemv版本)學習筆記-第1頁筆記
- 《Oracle核心技術》勘誤——個人閱讀Oracle
- 朱棣文演講的翻譯勘誤
- 《HTMLCSSJavaScript網頁製作從入門到精通第3版》——第01章 HTML基礎HTMLCSSJavaScript網頁
- KMP演算法(Leetcode第28題)KMP演算法LeetCode
- 《啊哈!演算法》第6章最短路徑演算法
- 《啊哈!演算法》第7章 神奇的樹演算法
- 《HTMLCSSJavaScript網頁製作從入門到精通第3版》——第02章 HTML基本標記HTMLCSSJavaScript網頁
- 《微積分入門》(修訂版)-第31頁-筆記筆記
- 第 15 章 標籤頁和工具提示外掛
- 《普林斯頓數學指南》勘誤
- 《數學分析八講(修訂版)》勘誤
- 《啊哈!演算法》第5章 圖的遍歷演算法
- 非常經典的演算法書! ——評《演算法》(第4版)演算法
- [開發教程]第4講:在網頁中使用 Bootstrap網頁boot
- 《Crafting Rails 4 Applications》的筆記-第28頁RaftAIAPP筆記