Traces connected components, labels them.