Rapid evolution of coordinated and collective movement in response to artificial selection

See allHide authors and affiliations

Science Advances  02 Dec 2020:
Vol. 6, no. 49, eaba3148
DOI: 10.1126/sciadv.aba3148


Collective motion occurs when individuals use social interaction rules to respond to the movements and positions of their neighbors. How readily these social decisions are shaped by selection remains unknown. Through artificial selection on fish (guppies, Poecilia reticulata) for increased group polarization, we demonstrate rapid evolution in how individuals use social interaction rules. Within only three generations, groups of polarization-selected females showed a 15% increase in polarization, coupled with increased cohesiveness, compared to fish from control lines. Although lines did not differ in their physical swimming ability or exploratory behavior, polarization-selected fish adopted faster speeds, particularly in social contexts, and showed stronger alignment and attraction responses to multiple neighbors. Our results reveal the social interaction rules that change when collective behavior evolves.


Moving animal groups display spectacular forms of coordinated behavior, with individuals moving together with high degrees of spatial and directional organization. This organization is often achieved by individuals using interaction “rules” to respond to their neighbors’ movements and positions. For example, attraction, repulsion, and alignment responses can act to maintain the cohesiveness and directional organization of groups (1, 2). The details of these interactions and the social information individuals use to inform these decisions are now well described across many species (37). However, despite our growing knowledge of the mechanistic nature of social interactions in moving animal groups, we still know very little about the evolution of these social rules (8, 9).

For instance, although it has been established that intraspecific variation exists for social attraction and alignment toward conspecifics (6, 10, 11), it remains unclear whether this variation can be attributed to heritable differences in social behavior or is, instead, driven by differences in the condition, age, experience, or size of individuals (12). While there are inherited differences in the tendencies of marine or benthic sticklebacks to school (13), those differences appear to be driven by genes affecting how social information is detected by neighbors (genes affecting the lateral line system) and not necessarily how that information is behaviorally acted upon. Nevertheless, evolutionary models suggest that heritable differences in social decision-making should exist and persist in populations (14) and particular environments should favor particular social interactions depending on the selective forces present (15). For instance, guppies from streams with increased predator pressure exhibit a change in attraction-repulsion dynamic, thereby reducing the critical distance at which neighbors move apart or come back together (15). What kinds of interactions are subject to selection, however, remains unclear.

To determine how selection can shape the social interaction rules that animals use to coordinate their movements, we performed a 4-year artificial selection experiment using guppy (Poecilia reticulata). Guppies are a model species for social behavior and evolution (16), and although they naturally shoal (17), their schooling tendencies tend to be weaker than in other species of fish, offering the potential for selection to increase social coordination. Our selection procedure targeted group polarization, a standard measure of directional coordination in animal groups. This metric captures the tendency of group members to align with each other’s directional headings. By artificially selecting for polarization over multiple generations, we tested whether, and how quickly, coordinated group movement evolved when under strong directional selection. Polarization can only be measured in a group context, but we, nevertheless, could apply an individual-level selection approach; our recently developed sorting protocol of repeated mixing and polarization determination concentrates the individuals with the highest polarization propensities in few groups (18, 19). Those individuals could then be bred for the selection lines. Our artificial selection approach further allowed us to measure how selection shaped the social rules responsible for increased polarization in these groups.

On the basis of previous simulation and empirical studies, we had a number of a priori candidate mechanisms for how increased polarization could be achieved. These mechanisms include increased strength of alignment or attraction responses (20, 21), increased interaction ranges (22), increased number of influential neighbors (23), more frequent directional updating (24), faster speeds (5, 25), or changes to individuals’ exploration or boldness (10). Here, we identify which of these changes occurred to individuals’ social interaction rules following selection.


The artificial selection procedure

