Definition (Prim’s Algorithm)

This algorithm generates the MST for any Graph .

Pick some vertex . Let be our MST. While does not connect, in Graph , find the lightest edge that connects to the new vertex and add it to .