Reputation: 51
We know the original graph and the original MST. Now we change an edge's weight in the graph. Beside the Prim and the Kruskal, is there any way we can generate the new MST from the old one?
Upvotes: 4
Views: 6481
Reputation: 3314
You can change the problem a little while the result is same.
Upvotes: 2
Reputation: 24647
Besides linear-time algorithm, proposed by j_random_hacker, you can find a sub-linear algorithm in this book: "Handbook of Data Structures and Applications" (Chapter 36) or in these papers: Dynamic graphs, Maintaining Minimum Spanning Trees in Dynamic Graphs.
Upvotes: 2
Reputation: 51226
Here's how I would do it:
Upvotes: 2