class 4 of ML and kruskal algo
detect no spanning trees