## Introduction

When thousands of individual insects self-assemble into one coherent group, the resulting superorganism can perform functions that individuals cannot. Prominent examples include fire ant rafts and towers keeping a colony afloat during a flood and helping them get to dry land1,2, army ant bridges shortening a path of a marching colony, and their bivouacs forming a temporary home for their queen and brood3,4, and Western honey bees gathered in swarms to keep their queen safe while they search for a new hive5. In these aggregations, the majority of the insects reside in the bulk of the structure, and could deeply affect its mechanics. Since it is not possible to see the individuals inside the opaque, dense aggregation, studies of these aggregations usually rely on observations of the individuals on the surface of the aggregations5,6. Some studies have used two-dimensional x-ray projections of the aggregations2, but this method cannot quantify the distribution of individuals in all three dimensions. To address this gap, we use x-ray computed tomography (CT) to visualize the 3D arrangement of Western honey bees (Apis mellifera) in swarms, calculate how the load is distributed between bees, and use a scaling law to explain the reason for this weight distribution.

A honey bee swarm is a cluster made up of a queen bee and thousands of workers that hangs outside for hours to days while the workers scout for hives7. Swarming is a precarious step in the life of a honey bee colony: if the queen or too many of the worker bees do not make it to their new hive, the entire colony will be lost7. Bees attach to one another to support the weight of the entire swarm and keep the colony cohesive. Hence, the mechanical stability of these swarms plays an important role in the survival of the colony. So far, the arrangement of bees inside swarms and how a swarm’s weight is distributed between bees has been unknown. Previous studies on honey bee swarm structures investigate how the swarm shape changes in response to environmental perturbations. For instance, bees flatten the swarm to keep it stable if its attachment surface shakes5, and respond to changing weather by packing the swarm more densely in the cold and spreading out in the heat6,8,9.

To interpret the spatial distribution of bees measured by the x-ray CT, we hypothesize that a honey bee swarm is a superorganism that can be described with scaling laws, analogous to those that apply to individual organisms in nature. A number of scaling laws that relate the size of individuals to their physical properties have been established in biology10,11,12. These laws are derived from dimensional analysis and can be verified experimentally. For instance, the metabolic rate of animals scales with body mass to the three-fourths (or two-thirds) power10,13, running speed scales with body mass to the one-sixth power14,15, and the strength of weightlifters scales with body mass to the two-thirds power16. Analogously to the relationship between weightlifter body mass and maximum mass lifted, the speed with which ants drag a load is not linearly proportional to the number of ants dragging it17. Just as an animal is an organism made up of cells, a swarm is a superorganism made up of bees, and similar scaling laws could apply to its physical properties. However, we do not know of any scaling laws applying to the arrangement of individuals within collectives in the literature thus far.

In this study, we find a universal scaling law that applies to the arrangement of bees and weight distribution inside both small and large swarms. Regardless of swarm size, the weight supported by each horizontal layer of a swarm scales with the mass of the layer to the $$\approx 1.5$$ power. This weight distribution assures that each swarm layer is using the same percentage of its maximum strength. We describe our methods for taking CT scans of swarms in “Materials and methods”. We show that the weight distribution inside the swarm obeys a power law in “Results”, and present a mathematical model explaining the benefits of the distribution of bees in the swarm scaling with this particular power law in “Scaling law of strength and layer mass”. Finally, we discuss the results and conclude in “Discussion”.

## Materials and methods

In this section, we provide a succinct decription of our methodology, including the honey bee swarms, our experimental setup, and our procedure for obtaining and and analyzing CT scans. See the Supplementary Methods for a more detailed description of the methodology.

### Experimental setup

In our study, each swarm consists of a different number of worker bees (3725–9700 individuals) and a caged queen bee. We collect data from 11 swarms, providing 57 CT scans in total. We set up the swarms in a laboratory lit by ambient indoor lighting at an ambient temperature of 21 $$^\circ$$C. The swarm hangs from an attachment surface, a 33 cm diameter wood disk. The caged queen is fixed to the center of the attachment surface, and the workers gather around her to form a swarm. We measure the mass of the swarms before taking CT scans, and calculate the number of bees in a swarm by dividing the mass of the swarm by the average mass of a bee. We find the average mass of individual bees once for each swarm by freezing a sample of bees and then weighing a sample of 100 bees. The average mass of a bee had a range of 0.10–0.13 g over the different swarm trials.

