Adds Prim's minimum spanning tree algorithm