Prim's Algorithm is a greedy algorithm used to find the Minimum Spanning Tree (MST) of a connected, undirected graph. It starts with an arbitrary node and grows the MST one edge at a time by adding the smallest edge that connects a vertex in the MST to a vertex outside the MST. This visualization demonstrates the step-by-step growth of the MST.
A priority queue is used to efficiently find the smallest edge connecting the MST to the rest of the graph.
Note: I would prefer Kruskal's because the implementation is simpler and it naturally handles disconnected graphs.