prim' algorithm notes prim' algorithm is an algorithm in graph theory that finds minimum spanning tree for connected weighted graph this means it finds subset of the edges that forms tree that includes every vertexwhere the total weight of all the edges in the tree is minimized the algorithm was discovered in by mathematician vojtich jarnik and later independently by computer scientist robert prim in and rediscovered by edsger dijkstra in therefore it is sometimes called the djp algorithmthe jarnik algorithmor the prim-jarnik algorithm figure diagrammatic representation of prim' algorithm algorithm let (vewhich is represented by an adjacency list adj some support data structures is an array of size |veach [icontains the shortest distance for vertex is priority queue of unknown vertices is an array of size |veach [icontains the parent of vertex is the source vertex prim(gs initialize [swith [swith and all other [ ( !=swith positive infinity and [ ( !=swith < /initialize with all vertices as unknown while not empty do begin <extractmin( / is modified mark as known /dequeing is the same as marking it as known for each vertex in adj[udo begin if is unknown and [vweight(uv)then do begin [vweight(uv/update with shorter weight [vu /update ' parent as lovely professional university