weights of those edgeswe could save timebecause we would then only have to check the weights mentioned in that array or list for the above graphstarting with { }the tree is built up as followsa it is slightly more challenging to produce convincing argument that this algorithm really works than it has been for the other algorithms we have seen so far it is clear that prim' algorithm must result in spanning treebecause it generates tree that spans all the verticesbut it is not obvious that it is minimal there are several possible proofs that it isbut none are straightforward the simplest works by showing that the set of all possible minimal spanning trees xi must include the output of prim' algorithm let be the output of prim' algorithmand be any minimal spanning tree the following illustrates such situationwe don' actually need to know what is we just need to know the properties it must satisfyand then systematically work through all the possibilitiesshowing that is minimal spanning tree in each case clearlyif then prim' algorithm has generated minimal spanning tree otherwiselet be the first edge added to that is not in thensince is spanning treeit must include path connecting the two endpoints of eand because circles are not allowedthere must be an edge in that is not in which we can call since prim' algorithm added rather than we know weight( <weight( then create tree that is with replaced by clearly is connectedhas the same number of edges as spans all the verticesand has total weight no greater than so it must also