Implementation of valued edges for undirected graph as well as Prim's algorithm for minimum spanning tree discovery