A connected component of a topological space is a maximal connected set. Every topological
space decomposes into its connected components. Two points and
are in the same connected component if some connected
set contains both. This is an equivalence
relation, and its equivalence classes are
the connected components.
Using pathwise-connectedness, the pathwise-connected component containing is the set of all
pathwise-connected
to
.
That is, it is the set of
such that there is a continuous path from
to
.
In some topological spaces, pathwise-connectedness differs from connectedness. A subset of
is connected if there is
no way to write
with
and
nonempty disjoint sets
that are open in the relative
topology on
.
Every topological space decomposes into a disjoint union
of maximal connected
subsets. These
are the connected components of
.
The connected components of a graph are the maximal connected subgraphs of
. Connected components of a graph
may be computed in the Wolfram Language
as ConnectedComponents[g]
(returned as lists of vertex
labels) or ConnectedGraphComponents[g]
(returned as a list of graphs).
Precomputed values for a number of graphs are available
as GraphData[g,
"ConnectedComponents"].