randomized amount of edges required by prim and kruskal question