Last active
August 29, 2015 14:04
-
-
Save kartikkukreja/9f4a476c7b5894fb08e2 to your computer and use it in GitHub Desktop.
Prim's MST Algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let the MST contain a single vertex v, where v is any arbitrary vertex of the graph | |
while it is possible to add an edge (u, v) to the MST such that u ∈ MST and v ∉ MST | |
add v and the least-cost edge (u, v) to the MST such that u ∈ MST and v ∉ MST | |
return MST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment