Skip to content

Adds local and global reaching centrality functions - #1555

Closed
jfinkels wants to merge 1 commit into
networkx:masterfrom
jfinkels:pr-6
Closed

jfinkels wants to merge 1 commit into
networkx:masterfrom
jfinkels:pr-6

Conversation

@jfinkels

@jfinkels jfinkels commented Jun 1, 2015

Copy link
Copy Markdown
Contributor

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, and global_reaching_centrality, a centrality measure for an entire graph. Unlike the previous pull request which put the global_reaching_centrality function in the algorithms/hierachy.py module, these functions now live in a new module, reaching.py, under the centrality package.

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 weight keyword argument of the shortest_path function 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']).

@jfinkels

Copy link
Copy Markdown
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.

@hagberg

hagberg commented Apr 16, 2016

Copy link
Copy Markdown
Member

This can be updated now with #1690.

@jfinkels jfinkels closed this Apr 21, 2016
@jfinkels
jfinkels deleted the pr-6 branch April 21, 2016 05:26
@jfinkels

Copy link
Copy Markdown
Contributor Author

I messed up with Git and I don't know how to fix it. I'll start a new pull request, sorry!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants