- trophic_differences(G, weight='weight')¶
Compute the trophic differences of the edges of a directed graph.
The trophic difference \(x_ij\) for each edge is defined in Johnson et al.  as:\[x_ij = s_j - s_i\]
Where \(s_i\) is the trophic level of node \(i\).
A directed networkx graph
Dictionary of edges with trophic differences as the value.
Samuel Johnson, Virginia Dominguez-Garcia, Luca Donetti, Miguel A. Munoz (2014) PNAS “Trophic coherence determines food-web stability”