We set up the swarm between the x-ray emitter and detector of a JPI DynaVue: Digital X-Ray and Fluoroscopy in One System, $$17.7 \pm 0.7$$ cm from the detector. The emitter and detector are fixed 90 cm apart. The schematic in Fig. 1a shows the swarm between the x-ray emitter and detector. We define the x-axis horizontal and parallel to the x-ray detector plane and the y-axis parallel to the x-ray emitter–detector line, so that the attachment surface and the xy-plane are coplanar. We define the z-axis in the direction of gravity, with the origin at the center of the attachment surface where the queen cage is attached. We center the origin of the axes in the field of view of the x-ray detector.

We motorize the swarm with a stepper motor and use a MATLAB script to continuously rotate the stepper motor at 7.2$$^\circ$$/s, and save the motor position and x-ray parameters. The motor completes a full rotation for one CT scan in 25 s. While the motor rotates, we use customized proprietary software by JPI to acquire x-ray projections at 15 frames per second with x-ray parameters 90–95 kV and 20 mA. As a visual illustration, we show a photograph of the swarm hanging in front of the x-ray detector in Fig. 1b, a sample projection of the same swarm in Fig. 1c, and a sample set of projections in Supplementary video V1.

### CT scan processing

To perform the 3D reconstructions, we first find the rotation angle of each projection, measure the length of the side of a voxel and the center coordinate, and subtract a blank background image to reduce noise. We then reconstruct each data set with the Matlab TIGRE toolbox, using the FDK algorithm and Hamming filter18. See SI Section “CT scan processing” for a more detailed description of the following processing and Supplementary Table T1 for a table of all the variables we use in our analysis. Each resulting reconstruction consists of a 3D matrix, $$\tilde{I} (x,y,z)$$, of the brightness values in each voxel.

We set the bounds of the reconstructions to encapsulate the swarm and a small amount of empty space around it (unless the swarm reaches the edge of the field of view of the x-ray). The x-axis is bounded from $$-X/2$$ to X/2 and the y-axis is bound from $$-Y/2$$ to Y/2, as shown in Fig. 1a. The z-axis ranges from 0 to the length of the swarm L, where $$7.7 \le L \le 12.5$$ cm. X and Y are visually defined to encapsulate all non-zero CT brightness values (i.e., the physical shape of each swarm). We label all of the voxels that are encapuslated by the swarm and find its surface boundary as described in SI Section “CT scan processing”.

The raw reconstructions, $$\tilde{I} (x,y,z)$$, have a cupping artifact throughout the swarm, likely from beam hardening19, and noise that is caused by the short current and exposure time used to take the projections. Postproccesing to eliminate these artifacts (see SI Section “CT scan processing” for details) results in a brightness matrix I(xyz) that is linearly correlated to the mass of bees in each voxel. We show three views of a sample reconstruction in Fig. 1d, highlighting the radially symmetric shape of the swarm about the z-axis and the outlines of individual bees.

### Converting brightness to mass and densities

To convert the brightness values I(xyz) into a measure of the mass of bees in each voxel, we use an external measure of the mass of the entire swarm, $$M_{swarm}$$ (see SI Section “Experimental setup” for scale specs). Assuming the brightness, I, is linearly correlated with the density of bees, the following relation provides an estimated mass per voxel:

\begin{aligned} m(x,y,z) = I(x,y,z)\frac{M_{swarm}}{\sum {I(x,y,z)}}. \end{aligned}
(1)

With the mass of each voxel and the boundary of the swarm at hand, we can define the density of bees $$\rho (z)$$ in each layer (a one-voxel thick xy-slice). The length of the side of each voxel is s, and $$N_B(z)$$ is the number of voxels in a layer that are within the swarm boundary. Meausring $$\rho (z)$$ shows how densely packed the bees are from the attachment surface to the swarm tip:

