Computes eigenvector centrality of all nodes in Graph and stores it in NIdEigenH. Eigenvector Centrality of a node N is defined recursively as the average of centrality values of N’s neighbors in the network.
Parameters:
A Snap.py undirected graph
Hash table mapping node ids to their corresponding eigenvector centrality values.
Epsilon (stop when accumulated difference in eigenvector centrality value for all nodes in an interation is less than epsilon).
Maximum number of iterations (stop when exceeding this number of iterations).
Return value:
The following example shows how to calculate eigenvector centrality values for nodes in TUNGraph:
import snap
UGraph = snap.GenRndGnm(snap.PUNGraph, 100, 1000)
NIdEigenH = snap.TIntFltH()
snap.GetEigenVectorCentr(UGraph, NIdEigenH)
for item in NIdEigenH:
print "%node: d centrality: %f" % (item, NIdEigenH[item])