Avoid doing the distinct after connected components are run.