Prim’s Algorithm

Prim algorithm

Prim’s algorithm is a greedy algorithm used to find the minimum spanning tree (MST) for a weighted, undirected graph. It starts with an arbitrary vertex and iteratively adds the shortest edge connecting the current MST to a vertex outside of it until all vertices are included. The result is a subgraph that connects all vertices with the minimum possible total edge weight.

Tags

10 connections Built by Tim Jones