Prim's Algorithm repeat find minimal edge (u,v) connecting A to a vertex not in A A = A {(u,v)} until all vertices are in A
Implementation
Maintain a priority queue Q of vertices of the form
Starting from some root vertex r Update key and parent slots of vertices on A adjacent to r Extract minimum-key vertex v from those adjacent to r r = V