January 02, 2023 |6.8K Views

    Python program to count number of connected components in an undirected graph

      Share  7 Likes
    Description
    Discussion

    In this video, we will write a python program to count number of connected components in an undirected graph

    Here, we will see the algorithm to count the number of connected components in an undirected graph using depth-first-search. It visits all vertices of a connected component when it is called on a vertex of that connected component.