trophic_levels¶
- trophic_levels(G, weight='weight')[source]¶
Compute the trophic levels of nodes.
The trophic level of a node
iswhere
is the in-degree of iand nodes with
have by convention.These are calculated using the method outlined in Levine [1].
- Parameters
- GDiGraph
A directed networkx graph
- Returns
- nodesdict
Dictionary of nodes with trophic level as the value.
References
- 1
Stephen Levine (1980) J. theor. Biol. 83, 195-207