Content deleted Content added
m Reverted edits by 128.2.247.72 (talk) to last version by Toncek |
Clarifying pseudocode and when algorithm can be used |
||
Line 1:
'''Borůvka's algorithm''' is an [[algorithm]] for finding a [[minimum spanning tree]]
It was first published in [[1926]] by [[Otakar Borůvka]] as a method of constructing an efficient electricity network for [[Bohemia]]. The algorithm was rediscovered by [[Choquet]] in 1938; again by [[Florek]], [[Jan Łukasiewicz|Lukasiewicz]], [[Perkal]], [[Stienhaus]], and [[Zubrzycki]] in 1951; and again by [[Sollin]] some time in the early 1960s. Because [[Sollin]] was the only Western computer scientist in this list—[[Choquet]] was a civil engineer; [[Florek]] and his co-authors were anthropologists—this algorithm is frequently but incorrectly called ‘[[Sollin]]’s algorithm’, especially in the parallel computing literature.
The algorithm begins by examining each vertex and adding the cheapest edge from that vertex to another in the graph, without regard to already added edges, and contines joining these grouping in a like manner until a tree spanning all vertices is completed. Designating each vertex or set of connected vertices a "component", pseudocode for Borůvka's algorithm is:
*Begin with a connected graph ''G'' containing edges of distinct weights, and an empty set of edges ''T''
**Begin with an empty set of edges ''E''
**For each component:
***Begin with an empty set of edges ''S''
***For each vertex in the component:
****Add the cheapest edge from the vertex in the component to another vertex in a disjoint component to ''S''
***Add the cheapest edge in ''S'' to ''E''
*The resulting set of edges ''T'' is minimum spanning tree of ''G''
▲*Copy the vertices of ''G'' into a new graph, ''L'', with no edges.
▲**Add all of these edges to ''L''.
Borůvka's algorithm can be shown to run in time [[Big O notation|O]](''E''log ''V''), where ''E'' is the number of edges, and ''V'' is the number of vertices in ''G''.
Line 17 ⟶ 24:
[[Category:Graph algorithms]]
[[Category:Polynomial-time problems]]
|