@@ -29,37 +29,37 @@ Prim 的算法是[最小生成树](/dsa/spanning-tree-and-minimum-spanning-tree#
![Start with a weighted graph](img/3fa02a92a42fb716698c94c7be00d3b2.png"Prim's Algorithm Steps")
Start with a weighted graph
从加权图开始
![Choose a vertex](img/0a9c87dbc27df22e75cccdd13a84a82a.png"Prim's Algorithm Steps")
Choose a vertex
选择一个顶点
![Choose the shortest edge from this vertex and add it](img/c04ae230a37b672c7809bef2d94e39e7.png"Prim's Algorithm Steps")
Choose the shortest edge from this vertex and add it
从该顶点选择最短边并添加
![Choose the nearest vertex not yet in the solution](img/1c5a44938d86cf9108395ec9ed21983b.png"Prim's Algorithm Steps")
Choose the nearest vertex not yet in the solution
选择尚未在解决方案中的最近顶点
![Choose the nearest edge not yet in the solution, if there are multiple choices, choose one at random](img/c08c1ea47dae5eefa399f8f9a7d38a67.png"Prim's Algorithm Steps")
Choose the nearest edge not yet in the solution, if there are multiple choices, choose one at random
选择尚未出现在解决方案中的最近边,如果有多个选择,请随机选择一个
![Repeat until you have a spanning tree](img/63d1afb08e6d96c07ca2b18318cd3200.png"Prim's Algorithm Steps")