1 Begin with a connected graph G containing edges of distinct weights, and an empty set of edges T
2 While the vertices of G connected by T are disjoint:
3 Begin with an empty set of edges E
4 For
我已經呈現在大學以下問題最小生成樹: 讓G =(V,E)是(無向)圖與成本Ç e> = 0在邊緣e ∈ E。假定給你一個最低成本的生成樹T in G。現在假設一個新的邊緣被添加到ģ,連接兩個節點v,噸 v ∈ V成本Ç。 給出一個有效的算法來測試是否Ť保持最小成本生成樹與新的邊緣添加到ģ(但不與樹Ť)。讓你的算法在O(| E |)的時候運行。你能在O(| V |)時間做到嗎?請注意您對於什麼數據結
考慮A *算法。 在谷歌有可能找到一個很好的僞代碼: function A*(start,goal)
closedset := the empty set // The set of nodes already evaluated.
openset := set containing the initial node // The set of tentative n