networkx.algorithms.centrality.trophic_incoherence_parameter

trophic_incoherence_parameter(G, weight='weight', cannibalism=False)[source]

Compute the trophic incoherence parameter of a graph.

Trophic coherence is defined as the homogeneity of the distribution of trophic distances: the more similar, the more coherent. This is measured by the standard deviation of the trophic differences and referred to as the trophic incoherence parameter \(q\) by [1].

Parameters
  • G (DiGraph) – A directed networkx graph

  • cannibalism (Boolean) – If set to False, self edges are not considered in the calculation

Returns

trophic_incoherence_parameter – The trophic coherence of a graph

Return type

float

References

1

Samuel Johnson, Virginia Dominguez-Garcia, Luca Donetti, Miguel A. Munoz (2014) PNAS “Trophic coherence determines food-web stability”