Hybrid Methods#

Examples in this module use nx.les_miserables_graph(). Methods return scored full graphs; apply threshold_filter() to extract final backbones. Complexity classes are provided in each function docstring.

Hybrid backbone extraction methods.

These methods combine statistical and structural approaches.

networkx_backbone.hybrid.glab_filter()[source]#

Zhang et al. (2014) – Globally and Locally Adaptive Backbone. Combines disparity filter with high salience skeleton.

networkx_backbone.glab_filter(G, weight='weight', c=0.5)[source]#

Compute GLAB (Globally and Locally Adaptive Backbone) p-values.

The GLAB method [1] combines global and local information. For each edge it computes an involvement score — the fraction of all shortest paths that pass through the edge — and then tests significance using a degree-dependent null model.

The p-value is computed as:

p(e) = (1 - I(e))^((k_u * k_v)^c)

where I(e) is the edge betweenness centrality (involvement), k_u, k_v are endpoint degrees, and c controls degree influence.

Parameters:
  • G (graph) – A NetworkX graph.

  • weight (string, optional (default="weight")) – Edge attribute key (used as distance = 1 / weight for shortest-path computation).

  • c (float, optional (default=0.5)) – Involvement parameter controlling degree influence.

Returns:

H – A copy of G with a "glab_pvalue" edge attribute.

Return type:

graph

References

[1]

Zhang, X., Zhang, Z., Zhao, H., Wang, Q., & Zhu, J. (2014). Extracting the globally and locally adaptive backbone of complex networks. PLoS ONE, 9(6), e100428.

Examples

>>> import networkx as nx
>>> from networkx_backbone import glab_filter, threshold_filter
>>> G = nx.les_miserables_graph()
>>> H = glab_filter(G)
>>> backbone = threshold_filter(H, "glab_pvalue", 0.05, mode="below")
>>> backbone.number_of_edges() <= H.number_of_edges()
True

Computational complexity estimate is O(nm + n^2 log n) time and O(n + m) space.