Solution (source code)

= Solution

It is a <greedy algorithm> because it commits at every step to the cheapest remaining edge that can be added without creating a <graph cycle>, without revising earlier choices. The <minimum spanning tree cut property> explains why these locally cheapest admissible choices can be extended to an optimal spanning tree.