| igraph Reference Manual |
|---|
int igraph_betweenness(const igraph_t *graph, igraph_vector_t *res, const igraph_vs_t vids, igraph_bool_t directed);
The betweenness centrality of a vertex is the number of geodesics going through it. If there are more than one geodesic between two vertices, the value of these geodesics are weighted by one over the number of geodesics.
Arguments:
|
The graph object. |
|
The result of the computation, a vector containing the betweenness scores for the specified vertices. |
|
The vertices of which the betweenness centrality scores will be calculated. |
|
Logical, if true directed paths will be considered for directed graphs. It is ignored for undirected graphs. |
Returns:
Error code:
|
Time complexity: O(|V||E|), |V| and |E| are the number of vertices and edges in the graph. Note that the time complexity is independent of the number of vertices for which the score is calculated.
See also:
Other centrality types: |
<< 5.1. igraph_closeness — Closeness centrality calculations for some vertices. |
5.3. igraph_edge_betweenness — Betweenness centrality of the edges. >> |