directed=False to ensure the connected components are accurate