\begin{aligned} \rho (z) = \frac{1}{{s^3 N_B(z)} }\sum _{x_i=-X/2} ^ {X/2} \sum _{y_i=-Y/2} ^ {Y/2} m(x_i,y_i,z_i=z). \end{aligned}
(2)

We also calculate the total area encompassing each layer of the swarm:

\begin{aligned} A(z) = s^2 N_B(z). \end{aligned}
(3)

### Mass and forces per layer

We use the matrix of the mass in each voxel, m(xyz), to analyze the weight distribution within the swarm by measuring the mass of each layer (a one-voxel thick xy-slice) and the weight supported by each layer.

The schematic in Fig. 1e highlights a layer of the swarm. The mass of bees per unit distance in each layer, M(z), is the sum of the mass of each voxel in that layer divided by the thickness of the layer, s:

\begin{aligned} M(z) = \frac{1}{s} \sum _{x_i=-X/2} ^ {X/2} \sum _{y_i=-Y/2} ^ {Y/2} m(x_i,y_i,z_i=z). \end{aligned}
(4)

As in the free body diagram in Fig. 1f, the force that each layer of the swarm exerts upwards is equivalent to the weight that the layer supports. The weight that each layer has to support, consisting of the weight of the bees in that layer and all of the layers underneath it, W(z), is:

\begin{aligned} W(z) = g\sum _{x_i=-X/2} ^ {X/2} \sum _{y_i=-Y/2} ^ {Y/2} \sum _{z_i=z} ^ {L} m(x_i,y_i,z_i). \end{aligned}
(5)

where g is the graviatational acceleration.

We discuss the implications of the trends in M(z) vs W(z) in “Results”. When applying curve fitting, we neglect data for M(z) and W(z) at the top and bottom edge: 1 cm at the top of the swarm, where M(z) has not yet reached its peak, and the few bees in the tip of the swarm, where $$W(z) \le 5$$ g. This allows us to limit our analysis of the weight distribution of the swarm to the trends in the bulk of the swarm and neglect outlying data from edge effects.

Finally, we measure the mean force each bee supports in a layer, $$F_{bee}$$, assuming that each bee in a layer bears an equal fraction of the weight W(z). Since the voxel edge length is smaller than the length of a bee, we obtain the mass of individuals available to support the bees beneath them with a moving sum over the voxels that span the length of an individual bee, $$l = 1.5$$ cm long. We then divide W(z) by the mass of supporting bees:

\begin{aligned} F_{bee}(z) =\frac{1}{g \sum _{z_i = z} ^ {z_i + l} s M(z_i)} W(z) . \end{aligned}
(6)

### Maximum force per bee

We measure the maximum force that a bee can support by tying an elastic band to two bees, getting the bees to hold on to one another, and pulling them apart until they disconnect. We measure the initial length and final length of each elastic band and then use Hooke’s law to measure the force between the bees. See SI, section “Calculation of bee grip strength” for details.

## Results

In this section, we discuss 57 reconstructions of 11 swarms. We show three sample volume renderings of reconstructions of example swarms with small, median, and large masses in Fig. 2a, and a reconstruction rotated to show the base, the tip, and different sides of the swarm in Supplementary video V2. For the rest of this paper we consider the bulk properties of the swarm, leaving the positions of individual bees a subject for future study.

### Weight distribution inside swarms

How do bees distribute themselves throughout the swarm to support its weight? To answer this question, we calculate the mass of bees in each layer of the swarm, M(z), as in Eq. (4) and the weight supported by those layers, W(z), as in Eq. (5). We plot W(z) vs. M(z) on a log-log scale in Fig. 2b for swarms weighing 447–970 g (containing 3725–9700 bees). Despite the varying swarm sizes, the W(z) vs. M(z) curves all fall on a universal line, suggesting that swarms have the same fundamental structure at small and large scales. To further characterize this scaling law, we apply a linear best fit to each curve. The slope of this fit is the exponent a in the power law relating M(z) to W(z):

