Prim's MST O(n*m) alg running perfectly for big n