First page Back Continue Last page Graphics
Prim’s algorithm
Start with any vertex v, mark it and include it in the minimum spanning tree.
While there are unmarked vertices:
- Find the least cost edge (v,u) such that v is marked [marked = “in spanning tree” ] and u is not.
- Add u and edge (v,u) to the minimum spanning tree.