Data For Science

Data For Science

Graphs

Prim's Minimum Spanning Tree Algorithm

Finding the shortest path to every node

Bruno Gonçalves's avatar
Bruno Gonçalves
Aug 16, 2022
∙ Paid

In this post we introduce Prim’s algorithm to identify the Minimum Spanning Tree of a graph. The MST is a tree made up by the subset of edges from a weighted graph that connect every node while having the smallest total weight possible.

MSTs have a wide range of practical applications, specially in distribution networks where we must reach every node in…

Keep reading with a 7-day free trial

Subscribe to Data For Science to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Data For Science, Inc · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture