What is Prim's Algorithm?

What is Prim's Algorithm?

Approach: Describe a greedy algorithm that grows an MST from a starting node.

An algorithm that finds a Minimum Spanning Tree for a weighted undirected graph. It starts from a single vertex and repeatedly adds the cheapest edge that connects a vertex in the tree to a vertex outside the tree.

Follow-up: How does it compare to Dijkstra's algorithm?

Key concepts: greedy, priority queue, connectivity.