Fast computation of the connected components of an undirected
graph.
Usage
concom(edges)
Arguments
edges
a matrix with two columns, whose rows represent the edges of
the graph; each edge is given by two vertex indices, and it is assumed
that the vertex indices are 1, 2, 3, ...
Value
A list with four elements: indices, an integer vector
whose i-th element gives the label of the connected component of
vertex i; sizes, an integer vector giving the number of
elements of each connected component; ncomponents, the number
of connected components; components, a list of length
ncomponents, whose j-th element is the integer vector made
of the labels of the j-th connected component.