  The sustainability of structured biological, social, economic and ecological
communities are often determined by the outcome of social conflicts between
cooperative and selfish individuals (cheaters). Cheaters avoid the cost of
contributing to the community and can occasionally spread in the population
leading to the complete collapse of cooperation. Although such a collapse often
unfolds unexpectedly bearing the traits of a critical transition, it is unclear
whether one can detect the rising risk of cheater's invasions and loss of
cooperation in an evolving community. Here, we combine dynamical networks and
evolutionary game theory to study the abrupt loss of cooperation as a critical
transition. We estimate the risk of collapse of cooperation after the
introduction of a single cheater under gradually changing conditions. We
observe a systematic increase in the average time it takes for cheaters to be
eliminated from the community as the risk of collapse increases. We detect this
risk based on changes in community structure and composition. Nonetheless,
reliable detection depends on the mechanism that governs how cheaters evolve in
the community. Our results suggest possible avenues for detecting the loss of
cooperation in evolving communities
