the prim-jarnik algorithm in the prim-jarnik algorithmwe grow minimum spanning tree from single cluster starting from some "rootvertex the main idea is similar to that of dijkstra' algorithm we begin with some vertex vdefining the initial "cloudof vertices thenin each iterationwe choose minimum-weight edge ( , )connecting vertex in the cloud to vertex outside of the vertex is then brought into the cloud and the process is repeated until spanning tree is formed againthe crucial fact about minimum spanning trees comes to playfor by always choosing the smallest-weight edge joining vertex inside to one outside cwe are assured of always adding valid edge to the mst to efficiently implement this approachwe can take another cue from dijkstra' algorithm we maintain label [ufor each vertex outside the cloud cso that [ustores the weight of the best current edge for joining to the cloud these labels allow us to reduce the number of edges that we must consider in deciding which vertex is next to join the cloud we give the pseudo-code in code fragment code fragment the prim-jarnik algorithm for the mst problem