Last chance! 50% off unlimited learning
Sale ends in
Returns the number of components within dat
, using the connectedness rule given in connected
.
components(dat, connected="strong", comp.dist.precomp=NULL)
A vector containing the number of components for each graph in dat
one or more input graphs.
the the component definition to be used by component.dist
during component extraction.
a component size distribution object from component.dist
(optional).
Carter T. Butts buttsc@uci.edu
The connected
parameter corresponds to the rule
parameter of component.dist
. By default, components
returns the number of strong components, but other component types can be returned if so desired. (See component.dist
for details.) For symmetric matrices, this is obviously a moot point.
West, D.B. (1996). Introduction to Graph Theory. Upper Saddle River, NJ: Prentice Hall.
component.dist
, symmetrize
g<-rgraph(20,tprob=0.05) #Generate a sparse random graph
#Find weak components
components(g,connected="weak")
#Find strong components
components(g,connected="strong")
Run the code above in your browser using DataLab