Compute the most central nodes. It measure how important/central in the graph a node is.
We have three metrics for measuring centrality —
- Degree Centrality : The degree centrality for a node v is the fraction of nodes it is connected to.
- This is the default measure.
- Closeness Centrality : Closeness centrality of a node u is the reciprocal of the sum of the
- shortest path distances from u to all n−1 other nodes.
(http://en.wikipedia.org/wiki/Centrality#Closeness_centrality)
- Betweenness Centrality : Betweenness centrality of a node v is the sum of the fraction of all-pairs
- shortest paths that pass through v.
(http://en.wikipedia.org/wiki/Betweenness_centrality)
- Arguments:
- nNodes - number of most central nodes to be retrieved.
closeness : If True, the closeness centrality is evaluated.
betweenness : If True, the betweenness centrality is evaluated.
- Returns:
- A list of most central nodes.