Across three independent selection lines (i.e., n = 3 replicate lines), we used a previously validated sorting method (18, 19) to identify the top 20% of female fish that consistently formed more polarized groups and subsequently bred from those individuals. We focused on female behavior in our selection experiment because females of this species have a higher propensity to shoal than males (17). The sorting method involved open-field assays on groups of eight female fish (n = 16 groups per replicate), where fish were filmed when they explored an empty circular arena (diameter, 550 mm; water depth, 3 cm) together for 10 min. Fish were then tracked using idTracker (26) from the 2nd to 10th min, inclusive, from which the fish’s trajectories were subsequently analyzed. Across all frames in an assay, we calculated a group’s polarization (given by the total length of the sum of the eight unit vectors characterizing the orientation of each fish, divided by eight). Polarization scores closer to one indicate that fish are oriented in the same direction, while scores closer to zero indicate that fish are less aligned. After being assayed, the 16 groups were ranked for their median polarization scores, and half of each group’s members were subsequently swapped between adjacently ranked groups. This ranking and mixing of groups was repeated daily for 12 rounds, allowing us to create repeatable variation in polarization between groups (19). Twenty-six females from the four top-ranked groups in each line were then paired with unsorted males to breed the next generation of polarization-selected fish. We took 26 randomly selected females from the remaining groups and bred from those fish to establish control lines (n = 3). We chose this approach, as down-selecting on a behavioral trait poses the risk of potentially selecting for sick or, otherwise, less fit animals. Once the progeny from each line were fully mature, the sorting method was performed again on the next two generations of females, providing a total of three generations of selection. Polarization and control line females were always paired with males from their own cohort, so females and males were paired within each line. To ensure that the control lines experienced the same experimental conditions as the polarization lines, control fish were placed in arenas and mixed between groups in the same way as the polarization lines but were not sorted. Replicates were performed in temporal succession, starting with first generation (replicate 1, then 2, and then 3), then second generation (replicate 1, then 2, and then 3), and so on. Intervals were dependent on how fast fish were bred and matured; typical intervals between replicates within generations were 2 weeks, between generations of 2 to 3 months. We only tested adult fish (as indicated by coloration and fully developed gonpodium in males and clearly visible gravid spot in females). For further details of the selection procedure, see Fig. 1 and (18, 19).

Fig. 1 Schematic of one of three independent replicates of the selection experiment.

Each layer represents a generation of females. Arrows within a layer illustrate the sorting procedure where we identified fish that formed the most polarized groups. To do this, groups were first assayed for their group polarization. Here, variables g1 to g16 denote the 16 groups’ polarization scores in round t. These scores were subsequently ranked (blue arrows) with g(1) to g(16), denoting the ranked scores from lowest to highest. Following this, half of the group members were mixed with adjacently ranked groups (red arrows). This ranking and sorting procedure was repeated 12 times (circular gray arrow) before 26 fish from the top four ranked groups were bred for the polarization lines, and 26 fish from remaining 16 groups were bred for the control lines. This sorting procedure was repeated three times for the polarization lines (indicated by the layers), whereas fish from the control group experienced the same assaying and sorting, except that fish from these control lines were not ranked.

Evidence for selection

We performed shoaling assays (as above) on the offspring of the polarization and control lines from generation three. We found that the polarization of groups across the three replicates was on average 15% higher in polarization lines (n = 88 groups) compared to control lines (n = 85 groups; difference replicate 1: 8.4%, replicate 2: 19.7%, replicate 3: 18.7%; linear mixed model (LMM) for all replicates: t = 6.45, df = 170, P < 0.001; Fig. 2A and see movie S1 for typical swimming behavior). Males did not display a statistically significant response to selection (t = 1.13, df = 109, P = 0.26), but weak differences between polarization and control lines existed in other behavioral measures consistent with the females. See the Supplementary Materials for results over all generations (fig. S1) and discussion of the males (see “Male analysis” section).

Fig. 2 Polarization and nearest neighbor distance in groups of guppies artificially selected for polarization.

Boxplots of (A) median polarization and (B) median nearest neighbor distance for groups of eight females in polarization selected (pink boxed) or control lines (blue boxes). Replicate lines 1, 2, and 3 are denoted above the boxes. Gray markers show individual data points (i.e., trials). Horizontal lines indicate medians, boxes indicate the interquartile range, and whiskers indicate all points within 1.5 times the interquartile range. N(Replicate 1,2,3) = 60, 56, and 57.

Changes in individuals’ movement and behavior

