I intuitively feel that if one is using Prim's algorithm to find a graph's minimum spanning tree, it doesn't matter which root node is picked - the resultant MST will have the same weight regardless. Is this correct?
A:
That is correct. Choosing a different starting node could give you a different spanning tree, but it will always have the same weight: the minimal possible.
Mark Byers
2009-11-24 01:04:55
A:
This is because of uniqueness of minima.
Proof:
Suppose there are 2 "different" minimum weights W1 and W2
W1 is minimum
W2 is minimum
W1 != W2
This leads to contradiction because
if W1 != W2 then
W1 < W2 -> W1 is minima
or
W1 > W2 -> W2 is minima
Hence if W1 must equal W2.
TheMachineCharmer
2010-08-06 06:12:16