adding Prim's MST with no heap optimization