Added Prims MST algorithm for graphs.