Lably
Skip to content

Component (graph theory)

Maximal subgraph whose vertices can reach each other

  • 9 min read
  • 4 chapters

Related on Lably

Through Graph (discrete mathematics), Matrix (mathematics) and Equivalence relation

The number of components in a given graph is an important graph invariant, and is closely related to invariants of matroids, topological spaces, and matrices. In random graphs, a frequently occurring phenomenon is the incidence of a giant component, one component that is significantly larger than the others; and of a percolation threshold, an edge probability above which a giant component exists and below which it does not.

The components of a graph can be constructed in linear time, and a special case of the problem, connected-component labeling, is a basic technique in image analysis. Dynamic connectivity algorithms maintain components as edges are inserted or deleted in a graph, in low time per change. In computational complexity theory, connected components have been used to study algorithms with limited space complexity, and sublinear time algorithms can accurately estimate the number of components.

Definitions and examples

A component of a given undirected graph may be defined as a connected subgraph that is not part of any larger connected subgraph. For instance, the graph shown in the first illustration has three components. Every vertex v of a graph belongs to one of the graph's components, which may be found as the induced subgraph of the set of vertices reachable from v. Every graph is the disjoint union of its components. Additional examples include the following special cases:

  • In an empty graph, each vertex forms a component with one vertex and zero edges. More generally, a component of this type is formed for every isolated vertex in any graph.
  • In a connected graph, there is exactly one component: the whole graph.
  • In a forest, every component is a tree.
  • In a cluster graph, every component is a maximal clique. These graphs may be produced as the transitive closures of arbitrary undirected graphs, for which finding the transitive closure is an equivalent formulation of identifying the connected components.

Another definition of components involves the equivalence classes of an equivalence relation defined on the graph's vertices. In an undirected graph, a vertex v is reachable from a vertex u if there is a path from u to v, or equivalently a walk (a path allowing repeated vertices and edges). Reachability is an equivalence relation, since:

  • It is reflexive: There is a trivial path of length zero from any vertex to itself.
  • It is symmetric: If there is a path from u to v, the same edges in the reverse order form a path from v to u.
  • It is transitive: If there is a path from u to v and a path from v to w, the two paths may be concatenated together to form a walk from u to w.

The equivalence classes of this relation partition the vertices of the graph into disjoint sets, subsets of vertices that are all reachable from each other, with no additional reachable pairs outside of any of these subsets. Each vertex belongs to exactly one equivalence class. The components are then the induced subgraphs formed by each of these equivalence classes. Alternatively, some sources define components as the sets of vertices rather than as the subgraphs they induce.

Similar definitions involving equivalence classes have been used to defined components for other forms of graph connectivity, including the weak components and strongly connected components of directed graphs and the biconnected components of undirected graphs.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Discrete mathematics