ntbtw
Betweenness of each node
ntbtw(from, to, nodes = NULL, dir = FALSE, norm = FALSE)The sum, over pairs of other nodes, of the share of their shortest paths
that pass through the node (Freeman 1977), by Brandes’ algorithm in
O(nodes x edges) time. Paths are counted in steps: weights are tie
strengths, not lengths, and are not taken. An undirected pair is counted
once. Graph rules as in ntdeg().
Parameters
Section titled “Parameters”from, toLabels of the two ends of each edge: vectors of the same length (zero when
nodesgives every node) with no missing values.nodesNULL, or every node’s label once: the node order of the results and the way to include isolated nodes.dirTRUEfor a directed graph (fromsends a tie toto).normTRUEto divide by the number of pairs of other nodes,(n - 1)(n - 2)directed or(n - 1)(n - 2) / 2undirected, asigraph::betweenness(normalized = TRUE)does;NaNfor fewer than 3 nodes.
Returns
Section titled “Returns”A data frame: node, btw.
References
Section titled “References”Brandes, U. (2001). A faster algorithm for betweenness centrality. Journal of Mathematical Sociology, 25(2), 163-177. doi:10.1080/0022250X.2001.9990249
Freeman, L. C. (1977). A set of measures of centrality based on betweenness. Sociometry, 40(1), 35-41. doi:10.2307/3033543
Examples
Section titled “Examples”ntbtw(c(1, 2, 3), c(2, 3, 4))Generated from the R help page: ntbtw in the R reference.