# Optimality model

In biology, optimality models are a tool used to evaluate the costs and benefits of different organismal features, traits, and characteristics, including behavior, in the natural world. This evaluation allows researchers to make predictions about an organism's optimal behavior or other aspects of its phenotype. Optimality modeling is the modeling aspect of optimization theory. It allows for the calculation and visualization of the costs and benefits that influence the outcome of a decision, and contributes to an understanding of adaptations. The approach based on optimality models in biology is sometimes called optimality theory.
Optimal behavior is defined as an action that maximizes the difference between the costs and benefits of that decision. Three primary variables are used in optimality models of behavior: decisions, currency, and constraints. Decision involves evolutionary considerations of the costs and benefits of their actions. Currency is defined as the variable that is intended to be maximized (ex. food per unit of energy expenditure). It is the driving factor behind an action and usually involves food or other items essential to an organism's survival. Constraints refer to the limitations placed on behavior, such as time and energy used to conduct that behavior, or possibly limitations inherent to their sensory abilities.
Optimality models are used to predict optimal behavior (ex. time spent foraging). To make predictions about optimal behavior, cost-benefit graphs are used to visualize the optimality model (see Fig 1). Optimality occurs at the point in which the difference between benefits and costs for obtaining a currency via a particular behavior is maximized.

## Construction

To construct an optimality model, the behavior must first be clearly defined. Then, descriptions of how the costs and benefits vary with the way the behavior is performed must be obtained. Examples of benefits and costs include direct fitness measures like offspring produced, change in lifespan, time spent or gained, or energy spent and gained.
Each time an organism displays a certain behavior, it must weigh the costs and benefits to make a decision. For example, given X amount of time traveling, after catching one bug, would it be better for a bird to continue foraging or to quickly return to its nest to feed chicks? Better understanding of the relationships between the values in a model leads to better predictions of organism behavior.
To determine the optimum time spent on a behavior, one can make a graph showing how benefits and costs change with behavior. Optimality is defined as the point where the difference between benefits and costs for a behavior is maximized, which can be done by graphing the benefits and costs on the y-axis and a measure of the behavior on the x-axis.
A currency must also be identified. A test of the predictions generated by the optimality model can be performed to determine which currency the organism maximizes at any given time. For example, when constructing an optimality model for bee foraging time, researchers looked at whether energetic efficiency (energy gained/energy spent) or net rate of gain ((energy gained − energy spent)/time) was optimized. It was found that the bees maximized energetic efficiency when foraging for nectar.

## Examples
### Cellular sensing

Cells exhibit precise behaviors in response to physical cues. This optimality has been modeled by quantifying what information a sensor can learn from its physical surroundings. Over recent decades, experiments observed biophysical optimality in chemosensing, mechanosensing, and light sensing.

### Crows and whelks

On the Pacific coast of Canada, crows forage on whelks, a species of mollusk. To break the shell of the mollusk, the crows fly and drop the whelks on rocks. Reto Zach constructed an optimality model to predict the optimal height at which crows drop the whelks. The benefit in this model is the success rate of cracking the whelk's shell, while the primary cost is the energy spent flying. If the crows did not fly high enough, they would have little success in breaking the whelks' shells. However, the crows could waste valuable energy if they climb too high. In his model, Zach predicted the optimal height for crows to drop the whelks. To do this, Zach calculated the total distance each whelk was dropped before it was successfully broken. Whelks dropped from 3 meters and lower actually had traveled high total distances because they had to be dropped numerous times in order to be broken. On the other hand, whelks dropped from 5 meters and 15 meters were dropped approximately the same number of times to initiate a break; however, the crows would obviously have to climb higher to break a whelk at 15 meters than at 5 meters. Zach predicted 5 meters to be the optimal dropping height. The results indicated that the crows do follow this model, as the average dropping height was 5.2 meters.

### Dung flies

Dung flies are a polygamous species that mate on cowpats. The copulation behavior of this species can also be modeled using the marginal value theorem. It has been discovered that in cases where two male dung flies copulate with the same female in relatively rapid succession, the second male will fertilize 80% of the eggs, while the first male will only fertilize 20%. This creates a dilemma for male dung flies. The longer they remain with a female after copulation, the better they are able to guard her from copulating with other males, hence increasing the likelihood of passing his genes to her offspring. However, the longer the male remains with an individual female, the smaller chance he has of finding other mates. Geoff Parker predicted that an optimality model comparing these two behaviors would be affected by the travel time between two patches. For example, short distances between cowpats should widen the pool of available mates in a specific geographic location. Parker predicted that under this condition, dung flies would be more likely to leave their current mate sooner to find additional mates. But if cowpats are few and far between, it would benefit a male dung fly to spend more time guarding a mate, ensuring his genes are passed on, because he may have difficulty finding an additional mate. The results from Parker's experiment agree with this model.

### Starlings

One common use of the optimality model is in optimal foraging theory. For example, the foraging behavior in starlings can be predicted using an optimality model, specifically a marginal value theorem model. Researchers compared the amount of time a bird forages to the distance the bird travels to the foraging ground. Birds try to maximize the amount of food they take back to their offspring. Starlings mostly feed their offspring leatherjackets. As starlings gather more leatherjackets, it becomes increasingly difficult and time-consuming to find subsequent leatherjackets with the additional prey in their mouths. Thus at some point, it benefits them to stop expending extra energy to find additional food and return to their nests instead. A graph of this phenomenon, called a loading curve, compares foraging time to the number of prey captured. Alex Kacelnik predicted that the curve would fluctuate depending on the starling's travel time. He predicted that starlings traveling further would spend more time at the foraging site to achieve optimal foraging behavior. It is important that these starlings spend extra time at the foraging ground because it takes a lot of energy to travel back and forth from its nest. On the other hand, he predicted starlings traveling shorter distances to foraging grounds should spend less time foraging, making more frequent trips in order to optimize their behavior. Since these starlings have a shorter distance to travel, they do not need to put as much energy into searching for leatherjackets because it is easier for them to return to the foraging ground. His results were consistent with his predictions.

## Limitations

Some authors have argued that optimality models may be insufficient in explaining an organism's behaviour. The degree of optimization in response to natural selection depends on the rate at which genetic structure changes, the amount of additive variance present at the time of selection, gene flow, rate of environmental change, and random effects such as genetic drift. Thus, discontinuous phenotypes and fluctuations in payoff affect optimality. Strict optima may not be reachable due to genetic and environmental changes. Genetic factors limiting the attainment of optimality include mutations and genetic linkage. Complementary strategies to describing and analyzing organism behaviour include phylogenetic comparative methods and quantitative genetics.