Effects of shady environments on fish collective behavior

Despite significant efforts devoted to understanding the underlying complexity and emergence of collective movement in animal groups, the role of different external settings on this type of movement remains largely unexplored. Here, by combining time series analysis and complex network tools, we present an extensive investigation of the effects of shady environments on the behavior of a fish species (Silver Carp Hypophthalmichthys molitrix) within earthen ponds. We find that shade encourages fish residence during daylight hours, but the degree of preference for shade varies substantially among trials and ponds. Silver Carp are much slower and exhibit lower persistence in their speeds when under shade than out of it during daytime and nighttime, with fish displaying the highest persistence degree and speeds at night. Furthermore, our research shows that shade affects fish schooling behavior by reducing their polarization, number of interactions among individuals, and the stability among local neighbors; however, fish keep a higher local degree of order when under shade compared to nighttime positions.


Introduction
Collective movement is a common behavior of many animal species that congregate into flocks, herds, or schools 1, 2 . These collective movements yield a myriad of spatiotemporal patterns that are well-known to provide amazing visual spectacles in nature 3 . Beyond a contemplative beauty, understanding the underlying complexity and emergence of collective movement in animal groups has been for a long time part of the agenda of researchers from several disciplines. Significant effort has been devoted to proposing and investigating minimal models (such as the Vicsek model 4 ) capable of connecting individual-level rules to the observed macroscopic phenomena [5][6][7][8][9] . However, advances in modeling approaches have been, in large part, uncoupled from empirical observations which in turn creates a gap between theory and experiment that only recently started to decrease. Indeed, recent studies relying on new methods and tools for tracking animals in groups have shed light on empirical questions that would be considered unworkable a few years ago [10][11][12][13][14][15] . Examples include the identification of influential neighbors of fish in moving groups 16 , effects of predation on shoaling fish interactions 17 and on collective escape of pigeons 18 , emergence of swirling motion 19 , and the role of social interactions on developmental trajectories of honey bees 20 .
Despite the fascinating research that has already been conducted, most of these works are focused on a single external setting and much less is known about the effects of different external settings on the collective behavior of animals 21 . In this context, an exciting possibility refers to the selection of overhead structures that create shade (hereafter shade structures) over non-shaded areas by fish species. Several species have shown an affinity for shade structures which may also play a role in the dispersal and establishment of invasive species 22 . Indeed, there is empirical evidence that shade increases residence time of some fish species. For instance, Bluegill (Lepomis macrochirus) -a freshwater fish native to the United States -is anecdotally known to shelter in the shade of trees along banks and indeed displays a strong preference for shaded areas even in the presence of predators 23 . Shade structures are also known to attract marine fish species to mangroves habitats 24 , increase the number of salmon (Oncorhynchus kisutch) in stream channels 25 and increase habitat use by the Three-Spined Stickleback (Gasterosteus aculeatus) 26 and Lake Whitefish (Coregonus clupeaformis) 27 . The preference for shade is often associated with low predation risk, not only in fish 23,25 , but also in birds 28 and rodents 29,30 . Alternatively, some species such as the Zebrafish (Danio rerio) 26 exhibit no clear preference for shade, while others such as the Chinook Salmon (Oncorhynchus tshawytscha) seem to perceive shade as a risky environment 31 .
Considering the interest in understanding the preference for shade in several species and the lack of works focused on studying collective behavior under different contexts, here we investigate how shade affects the various facets of the collective behavior of Silver Carp (Hypophthalmichthys molitrix). Silver Carp are native to eastern Asia and were imported to North America in the 1970s to be used in aquaculture, but soon escaped. This invasive species is now highly abundant in the Mississippi River basin and is further expanding to other North American basins with impacts on native fish populations 32 . Recent work has found that Silver Carp spend time near a large lock and dam on the Mississippi River 33 during the day, suggesting that shade may encourage use. Moreover, grouping tendencies of Silver Carp may be related to predator avoidance but remain poorly understood 34 . Understanding the behavior of Silver Carp and how it changes under different external contexts may reveal important patterns in habitat utilization with potential implications for species management. The main goal of our work is thus to understand how the collective behavior of these fish changes under different external settings related to the presence of shade structure during daylight hours (in and out of shade) and at night.
To do so, we rely on large-scale experiments in four earthen ponds where the position of small schools (∼10 individuals) of Silver Carp are tracked using acoustic telemetry arrays over seven 48-hour trials. In these experiments, a shaded environment is created by anchoring a large floating platform within each pond, allowing us to quantify shade selection and, more importantly, how the behavior of these fish differ when under or out of shade structures during the day and at night. Silver Carp exhibited a preference for shade structures during daylight hours, but the intensity of this preference varies across trials and ponds. Our research shows that Silver Carp are slower under shade than out of shade; however, it is at night that these fish reach their highest speeds. Movement persistence also decreases when Silver Carp are under shade and increases at night. Furthermore, shade affects the schooling behavior of these fish by reducing their polarization, number of interactions among individuals, and the stability in local neighbors. Still, we find that Silver Carp preserve an intermediate local degree of order when under shade by keeping track of their neighbors' positions even in swarm-like states.
In what follows, we describe the experiments, the collection of fish trajectories, and an analysis of the preference for shaded areas of this species. Next, we quantify the effects of shade on fish speed and the degree of persistence in speed time series. Then, focusing on collective behavior, we estimate two order parameters related to the degree of alignment and rotation in Silver Carp schools. Finally, we create a complex network representation of fish interactions based on their spatial relations to highlight how shade affects the relationships among Silver Carp.