\begin{aligned} W(z) = C M(z)^a, \end{aligned}
(7)

where $$a = 1.53 \pm 0.12$$ and the constant $$C = 250 \pm 110$$. We plot a for each swarm mass in Fig. 2c and find that there is no trend in a as a function of the swarm mass, further supporting that weight distribution does not depend on the swarm mass.

Figure 2b shows that layers with the largest M(z) support the largest swarm weight W(z) (with $$W(z) = g M_{swarm}$$ at $$z = 0$$, where the top layer is supporting the entire swarm). Correspondingly, the three sample reconstructions in Fig. 2a and the plot of the area of each layer in Fig. 2e show that the area of swarm layers near the attachment surface is greater than the area of the layers near the tip of the swarm. To quantify the effect of packing density on layer mass, we plot the density of each layer of the swarm vs. z-coordinate for all 57 reconstructions using Eq. (2) in Fig. 2d. The bees are most densely packed at the top of the swarm, and the density decreases towards the tip of the swarm, confirming that most of the bees are found near the base of the swarm.

To quantify the arrangement of swarm layers from the attachment surface to the tip of the swarm, resulting in the power law described in Eq. (7), we plot M(z) vs. z in Fig. 3a. M(z) is high near the attachment surface, $$z \le 2$$ cm, and then decreases with z toward the tip of the swarm. This is visible in x-ray projections of the swarm, such as the one in Fig. 1c. A darker shade of gray represents more bees in a horizontal layer between the x-ray emitter and x-ray detector, and white represents no bees. In this projection, there is a wide layer of darker gray representing a larger mass of bees per horizontal layer near the attachment surface, followed by narrower layers of lighter gray representing fewer bees per horizontal layer towards the swarm tip. The large mass of bees in the topmost layer creates a stable support structure for the bulk of the swarm, distributing the load between the bees.

How does this arrangement affect the forces experienced by individual bees in the swarm? If the weight supported by an individual bee is close to its limit, that bee will be more likely to break its bond when the swarm is mechanically perturbed. To investigate how much weight individual bees support, we calculate the mean force supported by a bee in a layer, $$F_{bee}(z)$$, as in Eq. (6). We plot $$F_{bee}$$ vs. z in Fig. 3b and find that each bee supports a maximum of 3.8 bee weights. The weight supported per bee decreases from attachment board to swarm tip. Our experiments with pairs of bees show that one bee can support a maximum weight of $$35 \pm 14$$ bees (see SI section “Calculation of bee grip strength”). Hence, the bees bearing the weight of the swarm are not at their strength limit.

## Scaling law of strength and layer mass

Our experimental data reveals a scaling law between the mass of a layer along the vertical coordinate, M(z), and the weight that it supports, W(z), namely: $$W(z) \sim M(z)^a$$ with $$a \approx 1.5$$. To better understand the physical mechanism that yields this scaling law, we derive the force balance equation of a layer of the swarm and solve for W(z). We then equate the analytical expression for W(z) with the experimentally determined scaling law, $$W(z) \sim M(z)^a$$, to connect the swarm mass distribution to the exponent a and formulate the expressions for M(z) and W(z) in terms of a. We then consider a dimensional analysis of the strength of each layer of the swarm, S, or the maximum weight that it can support before the grip of the bees on one another breaks. As will be described in detail below, we find that $$S \sim M^{1.5}$$, which is close to the experimentally determined $$a = 1.53$$. Deviation from this value increases the fraction of maximum strength exerted by different parts of the swarm.

### Force balance model of the weight distribution in the swarm

We assume that the swarm is at quasi-equilibrium (the shape does not change although individual bees may move), that all of the bees in each layer contribute equally to supporting the weight of the bees underneath that layer, that the layer thickness is very small, and that the swarm is radially symmetrical about the z-axis. We use a cylindrical coordinate system with a vertical coordinate z, as shown in Fig. 1e, and we consider layers of the swarm along the z-axis of thickness dz. Variables labeled with a tilde, as in $$\tilde{W}(z)$$, represent analytically derived expressions; variables without a tilde, as in W(z), represent values determined with power law fits to experimental data.

