connected components
[nc,ncomp] = connex(g)
integer, number of connected components
row vector of connected components
connex
returns the number nc
of connected components of
graph g
and a row vector ncomp
giving the number of the connected
component for each node. For instance, if i
is a node number,
ncomp(i)
is the number of the connected component to
which node number i
belongs.
Chartrand, G. "Cut-Vertices and Bridges." ยง2.4 in Introductory Graph Theory. New York: Dover, pp. 45-49, 1985.
Harary, F. Graph Theory. Reading, MA: Addison-Wesley, 1994.