  We introduce a framework for studying social dilemmas in networked societies
where individuals follow a simple state-based behavioral mechanism based on
generalized reciprocity, which is rooted in the principle "help anyone if
helped by someone". Within this general framework, which applies to a wide
range of social dilemmas including, among others, public goods, donation and
snowdrift games, we study the cooperation dynamics on a variety of complex
network examples. By interpreting the studied model through the lenses of
nonlinear dynamical systems, we show that cooperation through generalized
reciprocity always emerges as the unique attractor in which the overall level
of cooperation is maximized, while simultaneously exploitation of the
participating individuals is prevented. The analysis elucidates the role of the
network structure, here captured by a local centrality measure which uniquely
quantifies the propensity of the network structure to cooperation, by dictating
the degree of cooperation displayed both at microscopic and macroscopic level.
We demonstrate the applicability of the analysis on a practical example by
considering an interaction structure that couples a donation process with a
public goods game.