We begin our analysis by applying the force balance principle to each layer of a swarm. As shown by the free body diagram in Fig. 1f, the force with which each layer of bees has to grasp the layer above it is equal to the weight of that layer and all of the layers underneath it: $$\tilde{F} = \tilde{W}(z)$$. We express $$\tilde{W}(z)$$ using the force balance equation (a continuous version of the discrete definition in Eq. (5).):

\begin{aligned} \tilde{W}(z) = g \int _z^L \tilde{M}(z) dz, \end{aligned}
(8)

where the mass of bees per layer is $$\tilde{M}(z)$$, the swarm length is L, and g is the gravitational constant. Inspired by our experimental observation that the mass of the layers near the base is highest and the mass of the layers at the tip of the swarm is lowest in Fig. 3a, we model $$\tilde{M}(z)$$ as a monotonically decreasing function of z. To keep the units consistent, we normalize the z coordiante by the length of the swarm:

\begin{aligned} \tilde{M}(z) = c \left( 1-\frac{z}{L}\right) ^{\tilde{b}}, \end{aligned}
(9)

where the c factor in this expression ensures that the units of the mass per layer are mass/length, and $$\tilde{b}$$ is an unknown exponent. Choosing this function form allows us to easily integrate the expression for $$\tilde{W}(z)$$ when we substitute $$\tilde{M}(z)$$ into it, set this force balance derivation for $$\tilde{W}(z)$$ equal to the experimentally determined expression $$W(z) = C M(z)^a$$, and compare the exponents a and $$\tilde{b}$$.

To solve the expression for $$\tilde{W}(z)$$, we substitute the expression for $$\tilde{M}(z)$$, Eq. (9), into Eq. (8) and integrate. We then express $$\tilde{b}$$ in terms of the experimentally determined a by equating this expression for $$\tilde{W}(z)$$ to the scaling law we observe in our experiments, Eq. (7), $$W(z) = C \tilde{M}(z)^a$$. The exponent in the expression for $$\tilde{M(z)}$$, Eq. (9), is

\begin{aligned} \tilde{b} = \frac{1}{a-1}. \end{aligned}
(10)

The weight supported by each layer is then:

\begin{aligned} \tilde{W}(z) = cLg \left( 1 - \frac{1}{a}\right) \left( 1-\frac{z}{L}\right) ^{\frac{a}{a-1}}. \end{aligned}
(11)

Next, we test how well our force balance model predicts the data by comparing the predicted value of $$\tilde{b}$$ using the force balance to the value of b calculated using experimental fits. We first separate the expression for the layer mass, Eq. (9) into the product of the layer area, $$\tilde{A}(z)$$ and the layer density, $$\tilde{\rho }(z)$$:

\begin{aligned} \tilde{M}(z) \sim \tilde{A}(z) \tilde{\rho }(z). \end{aligned}
(12)

To simplify our analysis, we model $$\tilde{A}(z)$$ and $$\tilde{\rho }(z)$$ with a similar monotonically decreasing function to that in Eq. (9):

\begin{aligned} \tilde{A}(z) = c_1 \left( 1-\frac{z}{L}\right) ^{\tilde{b}_1}, \end{aligned}
(13)

and

\begin{aligned} \tilde{\rho }(z) =c_2 \left( 1-\frac{z}{L}\right) ^{\tilde{b}_2} \end{aligned}
(14)

we can then separately measure the effect of the changes in area and density on the exponent in the mass per layer expression in Eq. (9), $$\tilde{b} = \tilde{b}_1 + \tilde{b}_2$$.

