Repository navigation
Conversation
Contributor
Author
|
If pull request #1690 is merged, this pull request can be modified so that it does not modify the edge attributes of the input graph. |
Member
|
This can be updated now with #1690. |
Contributor
Author
|
I messed up with Git and I don't know how to fix it. I'll start a new pull request, sorry!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request supercedes pull request #6 to implement issue #698. It takes the code from #6 and updates and clarifies. It introduces two functions,
local_reaching_centrality, a node centrality measure, andglobal_reaching_centrality, a centrality measure for an entire graph. Unlike the previous pull request which put theglobal_reaching_centralityfunction in thealgorithms/hierachy.pymodule, these functions now live in a new module,reaching.py, under thecentralitypackage.The main issue, as noted in that pull request, is that it modifies the edge attribute dictionary during the computation. The only way I can think of fixing this problem without copying the entire graph is to allow, for example, the
weightkeyword argument of theshortest_pathfunction to be a function instead of just a dictionary key. For example,nx.shortest_path(G, weight=lambda u, v: total_weight / G.edge[u][v]['weight']).