Update the book based on the revised second edition (#1014)

* Revised the book

* Update the book with the second revised edition

* Revise base on the manuscript of the first edition
This commit is contained in:
Yudong Jin
2023-12-28 18:06:09 +08:00
committed by GitHub
parent 19dde675df
commit f68bbb0d59
261 changed files with 643 additions and 647 deletions

View File

@@ -30,7 +30,7 @@ $$
![连通图与非连通图](graph.assets/connected_graph.png)
我们还可以为边添加“权重”变量,从而得到如下图所示的「有权图 weighted graph」。例如在王者荣耀等手游中,系统会根据共同游戏时间来计算玩家之间的“亲密度”,这种亲密度网络就可以用有权图来表示。
我们还可以为边添加“权重”变量,从而得到如下图所示的「有权图 weighted graph」。例如在王者荣耀等手游中,系统会根据共同游戏时间来计算玩家之间的“亲密度”,这种亲密度网络就可以用有权图来表示。
![有权图与无权图](graph.assets/weighted_graph.png)
@@ -70,7 +70,7 @@ $$
观察上图,**邻接表结构与哈希表中的“链式地址”非常相似,因此我们也可以采用类似的方法来优化效率**。比如当链表较长时,可以将链表转化为 AVL 树或红黑树,从而将时间效率从 $O(n)$ 优化至 $O(\log n)$ ;还可以把链表转换为哈希表,从而将时间复杂度降至 $O(1)$ 。
## 图常见应用
## 图常见应用
如下表所示,许多现实系统可以用图来建模,相应的问题也可以约化为图计算问题。