gefura is a small Python module that implements gefura measures, i.e. indicators that characterize to what extent a node forms a 'bridge' between groups in a network. Its name derives from Old Greek γεφυρα, meaning bridge.
These measures are adaptations of betweenness centrality where only shortest paths between nodes from different groups are taken into account. Previously they were known as Q-measures. Because Q is already used for many other concepts (e.g. modularity in networks), we have chosen the new name gefura.
This module implements global and local gefura. Both directed and undirected, as well as weighted and unweighted networks are supported.
gefura only depends on NetworkX.
Global gefura is an indicator of brokerage between all groups in the network. The global gefura measure (unnormalized) of node
where
Local gefura is an indicator of brokerage between a node's own group and all other groups. If node
>>> import networkx as nx
>>> from gefura import global_gefura
>>> G = nx.path_graph(5)
>>> groups = [{0, 2}, {1}, {3, 4}]
>>> global_gefura(G, groups)
{0: 0.0, 1: 0.5, 2: 0.8, 3: 0.6, 4: 0.0}