language agnostic - How is it possible for Boruvka's algorithm's complexity to be O(E*logV)? -


  1 An associated graph begins with G in which there are different weight edges, and one of the edges is empty Set T2 is different from the corner of the G while connected by T: Start with an empty set of 3 edges. E for each component: start with an empty set of 5 edges: for each head in 6 components : 7 Add the best edge from the top to the component S8 in a separate component in the second Add the top edge from S to the fastest edge in E9, set the edges to 10 by E. As a result of the edges, set T is the least spaced tree.  

From Wikipedia, I think the external loop is logavi because you are joining the set. But then the inner loop comes.

If you use affinity relationships to keep track of sets, this means that you are only getting the elements representing the set, so you can not set the edge to the smallest The weight between the two sets because you do not have all the elements. If you modify the structure to keep the references of children, then you should still get all the children in each group Has. It means, change scenario, for each set, O (V / 2) = O (V).

After that, you still have to find the smallest edge by connecting two edges, which means that going to all the edges while adding two components. Then you have to walk on each node again and it needs to be seen whether its edges attach to one element in the other component, and if this happens then if you are currently smaller than the minimum edge.

Meaning, an internal loop - O (V E) to repeat on the external loop nodes and to run the edges of that node again. Since it is inside the O (logavi) loop, you get O (Logavi V * E). Now, it seems that you have to walk again through all the edges, but how will you choose the minimum edge between the two components? I can tell if a fixed edge adds nodes to different components, but I can not tell what is the minimum weight to connect to them. And if I get one with the minimum weight, then it can not connect with them. If the hash tables are allowed, then I see that it is an O (elog n).

= N -1, so we have the total cost of O (e) for repetition.

- Edit -

After the comment of Throwawayacct, there is no need for hash structure at all. On each repetition we have a forest graph as a result of the previous recurrence, so we can re-calculate its connected components in the time of O (e) time. This can be done by simple DFS tracerl for all nodes, for example, which sets a unique "color" for each component. Then, while scanning the edges to find the bridge, we only consider the edges that connect different nodes of different colors.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -