NetworkX

Previous topic

networkx.closeness_centrality

Next topic

Clique

networkx.eigenvector_centrality

eigenvector_centrality(G, max_iter=100, tol=9.9999999999999995e-07, nstart=None)

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

A networkx graph

max_iter : interger, optional

Maximum number of iterations in power method.

tol : float, optional

Error tolerance used to check convergence in power method iteration.

nstart : dictionary, optional

Starting value of PageRank iteration for each node.

Returns:

nodes : dictionary

Dictionary of nodes with eigenvector centrality as the value.

See also

pagerank

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 “right” eigevector centrality. For “left” eigenvector centrality, first reverse the graph with G.reverse().