We next tested whether selection had changed the movement characteristics of the fish in the polarization compared to control lines. As in many other fish species, guppies move with intermittent burst and glide phases (15), allowing us to characterize their movements in discrete steps (Fig. 3, A and B). Groups of females from the polarization lines exhibited a 13.5 mm s−1 (26%) of higher median speed in comparison to control lines (LMM: t = 5.59, df = 170, P < 0.001). We also performed open-arena assays on single fish and found that the difference in median speed between polarization and control lines was still significant but less pronounced compared to the social context. Single fish from polarization lines were, on average, 8.2 mm s−1 (17%) faster than single fish from control lines (LMM: t = 2.04, df = 117, P = 0.043). As speed is highly correlated with group polarization in shoaling fish (10), the increase in polarization seen in the selection lines could have been due to nonsocial selection for (i) faster moving fish or (ii) reduced swimming abilities of fish from the control lines. We, hence, investigated swimming speed differences further, both statistically and with extra swimming assays. When statistically controlling for median speed differences between the lines, we found that the polarization-selected lines were still 5.7% more polarized (LMM: t = 2.52, df = 169, P = 0.013). This indicates that while swimming speed is an important aspect of why the polarization lines swim with higher directional coordination, increased speed alone cannot fully explain such an effect. The extra swimming assays further showed that there were no differences between the swimming abilities of fish in the polarization and control lines when tested for maximal swimming speed and endurance in a swim tunnel (LMM: t = −0.56, df = 64, P = 0.579; fig. S2). Differences in behavior might also reflect differences between the polarization and control lines in overall “boldness” or tendency to explore the arena. We, hence, performed a standard personality assay where the time for a fish to leave a starting compartment was taken as a measure of its boldness, and the area it explored in a previously unknown habitat was taken as a measure of its exploration. There were no differences in the emergence time (i.e., boldness; LMM: t = −0.12, df = 28, P = 0.909; fig. S3) or exploration (LMM: t = −0.38, df = 28, P = 704; fig. S3) between the polarization and control lines when tested using these standard assays.

Fig. 3 Burst and glide analysis and inferring social interactions of guppies artificially selected for polarization.

(A) Time series containing three consecutive speed minima (dots) followed by bursting events. (B) The corresponding trajectory for fish i (in the center). The positions at the preceding and following speed minima are used to calculate the turning angle α of fish i at time t. In this example, the turn has the same sign as the nearest neighbor orientation (i.e., alignment) γ and the opposite sign to the attraction angle β. (C to E) The social interactions of females in the control lines (blue) and polarization selection lines (pink) in response to nearest neighbors. (C) The mean speed minimum when the nearest neighbor (n.n.) is in front (+) or behind (−) by a distance Ynn. The error region shows the SEM over trials. Dashed lines show the overall mean speed minimum for control and polarization lines in individual open-arena trials. (D) Alignment and (E) attraction responses to the geometric center of k nearest neighbors, where k ranges from 1 (nearest neighbor) to 7 (all conspecifics). The Spearman correlations ρ were computed for each k and for each trial for all β and γ with absolute values of less than 90°. The set of β was additionally restricted to time points where the k neighbors were all less than 200 mm from the focal fish (see the Supplementary Materials). Means (symbols) and SE (bars) were calculated for each selection line from these correlation coefficients.

To further investigate whether the social environment affects the speed that fish adopted in the polarization and control lines, we identified the speeds at which fish decided to accelerate (|v|min; Fig. 3A) and plotted this as a function of the distance to their nearest neighbor (Fig. 3C). We found that while fish from the polarization lines generally maintained higher speeds than fish from control lines, these differences were particularly apparent when fish were close to their neighbors, with differences in speed between the lines becoming less pronounced, as neighbors moved further apart. This provides further support that differences in speed were, at least in part, modulated by interactions with conspecifics. Polarization and speed results were also robust when controlling for potential differences in thigmotaxis (“wall hugging,” i.e., propensity of swimming close to the walls) between the lines (see the Supplementary Materials).

Selection on individuals’ social interaction rules