Results
To investigate the effects of shade on the behavior of Silver Carp, we use the results of experiments carried out in four earthen ponds with water surface dimensions of approximately 40 meters by 25 meters and depth range from 1 to 2 meters (see Materials and Methods). These experiments comprise seven trials in each pond where fish positions are recorded using acoustic telemetry arrays over two full days. A 5-meter square floating platform is anchored in one of five positions in each pond during each trial which creates a shaded environment during daylight hours. Experiments started with 10 individuals in each pond, but this number decreased over the trials due to transmitter loss (see Materials and Methods and Table 1).
Figures 1A and 1B show density maps for the position of two fish from different ponds and trials during daytime and nighttime (see Fig. S1 for all ponds and trials). We observe that one of these fish shows strong preference for the shade structure over the rest of the pond during daylight hours, while the other fish does not seem to have the same preference. Similar variability occurs when we consider the position of all fish and evaluate the shade selection by calculating the fraction of time they spend under shade structures over the hours of day. Figures 1C and 1D exhibit this analysis for all fish from the same ponds and trials used to create the density maps. We note that the individual behaviors of fish in Figs. 1A and 1B agree with the fractions of time spent under shade structures by their schools. Fish from the pond and trial of Fig. 1C spend most of their time under shade during daytime and ignore the shade structure at night. Conversely, fish from pond and trial depicted in Fig. 1D never select the shade structure between midnight and noon, and were rarely under shade in the afternoon and early evening hours. These two ponds and trials are indeed extreme examples of variability in shade preference (see Fig. S2 for all ponds and trials). We quantify the preference for shade structures during daytime using a logistic regression where a binary variable indicating whether day or night is used to predict whether fish is under shade or not (see Materials and Methods). We find that the association between these covariates substantially varies among ponds and trials, but daylight significantly increases the probability of finding fish under shade structure in all cases (Fig. 1E). To account for potential location bias within each pond, we have performed a control-like analysis in which the shade preference in a given trial and pond is estimated using the shade location from the next and previous trials (that is, not the actual shade location). We find that the probability increment of finding fish under shade during daytime vanishes in both control-like analyses (Fig. S3), indicating that the association between fish selecting shade or not and the binary independent variable of day or night cannot be explained by possible biased preferences induced by the ponds themselves. Moreover, there is no recognizable pattern in shade selection across ponds and trials (Figs. S1 and S2) and we find no correlation between the fraction of time spent under shade over the hours of day and temperature or light intensity throughout the trials (Figs. S4, S5, and S6).
While there is evidence supporting the hypothesis that shade structure encourages Silver Carp residence, we do not know whether the behavior of these fish substantially differs when they select shade structures compared to when they are out of shade during daytime or nighttime. And to start addressing this question, we calculate the speed of fish, grouping data into three categories (see Materials and Methods): fish under shade during daytime, fish out of shade during daytime, and fish at night. We have not categorized night positions by location because the interaction with the shade structure was minimal at night. Figure 2A depicts the complementary cumulative distributions of fish speed (that is, the probability p(v) of finding a fish with speed larger than v) grouped into these three categories. These results clearly show that fish move much slower under shade structures during daytime, averaging v ≈ 0.13 m/s, with fish rarely exceeding one meter per second. On average, fish are almost twice as fast ( v ≈ 0.23 m/s) when out of shade during daylight hours. Fish are slightly slower at night ( v ≈ 0.21 m/s) than out of shade during daytime, but they reach the highest speeds recorded in our trials at night. These differences in speed suggest that fish may use these structures to rest and shelter. Conversely, the higher speeds out of shade are likely to be associated with foraging and feeding behaviors, as Silver Carp are pelagic filter feeders [35][36][37] . These high speeds during nighttime also suggest that these fish use the cover of dark to safely explore the ponds as this visual condition may decrease predation risks in real environments.
In addition to the speed probability distribution, dynamical features of fish speed time series may also indicate different behaviors under or out of shade during daytime or nighttime. An interesting possibility is to quantify the degree of persistence in fish speed. If fish are idler under shade and move more objectively out of it, we expect speed time series to be less persistent when fish are under shade during daytime. To verify this hypothesis, we estimate the Hurst exponent h from speed time series (see Materials and Methods) grouped into the same categories used above. Hurst exponents h > 0.5 indicate long-range persistent behavior such that time series increments are more likely to be followed by increments with the same signal, and the closer h is to 1, the higher the persistence degree. Values of h < 0.5 represent an anti-persistent behavior in which time series increments alternate signs more likely than by chance. A time series is not correlated if h = 0.5. Figure 2B shows that fish speed is marked by long-range persistence under or out of shade during daytime and nighttime (about 90% of the time series have h > 0.5). There are nonetheless appreciable differences in the distribution of h among the three situations. We observe that the Hurst Easting,  Fish from pond #2 remained under shade during nearly all daylight hours along the two observation days in trial #1 and avoided shade at night. Fish from pond #4 selected the shade structure much more rarely during daylight hours (particularly in the mornings) in trial #6. (E) Probability increment of finding a position under a shade structure during daylight hours, as estimated via logistic regression for each trial and pond. The relationship between a fish selecting shade or not and the binary independent variable of day or night varies substantially but is nonetheless significant for all trials and ponds (p-values < 0.001). exponent distribution is slightly shifted to the left for positions under shade during daylight hours when compared with the other two situations, which in turn makes the average value of h under shade ( h = 0.639 ± 0.002; mean ± standard error of the mean, unless otherwise stated) smaller than out of shade during daytime ( h = 0.661 ± 0.002) and at night ( h = 0.689 ± 0.002). These results support the hypothesis that fish move less persistently under shade and also indicate that their movements are more persistent at night. Another intriguing question is whether shady environments affect the collective behavior of Silver Carp. To investigate this possibility, we calculate two order parameters that quantify the degree of alignment and the degree of rotation in schools of fish 38,39 (Fig. 3B) than in the other two categories. These distinct behaviors become even more clear when noticing that the marginal distribution of O p has a peak close to 1 for positions out of shade during daytime (Fig. 3E). The average value of this order parameter is higher when fish are outside of the shade structure ( O p ≈ 0.59) than under shade during daytime ( O p ≈ 0.50) and at night ( O p ≈ 0.50); furthermore, the probability of finding individuals in strongly aligned states (O p > 0.9) is about two times greater outside of shade structures than in the other two categories. These results thus suggest that fish may adopt highly polarized states as a strategy for evading possible predators when out of shade during daytime. Intriguingly, the degree of polarization under shade during daylight hours (Fig. 3A) is similar to the one observed at night (Fig. 3C). Thus even though fish move faster and more persistently during nighttime than under shade structures during daytime, the degree of alignment among group members is low and does not differ much between these two situations. These low polarized states during nighttime and under shade during daytime could represent behavioral responses to reduced or low predation pressure at night and under shade structures during the day. Conversely, the joint probability distributions of the order parameters shown in Fig. 3 do not indicate much difference in the degree of rotation among the three categories. The marginal distributions of O r (Fig. 3D) show that the degree of rotation is only slightly less spread under shade during daytime, but the average value of this order parameter is approximately the same ( O r ≈ 0.61) in the three situations. Fish rarely adopt a strong rotating group state in our experiments, such that only ≈1% of timestamps are characterized by O r > 0.9 regardless of the position category.
To further investigate the effects of shade on the collective behavior of Silver Carp, we create a complex network representation of fish interactions based on their spatial relations. As detailed in Materials and Methods, we first obtain the Voronoi tessellation related to fish positions in a given time and draw connections between individuals sharing a boundary in the Voronoi diagram (Fig. 4A). This type of spatial relationship between individuals approximates the properties of sensor networks and is thus a good proxy for fish interactions 40 . Next, we aggregate information about all connections within a 10-minute window to create a weighted network where fish are the nodes, and the weighted connections among them represent the fraction of time a pair of fish remained neighbors during the time interval divided by the number of fish minus one. Finally, we group these networks into the same three categories used previously: daylight hours under shade, daylight hours out of shade, and nighttime positions. Figure 4B depicts a visualization of typical networks for each of these categories. In these visualizations, connections between individuals that remained neighbors in the Voronoi diagram for a considerable fraction of the time are represented by wide and dark edges, while thin and light gray edges indicate pairs of fish that were neighbors much less frequently.
A simple visual inspection of the networks in Fig. 4B indicates that the interactions among fish during daylight Northing, y (meters) 8 9 Easting, Northing, y (meters) 8 9 Easting, x (meters) A 14h 37min hours under or out of shade and at night are different. The network representing positions out of shade during daytime has more intense connections among several individuals, while the other networks display a smaller number of such connections (particularly during nighttime). To systematically explore these differences, we first evaluate the average weighted degree k of these networks (see Materials and Methods). The weighted degree κ is the sum of weights of edges connected to a given node, and therefore it represents the sum of the fractions of time of all fish that were neighbors of a given fish divided by the total number of fish minus one. This quantity is thus an indicator of the average number of neighbors (weighted by the fraction of time and normalized by the number of fish) a fish had during the 10-minute interval; for instance, if fish remain in a star-like configuration, the central fish would have a value of κ approximately equal to one, while κ is approximately equal to one over the number of fish minus one for all peripheral fish. The average weighted degree k is the average value of the weighted degree κ over all network nodes, and it is thus a proxy for the number of interactions among fish in the school. Figure 4C shows the probability distribution of the average weighted degree k when grouping the networks into the three categories. We observe a clear distinction between networks related to under and out of shade positions during daylight hours -positions under shade yield networks with lower average weighted degrees than positions out of shade. This result shows that fish interact less among themselves under shade, and because we know polarization is low under shade (Fig. 3E), we can further assert that this lower number of interactions is partially 7/16 explained by the lack of stable formations that characterize swarm-like states. Conversely, the high number of interactions displayed by fish out of shade during daytime reflects more stable and polarized formations in which fish keep track of their neighbors' directions. In its turn, the distribution of the average weighted degree associated with nighttime positions is more uniform than the two previous cases, indicating that the number of interactions at night is more random.
We have also calculated the average weighted transitivity coefficient C 41 (see Materials and Methods) of these networks under the three conditions. For unweighted networks, the transitivity coefficient (also known as the clustering coefficient) measures the density of closed triplets, indicating thus the tendency of nearest neighbors of a node to be connected 42 . Similarly, the weighted transitivity quantifies the density of closed triplets taking into account the geometric mean of edge weights of the triangle motifs. Thus, closed triplets in which one of the edges has very low intensity contribute little to the weighted transitivity, while closed triplets having all edges with high weights contribute more. We can interpret this transitivity coefficient as an indicator of local order in fish position, such that stable local neighborhoods (that is, movements that tend to keep the same first neighbors) are expected to yield higher values of C than unstable local neighborhoods. Figure 4D shows the probability distribution of the average weighted transitivity coefficient C when grouping networks into the three categories. We note that the distributions of C are remarkably different between networks

