Task allocation in a cooperative society: specialized castes or age-dependent switching among ant workers

Some ant species have multiple worker castes that differ in body size; workers in one caste remain in the colony and those in the other forage outside the colony (caste polyethism). In other species, all workers engage in both tasks, but the younger workers remain in the colony and the older workers forage (age polyethism). Here, we ask which of these two is the most efficient for colony level performance when foragers suffer a higher daily mortality than workers in the colony and when the optimal worker size differs between two tasks. We studied two models: in the stationary colony model, the colony size and composition remain constant, and the amount of excess resources that can be used for producing reproductive individuals is maximized; in the growing colony model, all of the resources obtained are used for producing new workers, and the rate of the colony growth is maximized. In both models, we observed similar results: caste polyethism is more advantageous than age polyethism if the difference in mortality between the two tasks is small and the difference in the optimal size is large. In the opposite situation, the age polyethism is more advantageous.

In this paper, we study the condition in which caste polyethism or age polyethism is more efficient than the other in terms of colony performance. We investigate two different models handling different phases of colony growth.
In the first model, we consider a stationary colony in which the colony size and the composition do not change with time. The colony produces new workers to maintain the colony and replenish the mortality loss of workers; however, it also produces reproductive individuals (males and new queens) out of the resources obtained by the workers, minus the investment for replenishing workers. Natural selection would produce the polyethism pattern that achieves the largest excess of resources that can be used for producing reproductive individuals.
To consider a stationary colony, we set the following assumptions: the amount of resources usable for new worker production is a given constant; the number and size of workers can be chosen by the colony as their strategy under this resource constraint; workers have a fixed maximum age (a ) max ; workers engage in two different tasks (working in the colony [taking care of eggs and larvae and cleaning the colony] and foraging outside the colony); as foraging is accompanied by danger caused by predators, parasites, and physical accidents, foragers suffer a higher daily mortality than workers in the colony.
We first analyze a case in which two castes existed: one that specializes in the work in the colony and one that specializes in foraging (caste polyethism). They may differ in body size. The number of new workers and the body sizes of the two castes can be chosen to maximize the reproductive output of the colony, given the limitation of the total amount of resources usable for worker production per day. Next, we study a case in which all the workers are of the same size and perform both tasks according to their age: younger workers remain in the colony, while older workers engage in foraging (age polyethism). Here the body size and the age for switching between the two tasks are chosen optimally. Finally, we compare the colony of workers of the same size performing both tasks (age polyethism) and the colony of workers specialized for different tasks (caste polyethism); we discuss the condition in which one is more productive than the other.
In contrast, in the second model, we consider a growing colony. The colony is in an early phase of colony growth, where no new reproductive individuals (males and new queens) appear, and continues to grow by producing new workers using all of the resources obtained by their labor. The colony will produce reproductive individuals much later when the colony size reaches sufficiently large numbers. In the growing colony model, we measure the performance of the colony by their growth rate. We consider a situation in which the work efficiency of each worker and their mortality may depend on their body size or their activities, but are independent of the colony size. From this assumption, the colony will begin to grow exponentially; we are able to use the exponential rate of colony growth as the criterion to evaluate the performance of different polyethism patterns.

