$./prims
graph:
start:
1.5 step/s
# algorithm
1Prim(G, s)
2begin
3 MST{s}; Qedges(s)
4 while |MST| < |V| do
5 (u,v)extractMin(Q)
6 if vMST then
7 MSTMST{v, (u,v)}
8 QQedges(v)
9end
# minimum spanning tree
43124321ABCDEF
current checking in MST MST edge
MST Weight
0
# mst edges
no edges yet
# candidate edges
no candidates
# current action
select a start node and click "run" to begin...