Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.centrality.voterank

voterank(G, number_of_nodes=None, max_iter=10000)[source]

Compute a list of seeds for the nodes in the graph using VoteRank [1].

VoteRank computes a ranking of the nodes in the graph G based on a voting scheme. With VoteRank, all nodes vote for each neighbours and the node with the highest score is elected iteratively. The voting ability of neighbors of elected nodes will be decreased in subsequent turn.

Parameters:
  • G (graph) – A NetworkX graph.
  • number_of_nodes (integer, optional) – Number of ranked nodes to extract (default all nodes).
  • max_iter (integer, optional) – Maximum number of iterations to rank nodes.
Returns:

voterank – Ordered list of computed seeds.

Return type:

list

Raises:

NetworkXNotImplemented: – If G is digraph.

References

[1]Zhang, J.-X. et al. (2016). Identifying a set of influential spreaders in complex networks. Sci. Rep. 6, 27823; doi: 10.1038/srep27823.