Determine if a given weighted graph has unique MST

前端 未结 1 1277
青春惊慌失措
青春惊慌失措 2021-02-08 23:40

I\'m looking for an algorithm (or any other way) to determine if a given weighted graph has unique MST (Minimum spanning tree) in O(ElogV)?

I don\'t know anything about

1条回答
  •  花落未央
    2021-02-08 23:50

    You can prove whether it has a unique MST in O(E log(V)).

    First find a minimum spanning tree with standard techniques.

    Go back to your original tree, and replace all weights with pairs of numbers, the original weight, and then 0 or 1 based on whether or not it is in the MST you found. These pairs of numbers can be added together pairwise, and compared pairwise as well - just like normal numbers.

    Now use the standard techniques to find a minimum spanning tree with these funny weights. The MST that you find will be the MST which shares the least edges with your original tree. Thus if there are multiple MSTs, you are guaranteed to find a different one.

    0 讨论(0)
提交回复
热议问题