  Situations involving cooperative behaviour are widespread among animals and
humans alike. Game theory and evolutionary dynamics have provided the
theoretical and computational grounds to understand what are the mechanisms
that allow for such cooperation. Studies in this area usually take into
consideration different behavioural strategies and investigate how they can be
fixed in the population under evolving rules. However, how those strategies
emerged from basic evolutionary mechanisms continues to be not fully
understood. To address this issue, here we study the emergence of cooperative
strategies through a model of heuristics selection based on evolutionary
algorithms. In the proposed model, agents interact with other players according
to a heuristic specified by their genetic code and reproduce -- at a longer
time scale -- proportionally to their fitness. We show that the system can
evolve to cooperative regimes for low mutation rates through heuristics
selection while increasing the mutation decreases the level of cooperation. Our
analysis of possible strategies shows that reciprocity and punishment are the
main ingredients for cooperation to emerge, being conditional cooperation the
more frequent strategy. Additionally, we show that if in addition to
behavioural rules, genetic relatedness is included, then kinship plays a
relevant role. Our results illustrate that our evolutionary heuristics model is
a generic and powerful tool to study the evolution of cooperative behaviour.
