We conducted 500 generations of selection in a population consisting of 200 groups. The probability of robots to transmit their genomes from one generation to the next was proportional to their individual fitness (see Materials and Methods
). The selected genomes were randomly assorted and subjected to crossovers and mutations to create the 1,600 new genomes (200 groups of 8 robots) forming the next generation 
This experimental setup allowed us to independently manipulate the relatedness between robots within a group and the cost-to-benefit ratios of helping. To quantitatively test Hamilton's rule for the evolution of altruism, we investigated how the level of altruism (defined as the proportion of food items shared with other group members) changed over generations in populations with five different c/b
ratios and five relatedness values (see Materials and Methods
). For each of these 25 treatments, the selection experiments were conducted in 20 independently evolving populations. Because of the impossibility to conduct hundreds of generations of selection with real robots, we used physics-based simulations that precisely model the dynamical and physical properties of the robots. We previously showed that evolved genomes can be successfully implemented in real robots 
that display similar behavior to that observed in the simulations.
Because the 33 genes were initially set to random values, the robots' behaviors were completely arbitrary in the first generation. However, the robots' performance rapidly increased over the 500 generations of selection (). The level of altruism also rapidly changed over generations with the final stable level of altruism varying greatly depending on the within-group relatedness and c/b ratio (). When the c/b value was very small (0.01), the level of altruism was very high in the populations where within-group relatedness was positive (i.e., 0.25, 0.5, 0.75, and 1.00) and close to zero when robots were unrelated (). In the treatments with other c/b values, the level of altruism was also very low when the relatedness was close to 0 and the level of altruism also rapidly increased when the relatedness became higher than a given value. In all cases, the transition occurred when r became greater than c/b, as predicted by Hamilton's rule.
Mean group foraging efficiency during the 500 generations of selection.
Mean level of altruism during the 500 generations of selection.
Mean level of altruism at the end of the 500 generations of selection.
When the relatedness was equal to c/b
, there was an intermediate level of altruism with the frequency of altruistic acts not differing significantly from the initial value, which was 0.5 (four one-sample Wilcoxon tests, df
19, all p>
0.368). This is the expected pattern because the inclusive fitness of robots, comprising both their own fitness points and those gained from altruists, is independent of whether or not they behave altruistically when r = c/b
. Under such conditions, the level of altruism should vary only as a result of drift over generations, thus leading to important between-population variation in the level of altruism. Consistent with this prediction, the standardized variance (F
Var(p)/pq) in altruism when r
was equal to c/b
0.204) was significantly higher than when r
was greater than c/b
0.018; Mann-Whitney, df
0.002) and when r
was smaller than c/b
0.015; Mann-Whitney, df
The fact that the level of altruism remained slightly greater than 0 when r
was smaller than c/b
and slightly lower than 1 when r
was greater than c/b
can be explained by mutations maintaining some behavioral variability in the population. In line with this view of the level of altruism being at mutation-selection equilibrium, the level of altruism became significantly closer to zero (Pearson's r=
0.643; Mann-Whitney, df
0.001) as the strength of selection increased (i.e., when the value r
became more negative, only negative values of r
considered for the correlation). Similarly, the level of altruism became significantly closer to 1 (Pearson's r=
0.805; Mann-Whitney, df
0.004) as the strength of selection for higher levels of altruism increased (i.e., when the value r
increased, only positive values of r
considered in the correlation).
To determine whether mutations in our neural network had pleiotropic and epistatic effects and whether there were departures from weak mutations effects, we conducted additional experiments at the last generation in two treatments with intermediate r
values (treatment 1: r=
0.75; treatment 2: r=
0.25). First, for each treatment, we subjected 4,000 individuals (one in each group) to a single mutation of moderate effect (see Materials and Methods
). In the first experiment, performance was significantly affected by a much higher proportion of the mutations than the level of altruism (). Importantly, 1.36% of the mutations affecting the level of altruism also translated into a significant change in performance, indicating widespread pleiotropic effects. Similar results were obtained in the second experiment with 4.91% of the mutations affecting the level of altruism also significantly affecting performance. Second, we tested for epistatic effects by comparing the effect of a single mutation in 4,000 individuals with two allelic variants at another locus (see Materials and Methods
). The genetic background significantly influenced the effect of the mutation in 2,371 (59.3%) of the cases in the first treatment and 2,336 (58.4%) of the cases in the second treatment. These results demonstrate that epistatic interactions are also widespread. Finally, our experiments showed frequent departures from weak effects on behavior and fitness. Performance changed by more than 25% for 1,616 (40.4%) of the mutations in the first treatment and 1,776 (44.4%) of the mutations in the second treatment, and the level of altruism changed by more than 25% for 552 (13.8%) and 1,808 (45.2%) of the mutations in the first and second treatment, respectively.
Effects of a single mutation on performance, altruism, and both.