プリム法
時間計算量: ループについては V、remove 関数については log(V) while latest_addition = remove minimum in Q set is_in_Q of latest_addition to false add latest_addition to (minimum_adjacency_list of (parent of latest_addition)) add (parent of latest_addition) to (minimum_adjacency_list of latest_addition) 時間計算量: E/V、平均頂点数 for each adjacent of latest_addition if (is_in_Q of adjacent) and (weight-function(latest_addition, adjacent) < min_distance of adjacent) set parent of adjacent to latest_addition set min_distance of adjacent to weight-function(latest_addition, adjacent) 時間計算量: log(V)、ヒープの深さ update adjacent in Q, order by min_distance