Polarization lines were significantly more cohesive than control lines (Fig. 2B; 3 mm or 10% smaller median nearest neighbor distance; LMM: t = −5.5, df = 170, P < 0.001), a finding that would not be expected whether there were changes to individuals’ speeds but not their social interactions (10). We therefore tested whether selection had altered the social interaction rules of the polarization compared to control lines. Many models and subsequent empirical work have identified that fish, including guppies, use attraction and alignment responses to coordinate their movements (5, 15). To test whether selection had changed the strength of these alignment or attraction rules, we first extracted the turning angles α (Fig. 3B) that a fish made between its movement bursts. We then calculated the Spearman rank correlation over an entire trial between turning angles (α) and nearest neighbor directions (β) to quantify attraction strength and with neighbor orientations (γ) to quantify alignment strength (see the Supplementary Materials). The strength of these correlations, therefore, acts as a proxy for the strength of these interactions. We found that fish from polarization lines had on average 23% higher correlations between turning angle and nearest neighbor orientation, and, hence, stronger alignment responses (LMM: t = 9.91, df = 170, P = 0.007; Fig. 3D). There was also a nonsignificant trend for polarization lines to have stronger attraction toward their nearest neighbor than control lines (LMM: t = 1.94, df = 170, P = 0.054). When we included speed as a covariate in our models, fish from the polarization lines still showed 9% higher alignment strength than fish from control lines (LMM: t = 4.82, df = 169, P = 0.016; see also the Supplementary Materials), showing that increased alignment responses were not only due to faster motion.

We then asked whether selection had changed the number of neighbors individuals were responding to during these attraction and alignment responses, using the centroid and mean orientation of the k nearest neighbors to calculate β and γ, respectively (see the Supplementary Materials). The shape of the alignment and attraction responses, measured as a function of the number of influential neighbors, was qualitatively similar for both lines, declining after three to four neighbors in the case of alignment and plateauing at three to four neighbors in the case of attraction (Fig. 3, D and E). This finding is reminiscent of the rule structuring in zonal models of collective motion, where alignment interactions occur with closer neighbors and attraction responses with more distant neighbors (27). Although polarization-selected fish were not significantly more attracted to their nearest neighbor than control fish, attraction strength to multiple neighbors was stronger in the polarization than control lines. Attraction strength to k = 7 nearest neighbors (i.e., the group centroid) increased in the polarization lines by 27% compared to control lines (LMM: t = 4.56, df = 170, P < 0.001; Fig. 3E and see the Supplementary Materials for male results). Selection may also have acted on the distance over which these alignment or attraction responses occurred. This is a common parameter in metric-based models of collective motion (21, 27), and we tested it by analyzing occasions when the nearest neighbor was in front of a focal individual and the focal individual either turned toward that neighbor with an attraction response (|α − β| < 30°) or turned to align with that neighbor with an alignment response (|α − γ| < 30°). We took the distance at which these responses occurred more frequently than by chance as a proxy for their interaction range (see the Supplementary Materials). We found no conclusive evidence that there were solid differences in either the attraction (LMM: t = 1.95, df = 170, P = 0.053) or alignment ranges (LMM: t = −1.6, df = 170, P = 0.11) between the selection and control lines.


Our results confirm that social interactions in a collective motion context are heritable and that they can be rapidly shaped by directional artificial selection, leading to more polarized and cohesive groups. Through detailed analysis, we found that these group-level differences are most likely caused by the combined effect of three important aspects of individual behavior: (i) speed, (ii) the strength of the alignment response, and (iii) the attraction strength to larger groups of conspecifics. Below, we discuss the implications of these discoveries for our understanding of the interaction rules that lie behind evolutionary changes in collective motion.

First, increased speed has been suggested as an important and relatively simple mechanism behind more coordinated collective motion behavior (5, 15, 25). While it is difficult to disentangle the exact strength of the effect of speed in our assays, the observed speed differences between the polarization and control lines were strongest in social contexts. The speed differences between lines were most prominent when close to conspecifics, suggesting that social facilitation may play an important role in how speed affects the increased polarization (28). Moreover, the observed differences in alignment were robust (albeit smaller) also when controlling for speed in the analysis, and we did not find any differences between polarization and control lines in our assays of physical swimming ability and behavioral stress responses. Hence, although our results indicate that speed changes clearly play an important role for the behavioral differences between the polarization and control lines, we propose that how individuals socially responded to each other also played a role in how collective motion evolved.

