CS Wiki | Cedric Schwyter

Minimum Spanning Trees (MSTs)

Minimum Spanning Trees (MSTs)

General

A minimum spanning tree for a graph has the following defining properties:

  • it contains all
  • it does not contain any cycles

📖 Let be a weighted graph with nonnegative weights () such that all edge weights are different ( in , ). Then the minimum spanning tree of is unique.

Boruvka’s Algorithm

Runtime

Pseudocode

Python/minimum_spanning_tree_boruvka.py at master · TheAlgorithms/Python

Further Resources

Borůvka’s algorithm - Wikipedia

Kruskal’s Algorithm

Runtime

Pseudocode

Python/minimum_spanning_tree_kruskal.py at master · TheAlgorithms/Python

Further Resources

Kruskal’s algorithm - Wikipedia

Prim’s Algorithm

Runtime

Pseudocode

Python/minimum_spanning_tree_prims.py at master · TheAlgorithms/Python

Further Resources

Prim’s algorithm - Wikipedia

This project is maintained by D3PSI