Finding connected components.