Implementation of Prim's Algorithm on an undirected graph using