Discussion
We have presented an extensive investigation of the effects of shady environments on the behavior of Silver Carp. Similar to other fish species [23][24][25][26][27] , we have first verified that shade encourages residence of Silver Carp during daylight hours but that the degree of preference for shade structures varies significantly among our experiments. Changes in light levels due to weather and/or water clarity may have a role in these differences as fish may use shade or shelter at greater light levels 23,25 . Cloud cover, sediment, or phytoplankton productivity may influence water clarity over short and long temporal scales. However, albeit crude, we have evaluated the relationship between light levels and shade use among ponds and trials, finding no strong correlation. Furthermore, water temperature was not found to correlate well with shade use. While study treatments designed to test the effect of environmental conditions would be best, we believe light intensity and water temperature played a minor role in our study. In regard to light, zooplankton and phytoplankton communities within pond increased across trials, creating reduced water clarity. However this did not result in a decreasing trend in the use of shade structure over trials. Alternatively, though our trials generated a large data set, our findings are based on four replicated ponds which may not be sufficient to derive clear patterns among these variables.
Still, the lack of apparent environmental factors explaining the variation in shade selection allows us to hypothesize that individual differences and preferences may play a role in this matter. Nile tilapia (Oreochromis niloticus), though taxonomically divergent, have been found to present individual variations in preferences related to the selection of different colors 43 and different substrate sizes 44 . Indeed, several studies evaluating animal preferences have found their choices to differ in subsequent tests [45][46][47][48][49] . Under the hypothesis that individuality matters for shade selection, how a single individual may affect the entire group's decision of selecting the shade structure becomes a fascinating question that future research may address. Another possible explanation for the variability in shade selection is domestication, which among other changes, may yield risk tolerant individuals 50 . Fish used in our study were spawned and reared on-site and may have suppressed natural instincts, which in turn may also explain the variations in shade selection given the association between shade preference and predation risk 23,25,[28][29][30] . In this regard, future studies can verify whether shade selection and behavior differ between domestic and wild groups of individuals and even how these patterns would change in their natural habitats.
Beyond finding that fish are more likely to be under shade structures during the day than at night, our research reveals that the behavior of Silver Carp is quite different depending on whether fish are under or out of shade during daytime or nighttime. Fish swim much slower under shade than out of shade during the day, but it is at night that they reach their highest speeds. Moreover, speed time series display different degrees of long-range persistence among these three conditions. Long-range persistence decreases when fish are under shade and becomes more intense at night, an indication that movement is more directed at night and when not under shade.
We have also investigated how the collective behavior of this fish species changes among positions under or out of shade during the day and nighttime positions via two approaches. In the first one, we have relied on two order parameters that quantify the school's degree of polarization and rotation. We have found that Silver Carp rarely adopt strong rotating states in our experiments and that shade or nighttime do not affect this behavior. The lack of these strong rotating states may be attributed to the number of individuals used in our study. In research with Golden Shiner (Notemigonus crysoleucas), Tunstrøm et al. 39 report that groups of 30 fish in a 2.1 meters by 1.2 meters shallow tank rarely adopt rotating group states, but as group size increases, the frequency of these states also increases. Thus, future research with greater numbers of Silver Carp may help us understand if these fish exhibit strong rotating states and whether shady environments play a role in emergence of these states. Conversely, fish assume swarm-like states with no preferential movement direction when under shade structures and adopt strong polarized states in which they move aligned with each other when out of shade during daylight hours.
In the second approach, we have created interaction networks for Silver Carp based on spatial relations obtained from a Voronoi tessellation of fish positions -a technique that closely approximates fish sensory networks 40 . We have found these interaction networks to be remarkably different for positions under or out of shade structures during daytime and nighttime positions. Fish interact less among themselves under shade and tend to keep a higher number of stable neighbors when out of shade during daytime; at night, the weighted number of interactions is more evenly distributed. We have further observed a hierarchy regarding the emergence of strong and closed triadic relationships among fish. The density of strong closed triads is much larger when fish are out of shade during daytime, decreases when under shade, and further diminishes at night.
Taken together, our findings indicate that Silver Carp decrease their speed, the persistence of their movement, and their group polarization under shade structures, which is consistent with resting or a latent state of movement. Still, these fish appear to keep some level of local order as indicated by the intermediate transitivity values in their interaction networks under this condition. During daylight hours and out of shade, Silver Carp move fast, persistently, and in group states displaying intense polarization and stable formations marked by very high transitivity values and high number of stable neighbors. These results thus suggest that Silver Carp keep a collective attention state when moving about the pond during daylight hours, presumably to forage [35][36][37] . Finally, these fish reach their highest speed and long-range persistence at night, whereas group polarization is similar to the under shade situation. Furthermore, interactions among fish are much weaker at night compared to the other two conditions as the interaction networks are characterized by a more uniform weighed degree distribution and low transitivity values. Thus, fish seem to take advantage of the dark to safely explore the environment in group states marked by small coordination, perhaps due to the reduced visual condition and presumed lower risk of predation. We believe these findings may have implications for managing this invasive species. For example, pairing this knowledge with the prioritization and design of non-structural barriers could lead to increased performance of these migratory deterrents. Lastly, our findings suggest that fish stay in more latent states under shade than out, providing fish with this choice of being under shade or not could also improve animal welfare 51 .

