add interface for the number of edges of connected components