After controlling for speed differences between the lines, fish from polarization lines were still more likely to align with their neighbors’ directional heading than fish from control lines. The number of neighbors or the range over which these alignment responses occurred, however, was not different between the selection lines. These results are consistent with how social responsiveness is often implemented in theoretical models of collective motion, where individuals weigh the tendency to travel in their own goal-orientated directions against the adoption of neighbors’ directional headings (1, 29). It is possible, therefore, that selection acted on intrinsic differences in the social responsiveness of individuals, as has been predicted to exist in wild populations (14, 30). In addition to increased alignment responses, polarization lines also showed stronger attraction responses to multiple conspecifics. While increased attraction is typically viewed in the context of reducing predation risk through selfish herd effects (15, 31), increased attraction to others can also be viewed in the context of social decision-making, where individuals are often attracted toward larger numbers of neighbors (32). Our results suggest, therefore, that selection may have acted on how individuals weigh social information, ultimately leading to differences in group structure and social dynamics.

What is the genetic background to the observed change in polarization in three generations of selection? There are examples of seemingly complex behavior, such as burrowing behavior in mice, that can have a relatively simple genetic architecture (33). In our experiment, however, the selection regime has changed several aspects of interaction rules in the polarization lines. We therefore view a very simple genetic background to these differences as unlikely, unless that architecture has pleiotropic effects across all these rules. Another possibility is due to the behaviors under selection here being a product of interactions between the behavior of a focal individual and the other individuals in the group. These social interactions have been suggested to be strongly influenced by indirect genetic effects, where expression of a trait in one individual alters expression of the trait across the social group, thereby amplifying the effect of selection (34). Indirect genetic effects could have played a role also in our experiment and increased the response to selection, but more work is needed to reveal the genetic architecture behind the observed differences.

In nature, which social rules evolve will ultimately depend on the selective forces present. Previous research has suggested that selective forces including the social environment (14), resource availability or distribution (8, 35), and predation risk (9, 15, 22) are likely to shape individuals’ alignment and/or attraction responses. In turn, the social responses that evolve will have functional consequences for groups’ abilities to track environmental gradients (36) and transfer information about detected threats or resources between group members (37, 38). However, to fully understand the evolution of these social rules, we also need to better understand the costs associated with evolving them. We found that increased coordination and cohesive behavior were associated with increased energy expenditure (i.e., increased speed). Similar energetic costs of coordination have been reported in flocks of birds (39). Future analyses on the polarization selection lines will investigate the costs and benefits of increased coordinated and collective movement in ecologically relevant settings.

Note that the response to selection on polarization was weaker in males than in females. We specifically selected on female collective behavior in our experiment, and this could explain the weaker response in males. However, behaviors with strong fitness effects should have strong intersexual genetic correlations. The profound ecological differences between males and females in the guppy, with females having much higher propensity of shoaling (40), could explain the sex differences we observe. Our results certainly suggest that the genetic correlation between males and females for polarization behavior is relatively low, possibly due to differences in genetic architecture for social behavior between males and females (41).

In summary, our research has identified the social interaction rules that are affected by directional selection on polarization and shown that these traits are susceptible to fast evolutionary changes. An integrated approach to understanding social behavior through artificial selection combined with detailed behavioral measurements now offers considerable opportunities to understand the evolution and maintenance of social decision-making and collective behavior.


Collective motion analysis

Collective motion analyses were performed on 2565 min of videos, obtained via a Point Grey Grasshopper 3 camera (FLIR Systems; resolution, 2048 pixels by 2048 pixels; frame rate, 25 Hz), in MATLAB R2017b [details on video processing and data extraction can be found in (19)]. Speed minima and maxima were found by, first, smoothing the speed profiles of individual fish (using a Savitzky-Golay filter degree three, span 12) and applying the findpeaks function. We found that turns in the trajectories typically came three frames (0.12 s) after a speed minimum and accordingly applied this delay when calculating turning angles. For the assays of eight and single fish exploring the arenas, one of each measure was extracted per 9-min trial. Hence, for the assays with eight fish, data were aggregated over all individuals. The median distance from the edge of the arena was log-transformed, and the polarization was transformed using an inverse logistic function.

