Start Prim's algorithm at vertex , since the source does not specify a starting vertex. Write every undirected edge with its smaller endpoint first. With lexicographic tie-breaking, the accepted edges are , of total weight 9.
Initially is the cheapest crossing edge. The next minimum is a weight-two tie between and , so choose . Then the weight-two tie between and is resolved in favour of . Adding vertex exposes the weight-one edge , which is selected next. Finally precedes among the weight-three choices. Every accepted edge crosses from the existing tree to a new vertex, as required by the minimum spanning tree cut property. A different starting vertex can produce a different accepted-edge order; the displayed answer fixes that unspecified choice. The algorithm is named for Robert C. Prim.

Articles by others on the same topic (0)

There are currently no matching articles.