- 818 –¼‘OF‚Ñ‚¬‚È‚Ÿ mailto:sage [2008/11/19(…) 16:22:32 ]
- >>817
ƒCƒ“ƒgƒƒ_ƒNƒVƒ‡ƒ“ƒgƒDƒAƒ‹ƒSƒŠƒYƒ€“ñ”Å‚©‚甲ˆ‚Å‚· --------------------------------------- MST-ƒNƒ‰ƒXƒJƒ‹iG, wj A©0 for each vertex v¸ V[G] do MAKE-SET(v) sort the edges of E into nondecreasing order by weight w for each edge (u, v) ¸ E, taken in nondecreasing order by weight do if FIND-SET(u)‚FIND-SET(v) then A©A¾{(u, v)} UNION(u, v) return A --------------------------------------- MST-ƒvƒŠƒ€(G, w, r) for each u¸V[G] do key[u]©‡ ƒÎ[u]©NIL key[r]©0 Q©V[G] while Q‚0 do u © EXTRACT-MIN(Q) for each v¸Adj[u] do if v¸Q and w(u, v) < key[v] then ƒÎ[v]©u key[v]©w(u, v) ---------------------------------------
|

|