Swimming speed and boldness tests

To test whether selection changed the physical swimming ability of the fish, we measured the critical swimming speed of fish in a flow chamber (42) in 66 females and 62 males from the control and polarization selection lines. The flow chamber consisted of a 115-cm-long transparent polyvinyl chloride pipe with an inside diameter of 1.8 cm through which aerated water was pumped at controllable speed (“swim tunnel”). We measured critical swimming speed by subjecting fish to increased velocity tests: The guppies were forced to swim against a current that was increased in discrete steps, until exhaustion occurred, and they were swept against the outflow end of the tube. After a 2-min acclimation period at a low velocity of 6.5 cm s−1, we increased the current velocity by 2.2 cm s−1 every 30 s until the guppy reached exhaustion and was unable to detach itself from the outflow mesh for 3 s. Temperature was maintained at 25.0° ± 1.5°C. Results are shown in fig. S2 and table S1.

We also measured boldness and exploration of 60 females and 60 males in a standard emergence test, in a 50-liter tank with 3 cm of water. The starting compartment (20 cm by 10 cm) was separated from the exploration compartment (20 cm by 40 cm) by an opaque partition with an 8-cm-wide opening. After 2 min of acclimation in the starting compartment, an opaque trap door was lifted to allow access to the exploration compartment. The time it took until individuals left the starting compartment was used as indicator of boldness, and the number of 5 cm by 5 cm of plots visited (15 in total; every time a new plot was visited, this was added to the total area visited) was used as indicator for exploratory tendencies 3. Nonemerged fish after the maximum time of 10 min were removed from the analysis (15 from each set of female lines, 2 from male polarization lines, and 4 from male control lines). The time to exit a shelter was used as a measure of a fish’s boldness, and the area explored by each fish was used as a measure of their exploratory tendencies. Both measures were log-transformed. Results are shown in fig. S3 and table S1.


All experiments were performed in accordance with ethical applications approved by the Stockholm Ethical Board (Dnr:C50/12, N173/13, and 223/15).


We tested for differences between selection lines using linear mixed-effect models. Separate models were used for individual trials and groups of eight, as well as for males and females. Selection line was incorporated as a fixed effect. For tracked motion assays, the mean body size (estimated from idTracker) was incorporated as a covariate, as well as the median speed when controlling for activity. Replicate was used as a random effect for the intercept and the selection effect. Normality of residuals was checked using Kolmogorov-Smirnov (KS) tests, with a maximum KS statistic of 0.0107. Residuals were plotted against fitted values to visually check for correlations and heteroscedasticity. Analyses were performed in MATLAB R2017b.


Supplementary material for this article is available at

This is an open-access article distributed under the terms of the Creative Commons Attribution-NonCommercial license, which permits use, distribution, and reproduction in any medium, so long as the resultant use is not for commercial advantage and provided the original work is properly cited.


Acknowledgments: We thank A. Rennie, E. Trejo, and A. Boussard for help with fish husbandry. Funding: This work was supported by the Knut and Alice Wallenberg Foundation (102 2013.0072 to D.S., N.K., and K.P.), the Swedish Research Council (2016-03435 to N.K., 2017-04957 to A.K., and 2018-04076 to J.H.-R.), and the Whitten Lectureship in Marine Biology, University of Cambridge (to J.H.-R.). Author contributions: N.K., K.P., and D.S. conceived the idea of the study. A.K., A.S., M.R., S.D.B., J.H.-R., H.Z., K.P., D.S., and N.K. designed the details of the selection procedure. M.R. set up the filming apparatus. A.K. performed the data of the selection experiment. A.S. analyzed the data of the selection experiment. A.K., A.F.E., L.S.A., A.L.F., and G.B. performed the data of the behavioral assays. A.K., A.S., and S.D.B. analyzed the data of the behavioral assays. A.K., A.S., and J.H.-R. created the figures. A.K., A.S., J.H.-R., J.E.M., N.I.B., D.S., and N.K. wrote the manuscript. All authors contributed to the final version of the manuscript. Competing interests: The authors declare that they have no competing interests. Data and materials availability: All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials. Additional data related to this paper may be requested from the authors.

Stay Connected to Science Advances

Navigate This Article