betweenness: Vertex Betweenness centrality measure.

View source: R/graph_metrics.R

betweennessR Documentation

Vertex Betweenness centrality measure.

Description

The Betweenness centrality score of a node u is the sum over all pairs s,t of the proportion of shortest paths between s and t that pass through u. This function allows the use of either the SNAP betweenness implementation (default), or the igraph betweenness function. The SNAP version makes use of OpenMP for parallelization, and may be faster in some circumstances.

Usage

betweenness(g, snap = T)

Arguments

g

The igraph object to analyze

snap

True to use the SNAP betweenness code, False to use igraph::betweenness

Value

A numeric vector with the betweenness centrality score for each vertex

References

http://snap-graph.sourceforge.net/

Examples

ig.ex <- igraph::erdos.renyi.game(100, p.or.m=0.3) # generate an undirected 'igraph' object
betweenness(ig.ex) # betweenness scores for each node in the graph

rcc-uchicago/influenceR documentation built on May 24, 2023, 7:40 p.m.