influenceR (version 0.1.0)

betweenness: 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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab