![](https://sumantmath.wordpress.com/wp-content/uploads/2024/01/screenshot-from-2024-01-13-18-30-20.png?w=989)
Prim’s algorithm is based on the idea that once a particular vertex is selected the next edge of minimum weight must be connected to this vertex and as the number of selected vertices grow the edges of minimum weight can only come from these selected vertices only.