Skip to content Skip to sidebar Skip to footer

Different Results In Eigenvector Centrality Numpy

The following example gives different results obtained with eigenvector_centrality and eigenvector_centrality_numpy. Is there a way to make such calculation more robust? I'm using

Solution 1:

edit - see the response by dshult. He's one of the main people who maintains/updates networkx.


I think this may be a bug, but not the way you think. This graph is directed and acyclic. So for this graph, I don't think there is a nonzero eigenvalue.

It looks like the algorithm seems to implicitly assume an undirected graph, or at least that if it's directed it has cycles. And I would expect the algorithm to break if there's no cycle.

I'm going to encourage the networkx people to look at this in more detail.

I'm actually surprised that it converges for the non-numpy version.

Solution 2:

Joel is right to say that eigenvector_centrality isn't a useful measure for directed acyclic graphs. See this nice description of centrality. This should be useless for both the numpy and non-numpy versions of the code.

Post a Comment for "Different Results In Eigenvector Centrality Numpy"