Does the Prim algorith always create the same tree despite the starting node?
PD: sorry for my english.
When the weights are all different, the minimum spanning tree is unique. So, in this case, yes. In the general case, it depends on how you break ties.
Try Prim's algorithm on the vertices and edges of a square to see what happens with ties.
Copyright © 2021 JogjaFile Inc.
When the weights are all different, the minimum spanning tree is unique. So, in this case, yes. In the general case, it depends on how you break ties.
Try Prim's algorithm on the vertices and edges of a square to see what happens with ties.