We first calculate $$\tilde{b}$$ using the expression derived from the force balance, Eq. (10), and our experimental result for a, which yields $$\tilde{b} = 2 \pm 0.47$$. Second, we calculate b by separately calculating power law fits to the data for A(z) in Fig. 2e according to Eq. (13) and $$\rho (z)$$ in Fig. 2d according to Eq. (14), which yields $$b_1 = 1.38 \pm 0.2$$ and $$b_2 = 0.51 \pm 0.09$$. Thus, $$b = b_1 + b_2 = 1.89 \pm 0.25$$. See Supplementary Fig. S5(a–c) for log-log plots of M(z), A(z) and $$\rho (z)$$, and Supplementary Fig. S5(d–f) for plots of the resulting b, $$b_1$$, and $$b_2$$.

We calculate the deviation of $$\tilde{b}$$ from b, $$\frac{\tilde{b} - b}{\tilde{b}} = 0.03 \pm 0.11$$, and plot the deviation of b from $$\tilde{b}$$ in Supplementary Fig. S5(g) as a comparison for the individual CT scans. The values of b and $$\tilde{b}$$ being on the same order of magnitude validates the model and allows us to compare $$\tilde{W}(z)$$ to a maximum strength of each layer, which we find with dimensional analysis in the following section.

### Strength of a swarm layer and individual bees

The strength of the layer, $$\tilde{S}(z)$$, or the maximum weight that it could support, can be greater than or equal to $$\tilde{W}(z)$$: $$\tilde{S}(z) \ge \tilde{W}(z)$$. If the weight of the bees underneath a layer were to exceed its strength $$\tilde{S}(z)$$, the layer would not be able to support the weight of those bees, and the swarm would break apart. We perform a dimensional analysis on the strength of each layer to find the relationship between the mass of a layer and its maximum strength, $$\tilde{S}(z) \sim \tilde{M}(z)^{\alpha }$$. Force is proportional to mass, which is proprtional to volume, or a length cubed, so a layer’s strength scales with length cubed, $$\tilde{S}(z) \propto L^3$$. The mass of each layer, with units of mass/length, is proportional to an area, or a length squared, so $$\tilde{M}(z)$$ scales with length squared, $$\tilde{M}(z) \propto L^2$$. Thus, $$\alpha$$ must be 1.5 for $$\tilde{S}(z) \sim \tilde{M}(z)^{\alpha }$$ to be dimensionally correct. This is similar to the relationship between weightifting capacity and body weight in Ref.16.

Estimating $$\tilde{W}(z)/\tilde{S}(z)$$ gives a measure of how much of its maximum strength each layer uses to hold up the rest of the swarm:

\begin{aligned} \frac{\tilde{W}(z)}{\tilde{S}(z)} \sim \left( 1-\frac{1}{a}\right) \left( 1-\frac{z}{L}\right) ^\frac{2a-3}{2a-2} \end{aligned}
(15)

The average number of bees that a bee in a swarm layer supports, $$\tilde{F}_{bee}(z)$$, is equal to the mass of bees supported by a layer divided by the sum of the mass of bees in a layer of bees that has the thickness of the length of a bee, $$l \approx 1.5$$, as a continuous version of the discrete equation in Eq. (6):

\begin{aligned} \tilde{F}_{bee}(z) =\frac{\int _z^L \tilde{M}(z) dz}{\int _z^{z+l} \tilde{M}(z) dz}. \end{aligned}
(16)

After integrating, we get an expression for $$\tilde{F}_{bee} (z)$$:

\begin{aligned} \tilde{F}_{bee}(z)= \frac{\left( 1-\frac{z}{L}\right) ^{\frac{a}{a-1}}}{\left( 1-\frac{z}{L}\right) ^{\frac{a}{a-1}} - \left( 1-\frac{z + l}{L}\right) ^{\frac{a}{a-1}}}. \end{aligned}
(17)

We use the expression for $$\frac{\tilde{W}(z)}{\tilde{S}(z)}$$, Eq. (15), and $$\tilde{F}_{bee}(z)$$, Eq. (17), in the next section to evaluate how the force distribution in the swarm would change for swarms with different values of a.

### Effect of a on the mass of each layer, the fraction of its maximum stregnth it uses, and the average force per bee

