View source: R/graph_metrics.R
betweenness | R Documentation |
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.
betweenness(g, snap = T)
g |
The igraph object to analyze |
snap |
True to use the SNAP betweenness code, False to use igraph::betweenness |
A numeric vector with the betweenness centrality score for each vertex
https://snap-graph.sourceforge.net/
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.