Store connected components for edges