How is it possible for the complexity of the Boruvka algorithm to be O (E * logV)?

 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 each component:
 5     Begin with an empty set of edges S
 6     For each vertex in the component:
 7       Add the cheapest edge from the vertex in the component to another vertex in a disjoint component to S
 8     Add the cheapest edge in S to E
 9   Add the resulting set of edges E to T.
10 The resulting set of edges T is the minimum spanning tree of G.

From Wikipedia. I understand that the outer loop is logV, since you are joining sets. But then comes the inner cycle.

If you use equivalence relationships to track sets, it means that you only get the element representing the set, so you cannot define the edge with the smallest weight between the two sets, because you do not have all the elements. If you modify the structure for storing references to children, you still need to get all the children of each set. This means that in the worst case, O (V / 2) = O (V) for each set.

, , , . , node , , , , .

, - O (VE). O (logV), O (logVV * E).

, , ? , , , . , , .

+3
1

- , , O (Elog N). -. node. "" O (E), , . , O (N) . , E >= N-1, O (E) .

- EDIT -

throwawayacct, . , , O (E). , , DFS , "" . , , , , .

+2

Source: https://habr.com/ru/post/1756868/


All Articles