《演算法(英文版·第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 演算法來計算示例加權圖的最小生成樹的軌跡。這個示例加權圖及其最小生成樹如下所示:
它的鄰接表表示如下所示:
相關文章
- 第134期 勘誤且自嘲一下(20240115)
- 《C Primer Plus》,362頁勘誤
- 《怎樣解題:數學競賽攻關寶典(第3版)》勘誤
- 《普林斯頓數學指南》勘誤
- 「iOS 面試之道」勘誤(二)iOS面試
- URLScan工具配置方法第1/2頁
- 第19章405頁: NOT NULL問題Null
- 《演算法》第4版 導讀演算法
- 演算法導論-第6章演算法
- KMP演算法(Leetcode第28題)KMP演算法LeetCode
- 第2章 在網頁中使用JavaScript網頁JavaScript
- MIDI檔案格式分析(補充和勘誤)
- lfs(systemv版本)學習筆記-第1頁筆記
- [ChatGPT 勘誤] 關於 CL_WB_PGEDITOR 的用途ChatGPT
- 關於 RemoteViews 跨程式資源訪問的勘誤REMView
- 小書MybatisPlus第4篇-表格分頁與下拉分頁查詢MyBatis
- [開發教程]第4講:在網頁中使用 Bootstrap網頁boot
- C++面試八股文:技術勘誤C++面試
- r 資料探勘入門 最後一章 勘誤
- Nuxt3+PM2叢集模式啟動及勘誤UX模式
- [ChatGPT 勘誤] SAP UI5 的 sap.ui.base.ObjectChatGPTUIObject
- 第3章 區塊鏈骨骼:密碼演算法區塊鏈密碼演算法
- 《微積分入門》(修訂版)-第31頁-筆記筆記
- [ChatGPT 勘誤] SAP ABAP 裡 cl_r3standard_persistence 的用途?ChatGPT
- Go常見錯誤第15篇:interface使用的常見錯誤和最佳實踐Go
- 第 0 天/第 1 天/第 2 天:雲時代的軟體生命週期
- 第4章 區塊鏈靈魂:共識演算法區塊鏈演算法
- 《啊哈!演算法》-第 2 章:棧、佇列、連結串列演算法佇列
- 第15課
- 第2關
- iis 建立應用程式池的方法與分析第2/3頁
- iis 建立應用程式池的方法與分析第3/3頁
- 《普林斯頓概率論讀本》第489頁的一個記號
- [開發教程]第28講:Bootstrap導航路徑與分頁器boot
- Python 潮流週刊第 43 期(摘要),贈書 5 本《Python資料結構與演算法分析(第3版)》Python資料結構演算法
- 演算法:利用分治演算法求解N個元素中的第M大元素演算法
- 《演算法圖解》總結第 7 章:狄克斯特拉演算法演算法圖解
- 面試準備-《演算法第4版》Java演算法筆記、理解整理面試演算法Java筆記
- 科技愛好者週刊(第 111 期):智慧電視的誤區