Skip to content

712 global reaching centrality - #6

Closed
conradlee wants to merge 25 commits into
networkx:masterfrom
conradlee:712-global-reaching-centrality
Closed

conradlee wants to merge 25 commits into
networkx:masterfrom
conradlee:712-global-reaching-centrality

Conversation

@conradlee

Copy link
Copy Markdown

This pull request implements the global reaching centrality measure (a measure of hierarchy), as described in ticket 712 in the networkx developer zone.

It includes unit tests as well.

There is one bit of code that should probably be handled more elegantly. The global reaching centrality, as originally defined, assumes that high edge weights mean high connection strength. At the same time, in the function we need to find the shortest paths between all pairs of nodes, where the shortest paths are the ones with the highest total edge weight. The shortest path finding algorithms implemented in NetworkX assume that edge weight is equivalent to path length, so the semantics are the opposite as in the case of global reaching centrality. For this reason, in the case of weighted networks, for every edge I create an attribute called "grc_lengths" which is used by Dijkstra's algorithm. This is problematic if the user happened to have already set an edge attribute called "grc_lengths"---that attribute vale will be changed (and then removed in the cleanup that takes place at the end).

We could solve this problem by working off a copy of the graph, on which we're allowed to trample on the user's edge attributes.

conradlee and others added 25 commits April 5, 2012 17:43
@hagberg

hagberg commented Feb 2, 2016

Copy link
Copy Markdown
Member

Superceded by #1555

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.

3 participants