Minimum Spanning Tree > Boruvka’s Algorithm
What is Boruvka’s Algorithm?
Boruvka’s Algorithm is a way to find a minimum spanning tree — a spanning tree where the sum of edge weights is minimized. It was the first algorithm developed (in 1926) to find MSTs; Otakar Boruvka used it to find the most efficient routing for an electrical grid.
There are many ways to find minimum spanning trees. Boruvka’s Algorithm is a greedy algorithm and is similar to Kruskal’s algorithm and Prim’s algorithm. It is basically a cross between the two algorithms. It is also known as Sollin’s algorithm, especially in computing.
Boruvka’s Algorithm Example
Find the minimum spanning tree for the following graph using Buruvka’s Algorithm.
Step 1: Write out a list of components. For this graph, we have: A,B,C,D,E,F,G,H,I,J,K,L. This step is optional but helps you to keep track.
Step 2: Highlight the cheapest outgoing edge for each node in your list. For example, node A has outgoing edges with weights 1 and 7, so we’ll highlight 1. Continue sequentially (for this list, go to B, then C…).
- At this stage, only highlight one cheapest edge for each node.
- For a tie (node E has two edges with a weight of 4), assign a lower weight to one of the edges. This is arbitrary, but must stay consistent throughout the process. For this example, I’ll make the edge to the left the lowest weight.
- Always highlight the cheapest edge, even if it has been highlighted before. Do not choose the edge with the next lowest weight! For practical purposes, this means you might not have to highlight anything for some nodes, if the cheapest weight has already been highlighted.
Step 3: Highlight the separate tree clusters. These are the sets of connected nodes, which we’ll call components.
Step 4: Repeat the algorithm for each component (each differently colored set). This time, for each node, choose the cheapest edge outside of the component. For example, ABCDHL is one component (blue nodes). For node A, the cheapest edge outside the component is node 7 (because node 1 is connected inside the component). I’m highlighting in blue for clarity: you can use whatever color you like.
- Make sure you are choosing the cheapest edge outside of the component. For this graph and this iteration, those edges are colored black.
- As in the first iteration, skip highlighting an edge if it’s already been highlighted this time around.
Need help with a homework or test question? With Chegg Study, you can get step-by-step solutions to your questions from an expert in the field. If you rather get 1:1 study help, Chegg Tutors offers 30 minutes of free tutoring to new users, so you can try them out before committing to a subscription.
If you prefer an online interactive environment to learn R and statistics, this free R Tutorial by Datacamp is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try this Statistics with R track.
Comments? Need to post a correction? Please post a comment on our Facebook page.