Computational Complexity of finding out split graphs

51 Views Asked by At

If you take an undirected graph of nodes and vertices, what is the computational complexity O(n) of testing that all nodes of the graph are linked at least indirectly, meaning the graph is not split into two not linked sub-graphs?

Left graph consisting of two not interlinked subgraphs, whereas right graph is fully interlinked

1

There are 1 best solutions below

0
On

The usual way of determining if a graph is connected is to use depth-first search, which has complexity $O(|V|+|E|)$