We now consider the effect of varying a on the mass and force distribution inside the swarm. To visualize the effect of a on the distribution of bees, we plot the mass per layer of a 1000-g, 12.5 cm long swarm, $$\tilde{M}(z)$$ vs. z/L, with $$a = 1.5, 1.01, 1000$$, and $$-0.2$$ in Fig. 3c and the corresponding average force per bee, $$F_{bee}(z)$$ vs. z/L in Fig. 3d. These values of a are example values for the four possible cases of mass distribution in the swarm. We then evaluate how these values of a affect the fraction of maximum strength each layer uses to support the layers underneath it using Eq. (15).

If $$a \approx \alpha$$, as we found in our experiments, layers with higher mass near the attachment surface support the less massive layers under them, as in the solid black line in Fig. 3c. Correspondingly, Fig. 3d shows $$\tilde{F}_{bee}(z=0) \approx 3$$ at the top of the swarm, and decreases towards the tip. The strength of each layer and the weight it supports are proportional to one another, $$\tilde{W}(z)/\tilde{S}(z) \sim 1/3$$, meaning that the fraction of maximum strength used by a layer is the same for all z. If $$1< a < \alpha$$, the swarm approaches one massive layer of bees, as in the dashed purple line in Fig. 3c. The dimensional analysis results in a very small fraction of the total strength used by this layer, $$\tilde{W}(z)/\tilde{S}(z) \rightarrow 0 (1-\frac{z}{L})^{-\infty }$$. The force supported by each bee in Fig. 3d shows $$\tilde{F}_{bee}(z) = 1$$ for the entire swarm, meaning that each bee only supports its own weight. This configuration would either require packing a large number of bees into one very dense or one very wide layer. A swarm with one very dense layer at the top would compress all of the bees; a swarm with one very wide layer would require a large surface area, which would put the swarm in danger from predators and changes in weather. Thus, despite a potentially lower fraction of strength used by the largest layer of bees, this configuration would put the swarm in danger by requiring a large surface area.

For values of $$a > \alpha$$, as $$a \rightarrow \infty$$, all the layers of the swarm have the same mass, as in the dash-dot red line in Fig. 3c. The force per bee in Fig. 3d shows $$\tilde{F}_{bee}(z=0) \approx 8$$ at the top of the swarm, 2.5 times that of the $$a = \alpha$$ configuration. In this configuration, the top layers use a higher percentage of their available strength than the lower layers, $$\tilde{W}(z)/\tilde{S}(z) \rightarrow (1-\frac{z}{L})$$. Thus, for large swarms, the bees that support the swarm would be under more strain, and the swarm would be more likely to break under external perturbation.

Finally, $$a < 0$$ ($$0 \le a \le 1$$ results in negative values for $$\tilde{W}(z)$$) would suggest that the top layers of the swarm have a lower mass than the bottom layers, as in the dotted orange line in Fig. 3c. This is not a realistic range of values for a, but we include it here as a demonstration of a potential mass distribution with the largest layers being on the bottom of the swarm. This configuration would put even more strain on the layers of bees at the top of the swarm, as smaller layers near the attachment surface have a smaller maximum strength. As $$a \rightarrow 0$$ on the $$a < 0$$ side, $$\tilde{W}(z)/\tilde{S}(z) \rightarrow \infty (1-z/L)^{1.5}$$, and bees in the top layers use a much greater fraction of their strength than bees in the bottom layers. Accordingly, the mean force per bee in Fig. 3d exceeds the maximum bee grip strength of 35 bee weights, and the swarm could not support itself in this configuration.

The swarm configuration with $$a \approx 1.5$$ uses the full strength of each layer and puts a lower strain on the bees than most other values of a, and avoids weight distributions that could expose a large number of bees to external danger.

## Discussion

