to find disconnected graphs

343 Views Asked by At

We know that if in a graph $G$, $e$ < $(n -1)$, then the graph is disconnected, where $e$ and $n$ are number of edges and number of vertices resp. Is there any other criteria to find out the disconnected graphs. Thanks for your help.

1

There are 1 best solutions below

0
On

You can do BFS or DFS search on the given graph, say G. If the output is a tree with less than n vertices, then G is not connected. Actually, G is connected if and only if the output tree has n vertices.