NetworkX

Previous topic

networkx.eigenvector_centrality

Next topic

networkx.algorithms.centrality.load.load_centrality

networkx.eigenvector_centrality_numpy

eigenvector_centrality_numpy(G)

Compute the eigenvector centrality for the graph G.

Parameters:

G : graph

A networkx graph

Returns:

nodes : dictionary

Dictionary of nodes with eigenvector centrality as the value.

Notes

This algorithm uses the NumPy eigenvalue solver.

For directed graphs this is “right” eigevector centrality. For “left” eigenvector centrality, first reverse the graph with G.reverse().

Examples

>>> G=nx.path_graph(4)
>>> centrality=nx.eigenvector_centrality_numpy(G)
>>> print(['%s %0.2f'%(node,centrality[node]) for node in centrality])
['0 0.37', '1 0.60', '2 0.60', '3 0.37']