Warning

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

eigenvector_centrality_numpy¶

eigenvector_centrality_numpy(G, weight='weight')[source]

Compute the eigenvector centrality for the graph G.

Eigenvector centrality computes the centrality for a node based on the centrality of its neighbors. The eigenvector centrality for node is

where is the adjacency matrix of the graph G with eigenvalue . By virtue of the Perron–Frobenius theorem, there is a unique and positive solution if is the largest eigenvalue associated with the eigenvector of the adjacency matrix ([2]).

Parameters: G (graph) – A networkx graph weight (None or string, optional) – The name of the edge attribute used as weight. If None, all edge weights are considered equal. nodes – Dictionary of nodes with eigenvector centrality as the value. dictionary

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']


eigenvector_centrality(), pagerank(), hits(), Notes(), ------(), The(), This(), find(), For(), to(), first()