midGraph Theory
Prim's Algorithm for MST
Updated Apr 28, 2026
Short answer
A greedy algorithm that builds a Minimum Spanning Tree by adding the cheapest edge from the tree to a new vertex.
Deep explanation
Mid-level Graph theory focuses on classic pathfinding and optimization algorithms. A greedy algorithm that builds a Minimum Spanning Tree by adding the cheapest edge from the tree to a new vertex.
Real-world example
Google Maps finding the fastest route to a destination.
Common mistakes
- Using Dijkstra on a graph with negative edge weights.
Follow-up questions
- Time complexity of Dijkstra?