Reputation: 19
hi i am doing the following algorithm. here is the question's picture https://i.sstatic.net/qLyBC.png and my answer for the following question is I-f f-g f-g g-d d-a g-c a-h a-b is this path the right way for the minimum spanning tree? if not which other vt do i have to take?
Upvotes: 1
Views: 124
Reputation: 368
Your final answer seems to be correct. (Aside from that you wrote f-g twice instead of f-e, f-g).
You can verify that its a spanning tree by running some other algorithm to find a spanning tree (such as Kruscal's).
Note: any two spanning trees have the same weight, and in particular they shpuld have the same number of edges for each weight (allowing you to verify your solution by running another spanning tree algorithm you might be more familiar with, and checking if the weights are similar)
Upvotes: 1