networkx.algorithms.centrality.trophic_levels¶
-
trophic_levels
(G, weight='weight')[source]¶ Compute the trophic levels of nodes.
The trophic level of a node i is
si=1+1kini∑jaijsjwhere kini is the in-degree of i
kini=∑jaijand nodes with kini=0 have si=1 by convention.
These are calculated using the method outlined in Levine 1.
- Parameters
G (DiGraph) – A directed networkx graph
- Returns
nodes – Dictionary of nodes with trophic level as the vale.
- Return type
References
- 1
Stephen Levine (1980) J. theor. Biol. 83, 195-207