component.size.byvertex: Get Component Sizes, by Vertex
Description
This function computes the component structure of the input network, and returns a vector whose \(i\)th entry is the size of the component to which \(i\) belongs. This is useful e.g. for studies of diffusion or similar applications.
A vector of length equal to the number of vertices in dat, whose \(i\)th element is the number of vertices in the component to which the \(i\)th vertex belongs.
Arguments
dat
one or more input graphs (for best performance, sna edgelists or network objects are suggested).
connected
a string selecting the connectedness definition to use; by default, "strong" components are used.
Component sizes are here computed using component.dist; see this function for additional information.
In an undirected graph, the size of \(v\)'s component represents the maximum number of nodes that can be reached by a diffusion process along the edges of the graph originating with node \(v\); the expectation of component sizes by vertex (rather than the mean component size) is thus one measure of the maximum average diffusion potential of a graph. Because this quantity is monotone with respect to edge addition, it can be bounded using Bernoulli graphs (see Butts (2011)). In the directed case, multiple types of components are possible; see component.dist for details.
References
West, D.B. (1996). Introduction to Graph Theory. Upper Saddle River, N.J.: Prentice Hall.
Butts, C.T. (2011). “Bernoulli Bounds for General Random Graphs.” Sociological Methodology, 41, 299-345.
#Generate a random undirected graphg<-rgraph(100,tprob=1.5/99,mode="graph",return.as.edgelist=TRUE)
#Get the component sizes for each vertexcs<-component.size.byvertex(g)
cs