[New] Added prim's algorithm