In this study, we obtained x-ray CT scans of western honey bee swarms and analyzed trends in the bulk distribution of bees. We find that, regardless of swarm size, bees are arranged such that the weight supported by each layer scales as the mass of the layer to the $$\approx 1.5$$ power. This supports our hypothesis that scaling laws can be used to describe a superorganism such as a honey bee swarm, analogously to past descriptions of individual animals and plants in the past10. Examples of scaling laws which have previously been used to understand collective behavior in groups of animals include studies relating the number of ants pulling an object to the speed of that object17,20, spatial and temporal correlation of motion in insect swarms21, and size of fish groups over time22,23. Our scaling law relating the mass of layers to the weight they support is unusual in that, rather than relating the strength of a swarm to the number of individuals within the swarm, it relates the force distribution within the swarm to the arrangement of individuals inside it. Regardless of the number of individuals in the swarm, the same scaling law can describe its structure.

We found that bees are arranged to distribute the weight between each other without overloading individual bees, which can leave some bees free to scout for new hive locations. We primarily consider the bulk properties of the swarm. X-ray CT data provides a 3D image of all of the bees inside the swarm, and there is a wealth of untapped data in our scans regarding how the bees are distributed within the layers. Our preliminary analysis of the internal structure of the swarm suggests that bees form a “scaffold” inside the swarm that leaves other bees free to move within the swarm and scout for new hives, as shown in the slices in Supplementary Fig. S4 and Supplementary videos V3 and V4. Our future studies will investigate how bees might use this internal scaffolding to navigate throughout the swarm. X-ray CT may also yield additional insights as to how the structure of the swarm changes under perturbations to improve stability, as in Ref.5. Experiments combining macroscopic CT scans to visualize overall swarm structure with micro-CT to visualize the leg–leg bonds between individual bees can help determine the local rules governing honey bee behavior and division of labor as a swarm forms and maintains a stable shape.

We focused this study on swarms at an ambient room temperature. Different ambient temperatures might result in swarms deviating from $$a \approx 1.5$$ to adjust the swarm configuration for thermoregulation. Heinrich proposed an internal structure for swarms in cold or hot ambient environments9: homogenously packed bees within a dense shell in cold weather to generate heat, and air channels within the swarm for ventilation at hot temperatures. However, measurements of the shape change of the swarm in response to heating and cooling show that the swarm’s shape does not always directly correlate with temperature8. X-ray CT provides an opportunity to see inside swarms in varying environmental conditions and investigate how the arrangement of bees changes to maintain a comfortable core temperature. Shape change in response to environmental conditions may also result in a tradeoff between stability and thermoregulation, such as rearrangements that minimize surface area to keep heat inside the swarm or decrease the packing density to ventillate heat into the environment, with a different value for a.

There are some questions remaining regarding the analysis of CT scans. The calibration of brightness in our CT images to mass per voxel has potential for improvement. In this study, due to artifacts in the raw reconstructions and inconsistent quality between reconstructions, we had to normalize each scan such that all stationary bees have approximately the same brightness. An experimentally-determined correlation with brightness and location in the swarm as inputs and mass in a voxel as an output would be time-consuming to create but would give more precise results. Additionally, we do not include the variation in distribution of mass between bees throughout the swarm, or that moving bees likely do not support the mass of the swarm, in our analysis. The power law model for the density and area of each layer is also an imperfect fit; however, we use these models primarily to explain the reason for the $$a \approx 1.5$$ result, and they are not intended to be a full description of the swarm structure. A more thorough investigation of which bees form a supporting structure, and how other bees are connected to them, could yield additional insight into the mass distribution.

The insight gained from this study on how honey bee swarms support their weight is both a fascinating addition to our understanding of the process by which honey bee colonies reproduce, and can also serve as a starting point for bioinspired engineering applications24. A swarm can be thought of as a living material that can adjust to environmental conditions and repair itself when damanged. Engineering materials that similarly respond to their environment and self-heal might have applications in medicine, building and aircraft design, and smart sensors25,26. Biological swarms can provide design inspiration for novel robotic swarms27. For instance, collectives of insect scale robots28,29 hanging30 from a building as they repair part of it may be inspired by the arrangement of bees in the swarm, ensuring that their assembly is stable. These practical applications in combination with quantitative ethological studies of the collective intelligence of these social insects could inform future studies of honey bee swarms.