Thanks for explanation,
If you just want to know the number of connected components define
your own predecessor_map for kruskal_minimum_spanning_tree. Then you
can count the vertices with themselves as predecessor. These vertices
are the roots of the spearate trees: