How to calculate centrality for a particular vertex in graph-tool?

538 Views Asked by At

According to graph-tool documentation (https://graph-tool.skewed.de/static/doc/centrality.html), the graph_tool.centrality module computes centrality for all vertices. However, I need to calculate the centrality score for a particular vertex. Is there any way to process for that vertex only?

1

There are 1 best solutions below

0
On

NO!

Centrality of a vertex depends on the overall connectivity of the graph and is a relative measure of an importance of the vertex. Thus, the idea of calculating centrality of only a single vertex does not have any meaning. For example, think about calculating the eigenvector centrality of the vertices in a graph. In this case, you must keep updating the centrality scores of all the vertices using the scores of their neighbors. Thus, you can either calculate centrality of all the vertices in a graph or of none. There is nothing in between.