`betweenness`

takes one or more graphs (`dat`

) and returns the betweenness centralities of positions (selected by `nodes`

) within the graphs indicated by `g`

. 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).

```
betweenness(dat, g=1, nodes=NULL, gmode="digraph", diag=FALSE,
tmaxdev=FALSE, cmode="directed", geodist.precomp=NULL,
rescale=FALSE, ignore.eval=TRUE)
```

dat

one or more input graphs.

g

integer indicating the index of the graph for which centralities are to be calculated (or a vector thereof). By default, `g`

=1.

nodes

vector 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. `gmode`

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, or a variant form -- see below).

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.

ignore.eval

logical; ignore edge values when computing shortest paths?

A vector, matrix, or list containing the betweenness scores (depending on the number and size of the input graphs).

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

The shortest-path 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.''

Several variant forms of shortest-path betweenness exist, and can be selected using the `cmode`

argument. Supported options are as follows:

`directed`

Standard betweenness (see above), calculated on directed pairs. (This is the default option.)

`undirected`

Standard betweenness (as above), calculated on undirected pairs (undirected graphs only).

`endpoints`

Standard betweenness, with direct connections counted towards ego's score. This expresses the intuition that individuals' control over their own direct contacts should be considered in their total score (e.g., when betweenness is interpreted as a measure of information control).

`proximalsrc`

Borgatti's

*proximal source betweenness,*given by $$ C_B(v) = \sum_{i,j : i \neq v, i\neq j, j \to v} \frac{g_{ivj}}{g_{ij}}.$$ This variant allows betweenness to accumulate only for the last intermediating vertex in each incoming geodesic; this expresses the notion that, by serving as the “proximal source” for the target, this particular intermediary will in some settings have greater influence or control than other intervening parties.`proximaltar`

Borgatti's

*proximal target betweenness,*given by $$ C_B(v) = \sum_{i,j : i \neq v, i\to v, i\neq j} \frac{g_{ivj}}{g_{ij}}.$$ This counterpart to proximal source betweenness (above) allows betweenness to accumulate only for the first intermediating vertex in each outgoing geodesic; this expresses the notion that, by serving as the “proximal target” for the source, this particular intermediary will in some settings have greater influence or control than other intervening parties.`proximalsum`

The sum of Borgatti's proximal source and proximal target betweenness scores (above); this may be used when either role is regarded as relevant to the betweenness calculation.

`lengthscaled`

Borgetti and Everett's

*length-scaled betweenness*, given by $$ C_B(v) = \sum_{i,j : i \neq j, i \neq v, j \neq v} \frac{1}{d_{ij}}\frac{g_{ivj}}{g_{ij}},$$ where \(d_{ij}\) is the geodesic distance from \(i\) to \(j\). This measure adjusts the standard betweenness score by downweighting long paths (e.g., as appropriate in circumstances for which such paths are less-often used).`linearscaled`

Geisberger et al.'s

*linearly-scaled betweenness*: $$ C_B(v) = \sum_{i,j : i \neq j, i \neq v, j \neq v} \frac{1}{d_{ij}}\frac{g_{ivj}}{g_{ij}}.$$ This variant modifies the standard betweenness score by giving more weight to intermediaries which are closer to their targets (much like proximal source betweenness, above). This may be of use when those near the end of a path have greater direct control over the flow of influence or resources than those near its source.

See Brandes (2008) for details and additional references. Geodesics for all of the above can be calculated using valued edges by setting `ignore.eval=TRUE`

. Edge values are interpreted as distances for this purpose; proximity data should be transformed accordingly before invoking this routine.

Borgatti, S.P. and Everett, M.G. (2006). “A Graph-Theoretic Perspective on Centrality.” *Social Networks*, 28, 466-484.

Brandes, U. (2008). “On Variants of Shortest-Path Betweenness Centrality and their Generic Computation.” *Social Networks*, 30, 136--145.

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

Geisberger, R., Sanders, P., and Schultes, D. (2008). “Better Approximation of Betweenness Centrality.” In *Proceedings of the 10th Workshop on Algorithm Engineering and Experimentation (ALENEX'08)*, 90-100. SIAM.

```
# NOT RUN {
g<-rgraph(10) #Draw a random graph with 10 members
betweenness(g) #Compute betweenness scores
# }
```

Run the code above in your browser using DataLab