Weighted Eigen Vector Centrality #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Development Workflow
make format
make test
make lint
Features
Weighed Eigen Vector Centrality
Added option to calculate eigen vector centrality with edge weight.
similar to networkx's api
Arbitrary weight evaluation
Added option to customize edge weight evaluation for eigen vector centrality calculation. This features is hidden behind
eigenvector_centrality
and only visible ineigenvector_centrality_impl
, which allow both clean interface a option to more complex featuresDocString for eigenvector centrality function
API change
Examples
sanity check with networkx
custom evaluation function
Code Changes
eigenvector_centrality_impl
allow generic type to be edge type, and accept a callback to evalate the weight of the edge.
calculate the next value with weight.
instead of a new zero vec for
next
, thenext
is a clone ofcentrality
, that's hownetworkx
does iteigenvector_centrality
andeigenvector_centrality_numpy