LOGBOOK

HELP

Quiz Entry - updated: 2026.11.27

When is a graph connected, and what exactly is a connected component?

A graph is connected if there is a path between every pair of its vertices. A connected component is a maximal connected subgraph: it is connected, and no further vertex of the graph can be added to it without losing that. A graph that is not connected falls apart into two or more components.

A connected graph on the left; on the right a graph with two components, a triangle and a single edge, each framed

* No path leads from the triangle F, G, H to the edge I, J: two components. *

"Maximal" is the important word. In the right-hand graph the single edge F–G is a connected subgraph, but it is not a component, because H can still be added; the component is the whole triangle F, G, H. So the components are the largest connected pieces, and every vertex belongs to exactly one of them.

Questions about components come up everywhere: is every computer still reachable after a cable fails, does a road network fall into separate parts after a closure. A traversal such as depth-first search finds all components of a graph in $O(n + m)$ time.

Go deeper:

From Quiz: ADS / Graphs: Basics, Representations and Spanning Trees | Updated: Nov 27, 2026