flow_hierarchy#
- graph_tool.structure.flow_hierarchy(g, weight=None)[git][source]#
Return the flow hierarchy of a directed graph.
- Parameters:
- g
Graph Directed graph.
- weight
EdgePropertyMap(optional, default:None) Edge weights.
- g
- Returns:
- h
float The fraction of edges (or of the total weight) that are not part of a cycle.
- h
See also
edge_reciprocityFraction of reciprocated edges
label_componentsStrongly connected components
graph_tool.centrality.trophic_incoherenceTrophic incoherence parameter
Notes
The flow hierarchy [luo-detecting-2011] is
\[h = 1 - \frac{\sum_{e\in E_c}w_e}{\sum_{e\in E}w_e},\]where \(E_c\) is the set of edges that belong to a directed cycle, i.e. whose endpoints lie in the same strongly connected component (self-loops included), and \(w_e = 1\) if no weights are given. It is one for directed acyclic graphs (and for graphs without edges) and zero for strongly connected ones. The strongly connected components are found in time \(O(V + E)\).
References
[luo-detecting-2011]Jianxi Luo and Christopher L. Magee, “Detecting evolving patterns of self-organizing networks by flow hierarchy measurement”, Complexity 16, 53-61 (2011), DOI: 10.1002/cplx.20368 [sci-hub, @tor]
Examples
>>> g = gt.Graph([(0, 1), (1, 2), (2, 0), (2, 3), (3, 4)]) >>> print(gt.flow_hierarchy(g)) 0.4