Store connected components for nodes