Models and Results
Stationary colony model. Here, we study the stationary colony model, which is easier to analyze mathematically than the growing colony model. We consider the simplest possible model in which the colony is in a stationary state, with a constant age structure of workers.
Body size and number of specialized workers. The ant workers are adults, and their body sizes do not change once they emerge from the pupal stage. Their body size is determined by the amount of resources supplied in the growing period. Two phenotypes exist: workers specialized for work in the colony (body size x 1 and number produced per day n 1 ) and workers specialized for foraging outside the colony (body size x 2 and number produced per day n 2 ). Note that n 1 and n 2 are the daily influx of workers, and they replenish the loss of workers due to daily mortality to maintain the same composition. For simplicity, we assume that the cost of producing a worker is proportional to the body size. In this paper, we term x 1 and x 2 as the body size of workers in the two castes, but to be more accurate, they indicate the costs for producing workers in the two different castes.
The total amount of work within a colony is given by the summed number of workers of different ages, which decreases with age owing to mortality (Fig. 1a). The workers specialized for the work in the colony suffer daily mortality u, and their age structure is − n ua exp[ ] 1 for < < a a 0 max . Each day, a surviving worker of this type performs a task of amount S x ( ) 1 1 . Here, we assume that it is a sigmoid function of body size x 1 , which is an assumption commonly adopted when discussing optimal egg size 13 . This indicates that a very small worker cannot perform well; however, beyond a certain size, the performance rapidly increases with body size, followed by performance saturation for large sizes (See Fig. 2). Hence, the total amount of tasks performed by these specialized workers in the colony is as follows: u max 1 1 . C 1 implies the effective number of days for a newly emerged worker to contribute to the colony until its death (by either daily mortality or maximum age).
Similarly, the age structure of workers specialized for foraging is max . Foraging is accompanied by a higher daily mortality than is working in the colony, and we denote the excess mortality by v. Let S x ( ) 2 2 be the foraging performance per day by a surviving worker. The total foraging performance of the entire colony per day is the product of the per capita foraging performance S x ( ) 2 2 and the number of workers of age a integrated from 0 to a max , and is given as follows: Here, we discuss the performance of producing ants of the whole colony. This requires both the work within the colony and the work out of the colony. The abundance of one task (say working within the colony) cannot compensate for the shortage of the other task (foraging) and vice versa. The performance of the entire colony should be limited by the performance of the most limited task between the two (Liebig's law of the minimum 14,15 ). We denote the work performance in the colony by I and that of foraging by F. Additionally, we adopt the following simple assumption: Note that, by scaling task performance functions S x ( ) 1 and S x ( ) 2 appropriately, we can always make the most efficient use of labor is achieved when the total performance of two tasks are equal: = I F. Wakano et al. 8 adopted equation (2) for the performance of the colony. They studied the situation in which I and F are multiplied by stochastically changing coefficients, because they are considering the effect of environmental fluctuation, which we do not consider in this paper. In the equation above, B is the amount of resources for producing new workers and new reproductive individuals (such as new queens and males). Let R be the fixed amount of resources to be used for producing new workers per day. Because the success of the colony is the production of reproductive individuals, we can use − B R as a criterion to measure the performance of the entire colony. Here, we treat R as a fixed constant, and we regard B as the quantity to maximize in the following argument.
We search for a combination of n 1 , x 1 , n 2 , and x 2 that achieves the maximum B in equation (2) under the following resource constraint: www.nature.com/scientificreports www.nature.com/scientificreports/ where R is a constant given as a parameter of the model. In SI Appendix A, we provide the analysis of this optimization problem. The results show that the optimal sizes of the two workers x 1 and x 2 can be obtained from the following formulas: These equations are the same as the optimal solutions in the model of the optimal number and size of eggs 13 . As illustrated in Fig. 2, the optimal body size x 1 is the value of the tangential point obtained from drawing a line passing through the origin to the curve of function S x ( ) 1 1 . Similarly, the optimal size of foraging workers x 2 can be obtained by drawing a line passing through the origin to the curve of function S x ( ) 2 2 . This implies that the body size of each caste is determined by the graph of the task performance as a function of body size for each task. Different tasks may require different body sizes, as represented by the difference between S x ( ) 1 and S x ( ) 2 . Consider the case in which a worker of a smaller body size is sufficiently efficient in work within the colony; therefore, the optimal size for the caste specialized for working inside the colony is small (in terms of the cost for producing one worker). By contrast, if efficient foraging requires a larger worker, the optimal size for the foraging ant caste becomes larger.
In Fig. 2, we adopted For these functions, the optimal sizes in equation (4) are . The numbers of workers produced per day for the two castes are determined as follows: The derivation of these results is provided in SI Appendix A. The amount of resources used for the small workers is n x 1 1 per day and that for the large workers is n x 2 2 per day. Equations (5a) and (5b) indicate that the amount of resources available for new worker production per day, R, is split between the small workers and large workers at a ratio of x S x C ( ) can be interpreted as the efficiency of investment in the production of workers of type i measured by the daily amount of task i to be performed per unit resource investment. C i is the expected number of days that a worker lives. Hence, equation (5) implies that the amount of resources to be used in the optimal colony strategy is to be invested in a manner inversely proportional to the task-performing efficiency. More resources should be allocated to the task with the lower efficiency. For example, in a habitat with abundant food availability, a smaller fraction of resources should be allocated to forager production than in an environment with scarce food resources.
When workers perform both tasks in an age-dependent manner. We now consider a colony that consists of workers of the same size x 3 , which performs both tasks depending on age. As illustrated in Fig. 1b, they engage in work in the colony before switching age a s and in foraging outside the colony after a s . The shaded and dotted areas are individuals working in the colony and foraging outside of the colony, respectively. Foraging is accompanied by a higher daily mortality than working in the colony. Let n 3 be the number of newly emerging workers per day. If they switched tasks based on age, the younger workers would engage in tasks with smaller daily mortality, while the older workers would perform tasks with larger daily mortality. This is optimal for the entire colony. Because the older workers have a shorter time remaining until the maximum age a max than the younger workers, the risk of higher mortality would be less important than in the younger workers, as the latter have more days before reaching a max . This pattern has been observed in many species 1,7 , and was confirmed by computer simulations of colony growth 8 . Therefore, we assume this pattern in our study. We chose the switching age a s to be the optimal age to attain the maximum colony performance. Furthermore, we optimized the size x 3 and the number of workers n 3 to be produced per day. The total amount of work within the colony and that of foraging are as follows: Each implies the effective number of days to contribute to the colony through the respective task to be made by a newly emerged worker. The objective function is, again, the colony performance given by equation (2), which is maximized under the resource constraint: = R n x 3 3 . According to the analysis in SI Appendix B, the optimal solutions of a s and x 3 satisfy the following: We also have , indicating that the total amount of work within the colony and that of foraging outside the colony must be balanced in the optimal use of labor ( = I F). Using these two equations, we can solve the optimal solution numerically (i.e., the age of switching a s and the size x 3 ). The optimal number of eggs is then calculated as = n R x / 3 3 . To determine the behavior of the model, we specify a task-performance function as follows: According to the analysis in SI Appendix B, we can determine the optimal worker size x 3 and the optimal age of switching a s which satisfy equations (7) and (8), using these particular forms of task performance functions. When workers engage in both tasks in an age-dependent manner, the optimal worker size x 3 lies between β 1 and β 2 , which are the optimal sizes for specialized workers (see equations (B.7a) and (B.7b)).
Competition between specialized castes and age-dependent switching. We now consider the competition between a type with caste polyethism and another type with age polyethism. The worker sizes and numbers are chosen to maximize the colony performance, as described in the previous two sections.
We start with the case in which the performance-size relationships for two tasks, S x ( ) 1 and S x ( ) 2 , are equal. Therefore, the optimal body size is the same for both tasks. A curve, labeled as A in Fig. 3a, illustrates the colony output of the case with age polyethism, with the number of new workers n 3 and switching age a s chosen as the optimal values, given the constraint = I F, the latter being from the need that I and F must be equal to realize the optimal. The curve labeled as C is the result of optimal caste polyethism, with n 1 and n 2 chosen to maximize the colony performance B, given by equation (2). The horizontal axis is v, which represents the additional daily mortality for foraging. The mortality of workers working within the colony is fixed as = .
u 0 1. As v increases, the colony performance declines but that of age polyethism is always greater than that of caste polyethism. We also calculated a curve, labeled as R, which indicates the performance of "reverse age polyethism", in which foraging (the activity with a higher mortality) is first performed and then ants switch to work in the colony (the activity with a lower mortality) later in life. The performance is always worse than that of age polyethism with the correct order. Note that if we multiply the same factor to all the rate constants in the model, the qualitative behavior of the model remains the same. What controls the relative advantage of different polyethism in Fig. 3 is the ratio between mortalities v u / . ). (b) The optimal size for foraging is larger than that for the in-colony work (β = . 1 0 1 , β = . www.nature.com/scientificreports www.nature.com/scientificreports/ Figure 3b illustrates the case in which the optimal body size differs between two tasks. Two curves, labeled as C and A, cross each other. For a small v, caste polyethism generates a greater performance than age polyethism. However, for a large v, age polyethism performs better than caste polyethism. Figure 3c illustrates the case in which the optimal body size differs significantly between two tasks; the optimal size for foraging is five times larger than that for working within the colony. Caste polyethism performs better than age polyethism for all values of v shown in the figure. Figure 4a illustrates the relative success of the caste specialization over age-dependent task switching in a contour map. The horizontal and vertical axes represent the additional mortality due to foraging v and the ratio of two optimal sizes β β / 2 1 , respectively. The contour map shows that caste polyethism is more advantageous when β 1 and β 2 differ more strongly and when the additional mortality v is small; while age polyethism is more advantageous in the opposite situation. Figure 4b illustrates the optimal worker sizes. The horizontal axis represents the ratio of two optimal sizes. If β β / 2 1 is small, all workers are of the same size x 3 ; however, if β β / 2 1 is large, dimorphic workers are produced with sizes x 1 and x 2 . We can see the transition from single-sized workers (with age-dependent switching of tasks) to the two castes differing in body size.
Effect of maximum worker age. The advantage of age polyethism (i.e., performing foraging after the work in the colony) is caused by the existence of the maximum age of workers. This effect diminishes as the maximum age becomes larger. Figure 5 illustrates that, when the maximum age of the workers is very large and only a negligible portion of the workers can reach the maximum age, performing foraging after working in the colony becomes similar in terms of colony performance to performing foraging before working in the colony.
Growing colony model. We previously focused on the situation of a stationary population. However, in the early stage of colony development, we should consider the optimal polyethism in the colonies that grow exponentially with time. In these colonies, all of the resources obtained should be allocated to produce new workers  www.nature.com/scientificreports www.nature.com/scientificreports/ instead of reproductive individuals. We assume that the production of new workers is limited by the performance of labor by current workers, but not by the egg production capacity of queen(s). Then we replace equation (2) with = R I F min [ , ], which implies that the amount of resources usable for new worker production is equal to the resources obtained by the colony per day. All of the variables become functions of time t.
We here assume that the model does not contain density-dependent processes, Then, starting from any initial distribution, the population eventually begins to grow exponentially, in which all of the age classes increase by a factor of e rt , in which r is the Malthusian parameter, or the dominant eigenvalue in a dynamics model. The rate of exponential growth is the criterion for colony performance. We search for the optimal task allocation strategy that achieves the maximum value of r. This logic was proven by Taylor et al. 16 and Leon 17 in the context of life history evolution. We provide an analysis for the optimal polyethism in SI Appendix C.
Quantitatively, the results are the same as those of the model for stationary populations explained in earlier sections. For example, if the colony consists of two castes specialized for working in the colony and foraging outside the colony, the worker sizes should evolve according to equations (4a) and (4b): exactly the same sizes as those for the stationary colony. Next, the ratio of resource amounts to be allocated to the two castes is inversely proportional to the task-performing efficiency per unit investment; however, the quantities C 1 and C 2 representing the effective number of days to survive include the time-discounting effect with rate r (see SI Appendix C for details). Equations similar to equations (5a) and (5b) hold, but R must be replaced by the supply of resources available for the production of workers, and the ratio must be modified considering the time-discounting factor-a task performed in the future is less effective than the same task performed in the present in an exponentially growing population. A similar modification occurs in a single phenotype with task switching based on age (see SI Appendix C).

Discussion
Specializing in one task could improve the skill, and thus the task performance might be improved compared to that when combining two tasks. The role of behavioral specialization has been emphasized in papers on the adaptive significance of age polyethism versus caste polyethism 11,12 . Morphological difference should give an even clearer reason for the advantages of specialization compared to behavioral specialization. In this paper, we focus on the body size of the workers. Even if both tasks can be performed better by a worker with a large body, the relative advantage considering the resources needed to produce a new worker may differ between the two tasks, and the optimal size should be determined as that at the tangential points of the S x ( )-graph and a line passing through the origin, or the one that maximizes S x x ( )/ . This may differ between tasks. For example, in a given species, foraging might require the optimal worker size to be larger than the within-colony worker size. However, for age-dependent task switching, the species is constrained to produce workers of a size that is the intermediate between the two optima, which is too small for a forager but too large for a within-colony worker. The advantage of caste polyethism is that the optimal body sizes for both tasks can be achieved. However, this cannot be achieved for workers of a single type that perform both tasks. They must choose one body size, thus compromising the requirements of the different tasks.
When multiple castes specializing in different tasks exist, the optimal ratio depends on the efficiency of the task performance. The optimal resource allocation to each caste is inversely proportional to the efficiency, implying that more foragers should be produced when the food availability in the environment is low than when it is high. However, the availability of food items is likely to fluctuate.
Here, we investigate the relative advantage of colonies containing workers of two different sizes and those containing workers of a single phenotype that perform both roles. Concerning the body size, the former is more efficient than the latter in the use of limited resources for worker production, because the workers engaging in each task have the optimal size for the respective task, while the latter must employ an intermediate body size that is too small for one task but too large for the other. In contrast, the latter is favored by the differential daily mortality of the two tasks, because performing the task with a higher daily mortality after the one with a lower mortality is more efficient. The relative advantage of the two is determined by the relative magnitude of the two processes. Interestingly, a very similar situation is observed concerning the larval size of a marine organism 18 . Parasitic (rhizocephalan) barnacles include species in which the larval sex is determined by the mother, as male larvae are larger than female larvae. Other species of parasitic barnacles have monomorphic larvae that can become either male or female depending on the condition of the host in which they settle (environmental sex determination). The former is advantageous because male and female larvae have sizes that are optimal for their respective tasks. In contrast, being able to adjust the sex after encountering a host is advantageous because each larva has a higher chance of encountering an acceptable host. The relative advantage of the two should be determined by the importance of the two processes 18 .
In this paper, we analyzed the most efficient polyethism both in a stationary colony and in a growing colony. In a stationary colony, the resource gain, minus the investment for maintaining the colony size, would be used for producing reproductive individuals, and hence we adopted the excess gain of resources as the criterion for the performance of different models of polyethism.
In contrast, in a growing colony, no reproductive individuals are produced. All of the resources gained from the labor of the workers are invested to produce new workers, without producing reproductive individuals. The size of the colony increases, and the rate of colony growth is adopted as a measure of the adaptiveness of different polyethisms. Since we considered the case in which the survivorship, task-performance, and other properties of workers are independent of the colony size, the colony would begin growing exponentially, with a constant proportion of workers within the colony. The situation is mathematically equivalent to the basic model of demographic dynamics. Then, we searched for the optimal polyethism that achieves the maximum rate of exponential growth of the worker population.
www.nature.com/scientificreports www.nature.com/scientificreports/ In a growing colony, we examined the case of two castes with different body size (caste polyethism), where we chose the body sizes and number produced per unit time of the two castes as the values that achieve the maximum rate of colony growth. We also examined the case of a single caste with workers switching their task based on age (age polyethism), where we chose the body size and task-switching age as those that attain the maximum rate of colony growth. Finally, we compared the performance of the optimal caste polyethism and the optimal age polyethism in terms of the colony growth rate. This analysis is explained in SI Appendix C.
The results of the adaptive polyethism model were almost the same for the growing colony and stationary colony, except for the time-discounting factor to be considered in the growing colony. This implies that, in a rapidly growing colony, the performance of a task at an older age contributes less to the colony growth rate than the same amount of work being performed at a younger age. The performance of a task at worker age a should be discounted by a factor of − e ra , where r is the exponential rate of colony growth. This time-discounting effect is known in the theory of life history strategy 16,17 .
In the growing colony model, new nonreproductive individuals are produced from the resources obtained by the existing nonreproductive individuals, and hence a model in which they look like the offspring of existing workers is useful in analyzing their dynamics. However, biologically speaking, they are not offspring of workers, but offspring of the queen. We may consider a very similar situation when we discuss the population of leaves on a single individual plant. Since the photosynthesis of old leaves would result in the production of new leaves, we may regard the growth of an individual plant as the growth of a population of leaves in which the photosynthesis performed by old leaves would result in the production of new leaves, just like the resources obtained by current worker ants results in the production of new workers. Certainly, new leaves are not offspring of existing leaves. This formalism was adopted when the optimal defense effort for leaves (alkaloid concentration) depending on the leaf age was discussed by Iwasa et al. 19 , wherein the time-discounting factor is used in calculating the optimal strategy of the plant.
We studied the growing colony model by assuming the rate of producing new individual workers are purely limited by the labor performance of the current workers. In general, the colony growth may be constrained by other factors as well, such as the egg producing capacity of queen(s). This may be a subject of future theoretical study.
We have shown that the method of calculating the optimal polyethism is similar between exponentially growing small colonies and large stationary colonies. However, in general, the optimal task allocation pattern of small growing colonies may be different from the best polyethism of large stationary colony. If so, as a colony grows in size, the polyethism pattern might change.
One aspect that was not investigated in this study is environmental fluctuation. The need of workers for the different two tasks is likely to fluctuate. Wakano et al. 8 discussed the effect of environmental fluctuation in the evolutionarily stable allocation of workers according to age; however, they assumed that the age distribution of workers between two tasks is fixed. However, the number of workers engaging in different tasks would change in response to the current need for workers for different tasks (H. Shimoji, personal communication). For example, if food availability in a foraging site becomes high, a small number of foragers may be able to collect a sufficient amount of food. Subsequently, some of the workers that engage in foraging in the standard situation might start helping the workers within the colony. When food availability is low, more foragers are needed to collect the amount of food needed for colony maintenance, and workers that are supposed to be in the colony might start foraging. This flexibility should be applicable to both age polyethism and caste polyethism. We conjecture that older workers would be more likely to forage than younger workers, and larger-sized workers would be more likely to forage than small-sized workers, which are aspects handled by age polyethism and caste polyethism, respectively. Incorporating the effect of the flexible adjustment of worker numbers to both tasks would be worthwhile in future theoretical studies. Each individual worker must choose a task based on the needs of the tasks in the colony as well as its own age and body size.
Oster and Wilson 3 discussed the numbers of workers in different castes and reproductive individuals for ant colonies. They introduced a linear programming technique to combine the achievement of multiple tasks by the workers in the colony. Wilson 1 discussed the problem of the number of castes in the colony and compared it with the number of cell types of multicellular organisms. Bonner 20 reported that the number of cell types of multicellular organisms tends to increase with the total number of cells. Although this is a widely observed pattern, the reason that the number of cell types increases with the total number of cells is unclear; similarly, the reason ants with larger colonies tend to have more castes among workers is unclear. The model from the current study cannot answer this question because the advantage of having two separate castes versus a single morphological type engaging in two tasks is independent of the total colony size. This is an interesting theoretical biology theme in social insects.

Data availability
Data sharing is not applicable to this article as no datasets were generated or analyzed during the current study.