Experiments and data extraction
The experiments and data set used in this study comprise of seven trials that took place in four earthen ponds at the U.S. Geological Survey, Columbia Environmental Research Center, Columbia, Missouri, USA. Ponds are approximately 40 meters long by 25 meters in width and depth range of 1-2 meters and were setup to be replicates; every attempt was made to control variation among ponds including water flow. Experiments started with ten juvenile Silver Carp (345.2 ± 17.5 mm total length and 377 ± 64.7 g weight; mean ± standard deviation), spawned and reared on-site, placed in each pond. We have used juveniles because the husbandry of larger individuals is much more complex and also because they are expected to be sexually immature (controlling for potentially confounding behavioral variables related to different sexes). All individuals were fitted with acoustic transmitters (20 × 6.8 mm with a weight of 1.
The acclimation period was repeated in between each trial. This platform creates a shady environment below it that mimics aquatic habitat that may be found near solid vertical or overhanging structures.
We have filtered out all positions from expelled transmitters in each trial by examining the position variability (standard deviation of consecutive position increments) of each fish in a one-hour sliding window. Trajectories with position variability smaller than 20% of the overall variability of each fish were considered as potential transmitter loss and were visually inspected. All trajectories identified as expelled transmitters were entirely removed from our analysis. We have visually inspected all trajectories and filtered out time series associated with poor detection events that lead to very large (more than one hour) gaps in position detection. These gaps are attributed to anomalies in individual tag signals coinciding with restrictive settings in the transmitter data processing steps, which lead to the exclusion of tag transmissions. The final data set comprises more than 24 million positions from individuals that retained their acoustic transmitter throughout individual trials (18 of 40 individuals contributed data for all seven trials) as detailed in Table 1. At the end of the seventh trial the ponds were drained and all 40 fish were recovered alive.

Speed time series
To estimate the speed time series of fish, we first segment fish trajectories into two classes, representing positions in and out of shade structures. Within those classes, we then select trajectory segments with more than 50 consecutive observations and calculate speed using distance and time between consecutive positions. Finally, these speed time series were classified into three groups: daylight hours under shade, daylight hours out of shade, and nighttime positions.

Detrended fluctuation analysis
We have estimated the Hurst exponent h from the speed time series segments v(t) via detrended fluctuation analysis (DFA) 52,53 . DFA consists of the following steps. We start by defining the integrated profile series where v(t) is the average speed of the time series segment. Next, we sample Y (t) into m n = m/n non-overlapping partitions of size n, where m is the length of the time series. For each partition, we adjust a linear model and subtract it from Y (t), defining the detrended profile at the scale n as Y n (t) = Y (t) − p j (t), where p j (t) represents the adjusted linear function in the j-th partition. Finally, we calculate the root-mean-square fluctuation function F(n) = ∑ m n j=1 Y n (t) 2 j /m n , where Y n (t) 2 j is the mean-square value of Y n (t) over data in the j-th partition.

11/16
For self-similar time series, F(n) displays a power-law dependence on n, F(n) ∼ n h , where h is the Hurst exponent. We estimate h by calculating the slope of the linearized version of the power-law relation (log F(n) ∼ h log n) via ordinary least squares method. Values of h > 0.5 indicate long-range persistent behavior, while h ≈ 0.5 represents uncorrelated or short-range correlated time series. We have also determined that the Hurst exponents from shuffled versions of the speed time series are around 0.5, confirming the existence of long-range correlations.

Order parameters
To calculate the order parameters, we have first interpolated the trajectory of each fish using the nearest-neighbor method and resampled these time series with a 4-second resolution in order to synchronize the trajectories of all fish in each trial and pond. Using these synchronized trajectories, the polarization order parameter is defined by 38,39 where u i is the unit direction vector of the i-th fish in a given time for a particular trial and pond with N tracked fish.
where r i is a unit vector pointing from school's center of mass towards the position of the i-th fish. This quantity represents the normalized average values of the fish angular momentum and it is constrained to interval [0, 1]. The lower bound of O r represents a situation with no rotation, while the upper bound indicates a strong rotating configuration. The results of Fig. 3 were obtained considering only trials with five or more fish; however, our conclusions remain the same when considering the entire data set.

Interaction networks
We use the same synchronized trajectories defined in the previous section to create the interaction networks. For a given trial and pond with five or more fish, we select all positions at a particular time t and create the Voronoi diagram. This diagram is a partitioning of the fish positions plane into convex polygons so that each polygon contains the position of one fish, and every point within the polygon is closer to this particular fish than to any other fish (see black lines of Fig. 4A for an example). Using the Voronoi diagram at time t, we create a graph g t = (ν, ε) where vertices ν correspond to fish and the set of edges ε connects all pairs of individuals that are neighbors in the Voronoi tessellation (see orange lines of Fig. 4A for an example). Finally, we combine these graphs g t using non-overlapping time intervals of length ∆t to create a weighted network G τ = (V, E,W ) where τ stands for the central point in the time interval, vertices V represent fish, the set of edges E connect all pairs of individuals that were neighbors at least once within the time interval, and W is the set of edge weights representing the fraction of time a pair of individuals remained neighbors during the time interval divided by the number of fish minus one. The results of Fig. 3 were obtained for ∆t = 10 min; however, sensitivity analysis reveals similar results when considering other time intervals (see Fig. S7). Furthermore, we consider a network to represent the under shade category when more than 10% of fish positions are localized under the shade structures within the time interval (sensitivity analysis reveals similar results when considering different thresholds, as shown in Fig. S8).

Network measures
Average weighted degree. The weighted degree κ of a vertex is the sum of all weights of its incident edges 42 . The average weighted degree k of a network is the average value of the weighted degree of all network vertices. Average weighted transitivity. Transitivity measures the extent to which vertices in a graph cluster together. For simple and undirected graphs, transitivity (or the global clustering coefficient) is defined as the ratio between the number of closed triplets and the total number of triplets (open and closed) 42 . This measure quantifies the tendency of the nearest neighbors of a particular node to be neighbors themselves. There are several generalizations of transitivity for weighted networks 54         90.0% threshold Figure S8. Sensitivity analysis at five thresholds of network measures used to define the under-shade category in the analysis related to the interaction networks. Each row of plots shows the probability distributions of the same network measures depicted in Figure 4 of the main text for various thresholds (values are indicated within the plots). We note that these distributions do not differ significantly among the different thresholds.