Compute the eigenvector centrality for the graph G.
Uses the power method to find the eigenvector for the largest eigenvalue of the adjacency matrix of G.
Parameters: | G : graph
max_iter : interger, optional
tol : float, optional
nstart : dictionary, optional
weight : None or string, optional
|
---|---|
Returns: | nodes : dictionary
|
See also
eigenvector_centrality_numpy, pagerank, hits
Notes
The eigenvector calculation is done by the power iteration method and has no guarantee of convergence. The iteration will stop after max_iter iterations or an error tolerance of number_of_nodes(G)*tol has been reached.
For directed graphs this is “left” eigevector centrality which corresponds to the in-edges in the graph. For out-edges eigenvector centrality first reverse the graph with G.reverse().
Examples
>>> G = nx.path_graph(4)
>>> centrality = nx.eigenvector_centrality(G)
>>> print(['%s %0.2f'%(node,centrality[node]) for node in centrality])
['0 0.37', '1 0.60', '2 0.60', '3 0.37']