0

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?

Sagar S. De
  • 160
  • 7
  • All of the algorithms in graph_tool.centrality (e.g. pagerank, betweenness) compute centrality for each vertex. – vrume21 Sep 16 '17 at 19:58
  • I understand that. However, I am working on a project where I need to combine few vertices and need to compute centrality for the new vertex only. The process repeats many times. So computing for all unnecessary increases execution time. – Sagar S. De Sep 18 '17 at 05:19
  • It sounds like what you really are after is thus an update of the centrality values that have changed as a consequence of the new vertex being added (of course it is possible that all values change as a consequence of the new vertex being added so you really won't be saving any execution time). I don't know if that can be implemented cheaply but perhaps it is something worth raising as a feature request on the mailing list. – P-M May 11 '18 at 16:07

1 Answers1

2

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.

Peaceful
  • 4,920
  • 15
  • 54
  • 79