In: Computer Science
Give pseudocode to implement a phase of Boruvka’s algorithm. Argue that ˙ the running time of your implementation is O(m)
Boruvka's Algorithm:
vertices as
individual blue
treeThe second step of the algorithm is Boruvka's phase.
Pseudocode to implement a Boruvka's phase:
Assume the graph
is given as adjacency
list.
, run through the list
of edges incident to each vertex, to find the cheapest one.Time complexity of Boruvka's phase:
For each vertex
we spend
time to search the cheapest edge incident on it.
Therefore, total time taken by one phase of Boruvka's algorithm is the sum of degrees of the vertices, i.e.
.