在示例問題中,給出加權圖G =(V,E)的MST T.問題是,如果一個新的頂點v及其所有邊被添加到圖中,什麼是o(| V | log | V |)算法來計算這個新的G *的新MST =(VU v, E *)。在給定舊MST和新頂點+邊緣的情況下查找最小生成樹
我唯一的想法到目前爲止是:
add min(out(v)) to T
for each edge e in out(v) do
let u be the other vertex of e
if there exists a lower weight path from v to u then
remove all edges in that path from T
add e to T
兩個問題:
- 什麼我可能已經得到了斷開
- 頂點做這絕對不是O(| V | log | V |)
我該怎麼做?
爲什麼要從一個循環的一條腿上移除所有邊緣?只刪除最大重量的一個邊緣。 – phs
提示:修改[Borůvka的算法](http://en.wikipedia.org/wiki/Boruvka%27s_algorithm)。 – Per