Learn R Programming

sna (version 0.41)

betweenness: Compute the Betweenness Centrality Scores of Network Positions

Description

betweenness takes a graph stack (dat) and returns the betweenness centralities of positions within one graph (indicated by nodes and g, respectively). Depending on the specified mode, betweenness on directed or undirected geodesics will be returned; this function is compatible with centralization, and will return the theoretical maximum absolute deviation (from maximum) conditional on size (which is used by centralization to normalize the observed centralization score).

Usage

betweenness(dat, g=1, nodes=c(1:dim(dat)[2]), gmode="digraph", 
    diag=FALSE, tmaxdev=FALSE, cmode="directed", 
    geodist.precomp=NULL, rescale=FALSE)

Arguments

dat
Data array to be analyzed. By assumption, the first dimension of the array indexes the graph, with the next two indexing the actors. Alternately, this can be an n x n matrix (if only one graph is involved).
g
Integer indicating the index of the graph for which centralities are to be calculated. By default, g=1.
nodes
List indicating which nodes are to be included in the calculation. By default, all nodes are included.
gmode
String indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. dmode is set to "digraph" by default.
diag
Boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag is FALSE by default.
tmaxdev
Boolean indicating whether or not the theoretical maximum absolute deviation from the maximum nodal centrality should be returned. By default, tmaxdev==FALSE.
cmode
String indicating the type of betweenness centrality being computed (directed or undirected geodesics).
geodist.precomp
A geodist object precomputed for the graph to be analyzed (optional)
rescale
If true, centrality scores are rescaled such that they sum to 1.

Value

  • A vector containing the betweenness scores.

Warning

Rescale may cause unexpected results if all actors have zero betweenness.

Details

The betweenness of a vertex, v, is given by

$$C_B(v) = \sum_{i,j : i \neq j, i \neq v, j \neq v} \frac{g_{ivj}}{g_{ij}}$$

where $g_{ijk}$ is the number of geodesics from i to k through j. Conceptually, high-betweenness vertices lie on a large number of non-redundant shortest paths between other vertices; they can thus be thought of as ``bridges'' or ``boundary spanners.''

References

Freeman, L.C. (1979). ``Centrality in Social Networks I: Conceptual Clarification.'' Social Networks, 1, 215-239.

See Also

centralization

Examples

Run this code
g<-rgraph(10)     #Draw a random graph with 10 members
betweenness(g)    #Compute betweenness scores

Run the code above in your browser using DataLab