You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a disconnected graph, eigenvector_centrality sometimes delivers random results.
g =SimpleGraph(6)
add_edge!.(Ref(g), 1:3, (1:3)')
add_edge!.(Ref(g), 4:6, (4:6)')
eigenvector_centrality(g)
Run this multiple times, the numbers are always different.
Strictly speaking,
Eigenvector centrality is not well-defined for disconnected graphs since the centrality scores of the individual components are independent of each other
[...] If there are several disconnected components, then the algorithm computes the eigenvector centrality individually for each component, then scales the scores according to the percentage of graph nodes in that component. The centrality score of disconnected nodes is 1/numnodes(G).
Description of bug
In a disconnected graph,
eigenvector_centrality
sometimes delivers random results.Run this multiple times, the numbers are always different.
Strictly speaking,
source on stackoverflow
Here's what Matlab does
https://de.mathworks.com/help/matlab/ref/graph.centrality.html
Potential fixes
The text was updated successfully, but these errors were encountered: