Game-Theoretic Methods for Functional Response and Optimal Foraging Behavior

We develop a decision tree based game-theoretical approach for constructing functional responses in multi-prey/multi-patch environments and for finding the corresponding optimal foraging strategies. Decision trees provide a way to describe details of predator foraging behavior, based on the predator's sequence of choices at different decision points, that facilitates writing down the corresponding functional response. It is shown that the optimal foraging behavior that maximizes predator energy intake per unit time is a Nash equilibrium of the underlying optimal foraging game. We apply these game-theoretical methods to three scenarios: the classical diet choice model with two types of prey and sequential prey encounters, the diet choice model with simultaneous prey encounters, and a model in which the predator requires a positive recognition time to identify the type of prey encountered. For both diet choice models, it is shown that every Nash equilibrium yields optimal foraging behavior. Although suboptimal Nash equilibrium outcomes may exist when prey recognition time is included, only optimal foraging behavior is stable under evolutionary learning processes.


Introduction
The functional response [1,2] considers the number of prey (or resource items) consumed by a single predator (or forager) as influenced by prey abundance. By dictating the mortality rate of prey and the feeding rate of predators, it is central to understanding consumer-resource dynamics [3,4]. Furthermore, the functional response can be extended to consider a predator seeking two prey types [1]. Besides being more realistic for many predators, functional responses on two food types create indirect effects between the prey via the shared predator. For instance, if consuming a prey item takes time or reduces motivation, then the presence of a second food type decreases the forager's consumption of the first food type. Via the functional response, such prey become indirect mutualists [5]. Conversely, short-term apparent competition [6,7] results if the presence of the second prey encourages the predator to spend more time or effort searching for and capturing prey. This happens when foragers bias their efforts towards areas rich in resources. Regardless, the two-food functional response is central to understanding diets, optimal foraging for multiple resources, predator mediated indirect effects between prey, and population dynamics within food webs.
Two modeling approaches have addressed the question of diet choice for a forager that searches for and then handles encountered prey items. The first is found in classic optimal foraging models. The forager's encounter probability or attack rate [3] is viewed as a mass action phenomenon between the predator and its prey. The forager's overall encounter rate with prey is simply the product of prey abundance and the predator's encounter probability on that prey. Upon encountering a prey, the forager can elect to consume the prey at some handling time cost, or reject the opportunity and continue the search for other prey. Starting from Holling's [1] two-food functional response this approach has generated increasingly sophisticated predictions.
In Pulliam [8] (see also [9]), a ''zero-one'' or ''bang-bang'' rule for diet choice was derived. A forager should either always accept or always reject an encountered food item. When encountered, the preferred food (based on a higher reward to handling time ratio) should always be consumed. If searching for and handling the preferred food type yields more (or less) reward than simply handling the less preferred food, then the less preferred food should always be rejected (or accepted) when encountered. Empirical support was encouraging but equivocal [10]. Most foragers show a partial selectivity, they are neither completely opportunistic nor completely selective. A number of mechanisms have been proposed and modeled for why foragers sometimes only partially consume a less preferred food; including food depletion [11], food bulk and digestion limitations [12], complementary nutrients [13], local omniscience [14], incorrect prey classification and sampling by predators [15,16], prey crypsis [17] etc.
A second approach to diet choice is emerging from spatiallyexplicit models such as agent based models. A forager may move through a lattice or some form of continuous space. Prey items may occur at fixed locations or may also move through the defined space. The forager possesses some detection radius. Upon detecting a prey, the forager can choose to ignore the prey or attempt a capture. Such approaches lead to greater realism by considering the roles of space and individual contingencies. While they move through the same landscape, each individual forager becomes more or less unique based on its own personal history of movement, food encounters, and foraging decisions. Some individuals may experience unusually high or low harvest rates as a consequence of runs of good or bad luck, respectively. Like the classical models of diet choice, the foragers can still make optimal foraging decisions by deciding which encountered foods to handle or reject. The simulations can be run with a myriad of decision rules, and the performance of these rules can be compared. While a best diet choice rule may emerge from a particular scenario, the explicit nature of the agent based models may obscure the elegance or simplicity of the decision rule. Such agent based models may approximate more or less the optimal decision rules from the first approach to diet choice [14].
Here we develop a decision theory approach to diet choice. We use an explicit decision tree to evaluate the costs and benefits of different choices. Such a decision tree has similarities to extensive form games from game theory [18,19]. Our goals are threefold. First, does an explicit consideration of decision making recover the results from the classic ''mass-action'' models of diet choice. Second, can these decision trees assist in uncovering the optimal decision rules for agent-based foraging models. Third, what are the similarities and differences between the decision tree of a forager and evolutionary games in extensive form. To achieve these goals we imagine a forager that searches for and handles food items of two types.
We consider three different scenarios based on the nature of searching for food and the ability to recognize a food's type upon encounter. In the first, search is undirected in terms of food type, but upon encountering a food item the forager instantly recognizes its type. This accords with the assumptions that generate Holling's two-food functional response and an ''all or nothing'' decision rule of food type acceptability. In the second the forager may encounter one prey of each type (called simultaneous encounter [20]), but can only handle one of the items, the other being lost. For instance, these two prey may be together at the same place competing over a common resource. Alternatively, the predator may search a small area completely for any prey before deciding whether to attack. In the third, we consider recognition time where the forager must expend additional time if it wants to know the type of food that has been encountered prior to handling.

Decision trees and the functional response for two prey types
In this section, we develop a decision tree method to derive the predator's functional response. The tree details the predator-prey interactions under consideration. We envision several prey types spatially distributed among many patches (that we will call microhabitats). The encounter events are then partially determined by the prey through their spatial distribution before the predator arrives. For instance, if prey are territorial, then the predator can encounter at most one solitary prey in a given microhabitat. At another extreme, if the different types of prey aggregate, then the predator can encounter different prey types at the same time. Thus, encounter events depend on the spatial behavior of the prey.
We break the predation process into different stages. A typical predation process has at least three stages that answer the following questions: 1. What prey (or types of prey) does the predator encounter? 2. What does the predator do in a given encounter situation (e.g. does the predator attack a prey, what type does it attack, etc.)? 3. Is the predator successful or not if it attacks? Here, we construct functional responses from the underlying decision trees based on three scenarios. This construction is, however, quite general and described fully in section Decision trees and the functional responses of Appendix S1. We start with a well known example that leads to the Holling type II functional response for two prey types.
Suppose that there are two types of prey A and B with fixed densities x and y, respectively. We assume that these prey are scattered randomly among N microhabitats where N is much larger than the number of individuals (i.e., N&xzy). Thus, there will be at most one prey in each microhabitat (i.e. the probability that there are two or more in some microhabitat is negligible). Thus, the probabilities that a given microhabitat has no prey is p 0~1 { x N { y N , exactly one prey A is p A~x N and exactly one prey B is p B~y N . These probabilities are assumed not to change with time, which is the usual assumption when deriving a functional response.
Suppose the predator chooses a microhabitat to search at random, that it always finds the prey in this microhabitat if there is one, and that it takes a searching time t s for it to determine whether a prey is there or not. There are then three possible encounter events: the predator encounters a prey of type A, a prey of type B, or no prey at all. These events occur with probabilities p A , p B and p 0 respectively (see Figure 1, Level 1).
For the first event when encountering prey A, the predator has two possible actions: Either ''attack prey A'' and ''do not attack prey A.'' These actions occur with probabilities q A and 1{q A , respectively (see Figure 1, Level 2). Similarly, in the second event when a predator encounters prey B, the two possible actions of the predator are to ''attack prey B'' and ''do not attack prey B'' with probabilities q B and 1{q B , respectively. For the third event, when no prey are found, the only predator action is ''do not attack'' with probability 1. Altogether, there are five possible predator activities, and these correspond to the five edges at Level 2 in the decision tree of Figure 1. The decision tree for two prey types. The first level gives the prey encounter distribution. The second level gives the predator activity distribution. The final row of the diagram gives the probability of each predator activity event and so sum to 1. Since each entry here is simply the product of the probabilities along the path leading to this endpoint, we do not provide them in the decision trees from now on. With random prey distribution and N large, p 0~1 { x N { y N ,p A~x N and p B~y N . If prey A is the more profitable type, the edge in the decision tree corresponding to not attacking this type of prey is never followed at optimal foraging (indicated by the dotted edge in the tree). The reduced tree is then the resulting diagram with this edge removed. doi:10.1371/journal.pone.0088773.g001 Let the predator's handling times of prey A and B be t Ah and t Bh , respectively. The five predator activity events are: encounter a microhabitat with prey A and attack it; encounter a microhabitat with prey A and do not attack it; encounter a microhabitat with prey B and attack it; encounter a microhabitat with prey B and do not attack it; encounter an empty habitat. The probability distribution of these activities (i.e. the ''activity distribution'', [21]) in this order is tion times t s zt Ah , t s , t s zt Bh , t s , t s , respectively. All this information is included in the decision tree of Figure 1. Also included in this tree are the energy consequences (p ' ) to the predator of each of the five activities. Calculation of functional responses is based on renewal theory (for details, see section Decision trees and the functional responses of Appendix S1) which proves that the long term intake rate of a given prey type can be calculated as the mean energy intake during one renewal cycle divided by the mean duration of the renewal cycle [20,[22][23][24]. A single renewal cycle is given by a predator passing through the decision tree in Figure 1. Since type A prey are only killed when the path denoted by p A and then q A is followed, the functional response to prey A, f A (q A ,q B ), is given through Figure 1 by Similarly, the functional response for prey B is These are the functional responses assumed in standard two prey models (e.g., [9,20,25]) given in our notation. For instance, if we normalize searching time so that Nt s~1 , f A (q A ,q B ) can be rewritten in terms of prey density in the more familiar form xq A 1zxq A t Ah zyq B t Bh . As mentioned above, it is assumed that the encounter rates, p A and p B , remain unchanged over the renewal cycle in that predation has negligible effect on prey densities during this time. This occurs if, for example, x and y are large or N is quite large and so predation is rare. Our decision tree approach provides a mechanistic foundation to typical functional responses assumed in the literature. In particular, it is obvious that the standard Holling II functional response [2] given by f (x)~x 1zxt h is the outcome for Figure 1 when there is only one type of prey and the predator always pursues every prey it encounters (take Nt s~1 ,y~0 and q A~1 ). The predator's rate of energy gain, f , is given by (Figure 1) Like others [9,20,23,26], we assume that the forager aims to maximize f . This theory predicts that if the two types of prey are ranked according to their ''profitabilities'' (i.e. their respective nutritional values per unit of handling time p=t), then the more profitable prey type is always included in the diet. That is, if p A =t Ah wp B =t Bh , then the optimal foraging strategy is to attack all encountered prey A (i.e. q A~1 ). Furthermore, the decision to attack the lower ranked prey (i.e. prey B) satisfies the zero-one rule. Specifically, q B~1 (respectively, q B~0 ) if its profitability is greater than (respectively, less than) the nutritional value of only attacking prey of type A (i.e. q B~1 if and only if ). The threshold value for including the less profitable prey in the predator's diet depends only on the chances of encountering the more profitable prey (i.e. only on the density of prey A) since [9,20,23,26].

Decision trees and extensive form games
The decision tree approach is reminiscent of games given in extensive form [18,19]. Because of this relationship between decision trees and extensive form games, game theory can then be used to find the optimal foraging strategy. First, we use the truncation method to eliminate those paths that always yield suboptimal outcomes. When applied to Figure 1, truncation removes the dotted path of rejecting the opportunity to capture prey type A. It is never optimal to reject the prey that offers a higher reward to handling time ratio. But what of node B? For food B with a lower energy to handling time ratio, we can find the optimal foraging strategy by analyzing the agent normal form [19]. This method assigns a separate player (called an agent) to each decision node. The possible decisions at this node become the agent's strategies and its payoff is given by the total energy intake rate of the predator it represents. When game theory is used to solve a single predator's decision tree, all of the virtual agents have the same common payoff, and in a sense, these agents engage in a cooperative game. The optimal foraging strategy of the single predator is then a solution to this game.
To illustrate the approach, we make the decision tree of Figure 1 into a two-player foraging game. Player 1 corresponds to decision node A with strategy set S 1~f q A D0ƒq A ƒ1g and player 2 to node B with strategy set S 2~f q B D0ƒq B ƒ1g. Their common payoff f (q A ,q B ) is given by (1). In an extensive form game, the payoff functions are linear in the behavioral strategy choices of all players. For our optimal foraging games, these payoffs are nonlinear functions and so are more similar to those found in population games [27,28]. As a game, we seek the Nash equilibrium (NE). This is a pair of behavioral strategies (q A ,q B ), one for each player, such that neither player can gain by unilaterally changing its strategy. That is, for all q 0 A [S 1 and q 0 B [S 2 . In game-theoretic terms, (q A ,q B ) is a NE if q A is a best response of player 1 to q B and q B is a best response of player 2 to q A .
Clearly, an optimal foraging behavior ( corresponds to a NE since it satisfies (3). Solving the game (i.e. finding the NE) for the classic foraging model of two types of prey is straightforward. Since f (1,q B )wf (q A ,q B ) for all 0ƒq A v1 and 0ƒq B ƒ1, the behavioral strategy of player 1 to attack (i.e. q A~1 ) strictly dominates all its other options (i.e. q A =1) and so, at any NE, player 1 must play q A~1 . The NE strategy of player 2 is then any best response to q A~1 (i.e. any q B that satisfies f (1,q where p Ã A is given by (2). These results are shown in Figure 2 where NE are indicated by solid circles (panels (a) and (c)) and by the solid line segment on the right edge of panel (b). In this latter case (i.e. when p A~p Ã A ), every point on this vertical edge q A~1 is a NE and the entire edge forms a NE component (i.e. a maximal connected set of NE, cf. [19]). Thus, at this critical encounter rate with the more profitable prey type, the zero-one rule of optimal foraging which states that a given resource type in a given patch is either always consumed when encountered or never consumed, must be modified because the optimally foraging predator preference for the alternative prey type can be anywhere between 0 and 1.
Since Figure 1 is a two-level foraging game, Theorem 3 of section Zero-one rule and the Nash equilibrium of Appendix S1 implies that the NE given by Figure 2 (i.e. by q A~1 and q B given by (4)) completely characterize optimal predator foraging behavior. Figure 2 also indicates the direction of increasing energy intake per unit time at points in the unit square. This suggests yet another connection to game theory; namely, how does the predator learn its optimal behavior? This question is commonly studied in evolutionary game theory [19,29] where individual behaviors evolve in such a way that strategies with higher payoff become used more frequently. By following the flow of increasing payoff in the figure, it is clear from Figure 2 that such an evolutionary process will automatically lead to optimal predator behavior. We will return to this question in section Game theory and evolutionary outcomes for the prey recognition game where the evolutionary outcome is not so clear.
In these more general games where the decision tree has more than 2 levels, there may be NE that do not correspond to optimal foraging behavior. However, so long as the number of encounter events at level 1 and predator activities remain finite, these decision trees generate the predator's energy intake rate and its functional responses on each type of prey. Game-theoretic equilibrium selection techniques [30] based on evolutionary outcomes can then be used to discard suboptimal NE behaviors and select only those NE corresponding to optimal foraging behaviors as we will see in the final example that includes prey recognition effects (see section Prey Recognition Effects).

Foraging with simultaneous resource encounters
In this section, we again assume that there are two resource types (denoted as A and B) but, unlike section Decision trees and the functional response for two prey types, some microhabitats can contain a mixture of both types (denoted as AB). In this case, we assume that the consumer can forage for at most one resource type in any encounter event. Other microhabitats can be resources free. Furthermore, let p A , p B and p AB respectively be the proportions of these microhabitats that contain only resource A, only resource B prey and both resources AB respectively. Finally, let p 0 be the proportion of microhabitats that contain no resources. If the consumer chooses a patch at random, the distribution of encounter events is given by Level 1 of Figure 3. Figure 3 also contains the distribution of consumer activity events under the assumption that the consumer is always successful when it decides to forage a resource that it encounters. In the predator-prey interpretation, this means the predator kills its prey whenever it attacks. As discussed in the final paragraph of section Decision trees and the functional responses of Appendix S1, our decision tree approach to optimal foraging is also applicable when the attacking predator is only successful with a certain probability that may depend on the type of prey. Here q A (respectively, q B ) is the probability the consumer forages for the resource when it encounters only resource type A (respectively, type B). Also q AB (respectively, q BA ) is the probability the consumer forages type A (respectively, type B) resource when it chooses a microhabitat that contains both types of resources and so 1{q AB {q BA is the probability the consumer decides not to forage for either resource in this encounter event. The functional response can then be developed from the decision tree in Figure 3 that includes the searching and handling times as well as the energy intakes of the different activity events. Proceeding as in section Decision trees and functional response for two prey types, the functional responses to resource type A and B are given by Thus the total consumer energy intake per unit time is To find the optimal foraging strategy, we solve for the NE of the three-player game that assigns one player to each of the consumer decision nodes in Figure 3. As shown in section Foraging with simultaneous resource encounters of Appendix S1, the behavior strategy to consume resource A at node A strictly dominates all other actions of this player (i.e., f (1,q AB ,q BA ,q B )w f (q A ,q AB ,q BA ,q B ) for all 0ƒq A v1), as we assume that resource A is more profitable to the predator than resource B (i.e. that . It is also shown there that any behavior strategy at node AB whereby a resource is not always consumed (i.e. q AB zq BA v1) is strictly dominated. Thus q A~1 and q AB zq BA~1 at any NE. From these two results, the decision tree in Figure 3 can be truncated by deleting the two edges indicated by dotted lines. With this change, the consumer energy intake rate f becomes Thus, the optimal strategy is a NE of the two-player game corresponding to the reduced tree of Figure 3. In this two-level foraging game, player 1 corresponds to decision node AB with strategy 0ƒq AB ƒ1 and player 2 at node B with strategy 0ƒq B ƒ1. Their common payoff is given by (7). From section Foraging with simultaneous resource encounters of Appendix S1 the best response for player 1 that encounters both prey types simultaneously given the current strategy of player 2 is Similarly, the best response of player 2 when encountering only resource B is Then (q AB ,q B ) is a NE if and only if this strategy pair satisfies equations (8) and (10). Thus, unlike section Decision trees and functional response for two prey types, the NE behavior at one consumer decision node depends on the behavior at the other.
By Theorem 3 in section Zero-one rule and the Nash equilibrium of Appendix S1, NE correspond to optimal foraging behavior. Thus, the optimal foraging behavior depends critically on the values of q Ã AB and q Ã B . In particular, it is important to know whether these values are between 0 and 1, less than 0 or greater than 1. For instance, suppose that q Ã AB w1 and 0vq Ã B v1. Then, from (10), q B~1 (since q AB vq Ã AB ) and so q AB~1 by (8). In this case, the only optimal foraging behavior is to consume A whenever it is encountered and to consume B only when it is not encountered simultaneously with A. In general, we observe that (i) if q Ã AB v0, then q Ã B v0, and (ii) if q Ã B w0, then q Ã AB w1. These inequalities constrain the number of possible optimal strategies to (q AB ,q B )[f(1,0),(1,1),(0,1)g. These are the possible optimal strategies among the vertices of the unit square in Figure 4. As we will see, at certain threshold parameter values, two of these ½ ½ vertices can both correspond to optimal behavior. In this case, all points on the edge between these vertices correspond to optimal behavior as well. In particular, the case where q AB~qB~0 can never occur because the two necessary conditions q Ã AB v0 and q Ã B w0 are excluded by (i) and (ii). This intuitive result predicts that if the less profitable resource type B is consumed when encountering both types (i.e., if q BA~1 which implies that q AB~0 ), it will always be consumed when encountered alone. Moreover, there is no interior optimal strategy (i.e. there is no NE whereby the consumer exhibits partial diet choice when encountering both resource types simultaneously as well as partial diet choice when encountering resource B on its own) since this requires that both q Ã AB and q Ã B be strictly between 0 and 1, which does not happen for any parameter choice.
It is interesting to analyze dependence of the optimal strategy (q AB ,q B ) on the energetic value (p B ) of the less profitability prey. We consider only those energetic values for which B is the less profitable prey type (i.e., 0vp B v p A t Bh t Ah ). To this end, we need to know the critical values of p B when either q Ã B or q Ã AB are equal to 0 or 1. Let We divide the analysis into two cases. For the first, assume that the handling time of resource A is longer than or equal to that of resource B (t Ah §t Bh ). As we assume that resource A is more profitable than B, it follows that the energy content in food items must be larger in resource A (p A wp B ) and so q Ã B v0 by (9). Thus, the optimal foraging strategy is to consume the A resource when both are encountered (i.e. q AB~1 ). Furthermore, q B~0 if is consumed when encountered on its own only if its energy value is sufficiently high). The dependence of the optimal strategy as a function of prey B energetic value is shown in Figure 5A. The more interesting case where prey A handling time is shorter than prey B handling time (t Ah vt Bh ; Figure 5B) is analyzed in section Foraging with simultaneous resource encounters of Appendix S1. When energy content of prey B is smaller than p Ã B3 the optimal strategy is (q AB ,q B )~(1,0). For intermediate energy content satisfying p Ã B3 vp B vp Ã B2 , the optimal strategy is (q AB ,q B )~(1,1): For relatively large energy content p Ã B1 vp B vp A t Bh =t Ah , the optimal strategy is (q AB ,q B )~(0,1). These results are also included in Figure 4 that in addition provides the direction of increasing energy intake per unit time at all points in the unit square. In all cases analyzed in the previous two paragraphs, the outcome satisfies the zero-one rule (i.e. either always consume a given resource type in a given patch or never consume it) as suggested by [31].
It is particularly interesting to see what happens at the critical values p Ã B3 where q Ã AB~1 , and p Ã B1 where q Ã B~1 : These values correspond to transitions (b)-(c) and (d)-(e) respectively in Figure 4 because the dashed vertical (panel (b)) and horizontal (panel (d)) lines respectively are then on the boundary of the unit square. Straightforward calculations show that is independent of q B and the optimal foraging behavior is any strategy pair of the form (q AB ,q B )~(1,q B ) for 0ƒq B ƒ1. Similarly, when p B~p and the optimal foraging behavior is any strategy pair of the form (q AB ,q B )~(q AB ,1) for 0ƒq AB ƒ1. Once again, the zero-one rule must be modified at these critical values. For instance, when p B~p Ã B1 , resource B is always consumed under optimal foraging when encountered on its own. However, if both resources are encountered simultaneously, optimal foraging occurs for any preference for the less profitable prey type. In section Zero-one rule and the Nash equilibrium of Appendix S1, the modified zeroone rule states that there is at least one optimal foraging behavior where the corresponding NE is a pure strategy, i.e., where the predator preference for a prey is either 0 or 1. After such modification the zero-one rule holds even at p B~p Ã B1 because the (pure) strategy (q AB ,q B )~(1,1) is optimal. This extension of the zero-one rule applies to situations where optimal preferences for prey types as a function of a parameter switch suddenly at some critical values from 1 to 0 or vice versa.
These results can be partially explained through the patch choice model of [31]. Specifically, since patches A and AB have the same maximum profitabilities p A t Ah (which is higher than in patch B), both are included in the consumer's diet. However, as shown by [31], this does not mean that the most profitable resource is chosen in patch AB. From (9), we see whether q AB~0 or 1 depends both on the ranking of A and B profitabilities (the denominator in (9)) as well as on the difference in energy gain p B {p A per unit consumed. When resource type A is both more profitable and also has a higher energetic value (p A wp B ), or search time is short, then q Ã B v0 and, consequently, q AB~1 , i.e, only resource A will be consumed in patches containing both resource types. Only when type B is energetically more valuable than type A and either search time is long enough, or the probability of encountering patch A and patch AB is low enough, can resource type B be selected when both resources are encountered simultaneously. In this case, resource B will also be consumed when encountered on its own.

Prey recognition effects
The functional response developed in section Decision trees and functional response for two prey types assumes the predator immediately recognizes the type of prey found during its search and then decides whether or not to attack it. In this section, we model the situation where the predator cannot distinguish the type of prey it encounters unless it is willing to spend extra ''recognition'' time t r beyond the time required to search the microhabitat. That is, the predator has an option of paying this extra cost to gain information on the prey type encountered before it decides whether to attack. This information is said to be gathered in the facultative sense [32]. Kotler and Mitchell [32] point out instances of facultative information that occur in hostparasite and in mate selection models. They also discuss optimal foraging when information is gathered in the obligate sense (i.e. the predator gathers this information on prey type in the process of handling the prey and has the option of rejecting it at that point). Although we do not consider the model for obligate information in this paper, its decision tree (and analysis of optimal foraging) is simpler than Figure 6 for facultative information. As in section Decision trees and functional response for two prey types, we assume that the two prey types are distributed among N micohabitats with at most one prey in each. To ease notational difficulties, we now label these prey types as species 1 and 2 with densities x 1 and x 2 respectively and nutritional values p 1 and p 2 respectively to the predator. If the predator chooses a microhabitat at random, the encounter event distribution (see Figure 6) is the same as in Figure 1 (with our change of notation). In particular, p 0~1 { x N { y N , p 1~x N and p 2~y N . On finding a prey in a microhabitat, the predator decides immediately whether to attack, move to another microhabitat to begin a new search, or spend recognition time to determine the type of prey encountered. Suppose these choices are taken with probabilities q A , q M , q R respectively (where q A zq M zq R~1 ). The horizontal dashed line in Figure 6 joining these two encounter events indicates that this decision must be made without knowing the type of prey. Thus, in the terminology of extensive form games [19], the set of these two nodes forms an ''information set'' of the predator and is represented by a single player in the three-player game corresponding to Figure 6. We remark that the two nodes that form this single information set require only one player because, at both nodes, the information available is the same (the information is that the searching predator encountered a prey).
If the predator decides to spend recognition time to determine the encountered prey is of type i, then it must subsequently decide whether to attack this prey or not with probabilities q Ai and 1{q Ai respectively (see the third level of Figure 6). It is not necessary that q A1~qA2 . If we assume that the predator is always successful when attacking a prey, the tree diagram is given in Figure 6 where t 1h and t 2h are the handling times for prey of type 1 and 2 respectively. We also assume that the time needed to recognize either type of prey is the same (i.e. t 1r~t2r~tr ). Proceeding as in section Decision trees and functional response for two prey types, the functional response to prey type i is given by where t~t s zp 1 q A t 1h zp 1 q R (q A1 t 1h zt r )zp 2 q A t 2h zp 2 q R (q A2 t 2h zt r ): Thus the total predator nutritional value per unit time is for fixed prey distribution p 1 and p 2 . The optimal predator foraging behavior corresponds to the maximum of f as a function of q A , q M , q R , q A1 , q A2 . This maximum is considerably harder to determine than in section Decision trees and functional response for two prey types. However, game-theoretic methods to solve for NE are effective at simplifying the analysis. Figure 6 is a three-player foraging game with player 1 representing the predator decision at the two-node information set at level 2 and players 2 and 3 assigned to the respective decision nodes at level 3. From section The Nash equilibria of the prey recognition game of Appendix S1, any strategy (q A ,q R ,q M ) of player 1 with q M w0 is strictly dominated and so any NE behavior of this player must satisfy q M~0 . Thus, at the optimal strategy, the predator should never move to another microhabitat when it first finds a prey since, by abandoning this prey, the predator wastes the time spent searching for it. In contrast to section Decision trees and functional response for two prey types where the predator could reject the prey type with low profitability on first encounter, this is not possible here without rejecting the better prey type as well (because upon an initial encounter the predator does not know the prey type).
Since player 1 has strategy of the form (q A ,q R ,q M )( q A ,1{q A ,0) for some 0ƒq A ƒ1, we will denote the NE behavior of player 1 by q A and assume that q M~0 from now on. Section The Nash equilibria of the prey recognition game of Appendix S1 also shows that, if prey type 1 is more profitable than type 2 (i.e. if p 1 t 1h w p 2 t 2h as in section Decision trees and functional response for two prey types, then the predator must attack any prey 1 that it recognizes. We will assume this throughout this section. Thus, we will also assume that q A1~1 in the decision tree of Figure 6 and analyze the truncated foraging game that eliminates the three edges indicated by dotted lines there. The reduced tree corresponds to a two-player game with strategy set 0ƒq A ƒ1 for player 1 at level 2 and 0ƒq A2 ƒ1 for player 2 representing the predator decision whether to attack a recognized prey 2 at level 3. The energy intake rate is then where The NE of this truncated game is easy to determine when p2 t2h § p1p1 tszp1t1h . In this situation, the profitability of prey type 2 is at least as high as the nutritional value of only attacking prey type 1 when there is no recognition time (i.e. t r~0 ). In section Decision trees and the functional response for two prey types (cf. equation (1)), the NE behavior of player 1 is then to attack any prey encountered and this continues to be the NE strategy when recognition time is non-zero. Thus q A~1 at any NE and, in fact, all NE are of the form (q A ,q A2 )~(1,q A2 ) for some 0ƒq A2 ƒ1 (see section The Nash equilibria of the prey recognition game of Appendix S1 for the formal derivation). This corresponds to the predator being opportunistic (sensu [32]). Note that, if the predator immediately attacks an observed prey, the decision whether to attack after recognizing the type of prey is no longer relevant since this choice is never needed.
For the remainder of this section, assume that the profitability of resource 2 is lower than is the mean energy intake rate obtained when feeding on the more profitable prey type only (i.e., ). In this case, the predator should consider whether to determine the prey type it encountered, because including the less profitable prey type in its diet may decrease the mean energy intake rate.
To calculate the NE behavior, we proceed as in section Foraging with simultaneous resource encounters. From section The Nash equilibria of the prey recognition game of Appendix S1, the best response of player 1 to a given strategy q A2 of player 2 is where Figure 7. Qualitative outcomes of the optimal foraging strategy (13) and (14) for increasing recognition time t r . Panel (a) assumes 0vt r v 1 6 for which 0vq Ã A2 v1 and q Ã A v0. The optimal foraging strategy is at (q A ,q A2 )~(0,0) (i.e. always pay the cost of recognition and then never attack the less profitable prey type) and the NE component (shown as the gray line segment) f(1,q A2 )Dq Ã A2 ƒq A2 ƒ1g (corresponding to the NE outcome of attacking immediately) is suboptimal. In each of the other three panels, the (union of the) thick edges forms a strict equilibrium set (SES, for definition see section Zero-one rule and the Nash equilibrium of Appendix S1) that is the globally stable evolutionary outcome. Panel (b) assumes t r~1 6 , q Ã A2~0 and q Ã A v0. The union of the two edges f(1,q A2 )D0ƒq A2 ƒ1g and f(q A ,0)D0ƒq 2 ƒ1g forms one NE component corresponding to optimal foraging behavior. Panel (c) assumes 1 6 vt r v 1 2 , q Ã A2 v0 and q Ã A v0. The edge f(1,q A2 )D0ƒq A2 ƒ1g forms a NE component corresponding to optimal foraging behavior. Panel (d) assumes t r w 1 2 for which q Ã A2 v0 and 0vq Ã A v1: The edge f(1,q A2 )D0ƒq A2 ƒ1g forms a NE component corresponding to optimal foraging behavior. The arrows in each panel indicate the direction of increasing energy intake per unit time at points in the unit square. Other parameters t s~1 , t 1h~1 , t 2h~2 , p 1~2 , p 2~1 and p 1~1 =2~p 2 . doi: 10 Conversely, the best response of player 2 to a given strategy q A of player 1 is where That is (q A ,q A2 ) is a NE foraging behavior if and only if it satisfies (13) and (14). We remark that q Ã A and q Ã A2 are both less than 1, and q Ã A2 v0 when 0ƒq Ã A v1. When recognition time, t r , is small (t r vt Ã A is negative and q Ã A2 is positive (Figure 7(a)). There are then two possible NE outcomes; namely, attack any encountered prey immediately corresponding to the NE (q A ,q A2 )~(1,q A2 ) where q A2 §q Ã A2 (shown as the gray segment of the line in Figure 7(a)) or never attack immediately and then only attack prey type 1 when recognized (with NE (q A ,q A2 )~(0,0), the solid dot in Figure 7(a)). From section Zero-one rule and the Nash equilibrium of Appendix S1, the optimal foraging behavior must be a NE outcome but because our decision tree has three levels, every NE may not be an optimal strategy. However, even in this case finding all NE substantially simplifies the problem of finding the optimal strategy, because it is now enough to evaluate function f given by (12) only at these NE points. Moreover, if there is a NE component (such as the gray segment in Figure 7(a)) the value of f at any point in this segment must be the same. By evaluating f (0,0)~p 1 p 1 t s zp 1 t 1h z(p 1 zp 2 )t r and f (1,q A2 )~p 1 p 1 zp 2 p 2 t s zp 1 t 1h zp 2 t 2h , we find f (0,0)wf (1,q A2 ) and so the optimal behavior is to never attack immediately and then only attack prey type 1 when recognized. As recognition time increases, q Ã A increases and q Ã A2 decreases. However, the NE outcomes and optimal behavior remain the same as long as q Ã A2 w0. Optimal predator behavior is then either described as being selective [32] or as being intentional [33].
For recognition time satisfying t r~t Ã r1 , q Ã A2~0 while q Ã A remains negative and so all strategy pairs of the form (1,q A2 ) and (q A ,0) are NE (Figure 7(b)). Moreover, each corresponds to an optimal foraging strategy since f (q A ,0)~p 1 p 1 t s zp 1 t 1h z(p 1 zp 2 )t r~f (1,q A2 ) in this case.
For still larger recognition times, q Ã A2 v0, thus q A~1 at any NE.
and the corresponding optimal foraging behavior is shown in Figure 7(c), while for recognition time larger than t Ã r2 , q Ã A w0 (Figure 7(d)). In both cases, the NE strategy pairs are of the form (1,q A2 ) and these all yield optimal foraging behavior.

Game theory and evolutionary outcomes for the prey recognition game
The existence of suboptimal NE in the prey recognition game makes the interesting question considered briefly in section Decision trees and extensive form games even more important here; namely, how does the predator manage to learn its optimal behavior and avoid suboptimal equilibrium behavior. This type of question (on the so-called equilibrium selection problem [30]) is commonly studied in evolutionary game theory where individual behaviors evolve in such a way that strategies with higher payoff become used more frequently. There are several standard models that examine the evolutionary outcome of these behaviors changing over time [29,34].
The evolutionary outcome is clear for all choices of parameters in the two diet choice models of sections Decision trees and the functional response for two prey types and Foraging with simultaneous resource encounters (see arrows in Figures 2 and 5, respectively). These arrows indicate the direction of increasing energy intake rate (e.g. in Figure 4, this rate increases as q B is used more frequently if and only if the vertical arrow is pointing upward). In all cases, the predator learns to use the NE strategy that corresponds to the optimal behavior for the foraging games of Figures 1 and 3 respectively. (This is true for Figure 2b as well since the arrows lead to some point on the vertical side of the unit square with q A~1 , all of which correspond to optimal behavior in this threshold case when p A~p The evolutionary outcome is also clear for the prey recognition game of this section when recognition time is large from Figure 7. Specifically, for t r §t Ã r1 (panels (b), (c) and (d)), the predator will evolve to a strategy on an edge consisting of NE points which correspond to optimal foraging. In the language of evolutionary game theory, this set of NE forms a globally stable set that attracts any initial predator behavioral choice as long as behaviors evolve in the direction of increasing energy intake rate.
However, for short prey recognition time (i.e. tvt Ã r1 with 0vq Ã A2 v1 in Figure 7(a)), the NE (0,0) (corresponding to the optimal foraging behavior of always spending the time to recognize the type of prey encountered and then only attacking prey of type 1) may not be globally stable. If the predator initially attacks recognized prey 2 with probability greater than q Ã A2 , behavior may evolve to a point in the suboptimal NE component where (q A ,q A2 )~(1,q A2 ) with q A2 §q Ã A2 (i.e. to a point on the gray line segment in Figure 7(a)). That is, the predator may become trapped at this suboptimal behavior, especially if evolution increases the strategy of attacking immediately faster than it decreases the strategy of attacking recognized prey 2 (i.e. if the arrow to the right in the top half of Figure 7(a) is much bigger than the one pointing down).
The situation depicted in Figure 7(a) is remarkably similar to that of the two-player extensive form Chain store game [19,35] (also known as the Ultimatum mini-game [36] or the Entry deterrence game [37]). In the large literature on this game, it is often argued that the evolutionary outcome will be the point (0,0)) since neutral drift near the suboptimal NE component will inevitably lead at some time to the strategy choice shifting to q A2 vq Ã A2 after which selection will quickly lead to (0,0). To see this, consider a point on this gray line segment. If the predator decides once in a while to spend some time to recognize the type of prey it encounters, its strategy will move to the left of the segment. As strategies with higher payoff are then to the right and down in the vicinity of the line segment, it is likely that q A2 will regularly decrease until it reaches the lower end of the segment. Any further strategy experimentation on the part of the predator will lead to ½ q A2 vq Ã A2 , after which the only evolutionary outcome can be (0,0). In terms of evolutionary game theory again, the suboptimal NE component is not stable whereas the optimal NE is.
In summary, the optimal foraging behavior is selected in the prey recognition game as the NE component that is the stable outcome of the evolutionary learning process whether or not prey recognition time is short (i.e. for arbitrary t r ). The analysis of optimal foraging theory for this example illustrates anew the potential of game-theoretic methods to gain a better understanding of issues that arise in behavioral ecology.

Discussion
In this article, we develop a game-theoretic approach for constructing functional responses in multi-prey environments and for finding optimal foraging strategies based on these functional responses [9,20]. The approach here is based on methods from extensive form games [18,19]. The importance of these gametheoretic approaches for functional response is two-fold. First, decision trees similar to those used in extensive form games are a natural way to describe details of predator behavior based on the sequence of choices the predator makes at different decision points. This facilitates writing down the corresponding functional response. Second, we show that optimal foraging behavior that maximizes energy intake per unit time can be determined by solving the underlying foraging game for its Nash equilibrium. We documented these game theory methods through three examples: the classical diet choice model, simultaneous encounter with prey, and a model in which recognition time is considered. We remark that, although the calculation of the optimal foraging behavior in the first example is straightforward, it is not as easy in the last two cases where our game theory methods lead readily to the solution.
Decision trees are often used in evolutionary ecology to describe possible decision sequences of individuals in biological systems [28], including models of kleptoparasitism [38] and of producers and scroungers [39]. They have been used less often in connection with functional responses, even though the predation process can be conveniently described by such trees (e.g., [26,40,41]). Optimal foraging behavior that maximizes animal fitness is then often described as a sequence of single choices at each decision node faced by the predator. Such outcomes are reminiscent of those found by applying the backward induction technique to extensive form games that also chooses one strategy at each decision node [18,19]. However, there are essential differences. Specifically, under backward induction, the optimal choice at such a node depends only on the comparisons of payoffs along paths following this node. Unfortunately, the time constraint in our foraging game means that decisions at one node have payoff consequences as to what is optimal at another node, a connection between these decision nodes of the tree that has no counterpart in extensive form games. That is, the payoff concept for ''foraging games'' such as Figure 1 combines both the nutritional values and the duration of each activity given at all the end nodes of the decision tree. On the other hand, as shown in all three examples, the extensive form technique connected to backward induction of forming the reduced decision tree by truncating those paths corresponding to dominated strategies remains an effective means of considerably simplifying the NE analysis.
Dynamic programming (a form of backward induction) has also been used to find optimal foraging behavior [23,42]. Specifically, the approach developed by Houston and McNamara [23] shows that the optimal foraging strategy must maximize the difference between the expected energy intake during a single renewal cycle and the product of the mean optimal energy intake rate and the duration of the cycle. This approach specifies the optimal choice at each decision node provided the energy intake rate under the optimal strategy is known. Since the optimal choice in one part of the decision tree then requires knowing the overall optimal strategy, the solution is typically obtained by numerical iteration.
Instead, the approach we take in this article avoids such numerical methods by solving the game analytically. In this game, virtual players (also called agents) are associated with each decision point. These players are virtual because their payoff is derived from the functional response of a single individual only. Nevertheless, these players play a game because their decisions are linked, one player's optimal strategy depends on the other players' decision. We showed that solving this game by finding all the Nash equilibria will lead to the optimal foraging strategy. In those cases where some NE are not optimal foraging strategies, we showed it is easy to select the optimal ones among them by calculating their mean energy intake rate. Even when the game has infinitely many Nash equilibria that form a segment of a line (such Nash equilibrium components often arise in extensive form games), we showed that the energy intake rate at all these Nash equilibria will be the same. This means that once there are a finite number of isolated Nash equilibria points or Nash equilibrium components, finding the optimal strategy corresponds to comparing a finite number of values, which is trivial.
We documented these game-theoretic methods by applying them to three examples. The classic diet choice model with two prey types where predators encounter prey sequentially was considered first since it has been historically analyzed without game theory and yet provides an informative introduction to our new approach. Then we moved to a more complicated situation where a searching predator can simultaneously encounter both prey types [31,43]. These authors showed that under simultaneous encounter the predictions based on the prey profitabilities (i.e., energy content over handling time) are not sufficient to predict the optimal foraging strategy. In fact, the optimal foraging strategies can be quite complicated as they depend now also on the relation between the energy content in different food types. In particular, Figure 5A shows that when the less profitable prey type 2 contains also less energy than the more profitable prey type 1, then the more profitable prey type 1 will be selected when both prey types are encountered. However, when the energy content of the less profitable prey type is large (but still small enough that prey type 2 continues to be less profitable), it will be preferred when both prey types are encountered ( Figure 5B). The solid line in Figure 5B shows the preference for prey type A when encountered with prey type B. When this preference switches from 1 to 0 above p B~3 , predator preference for prey type B when encountered with prey type A switches from 0 to 1. All possible optimal foraging strategies as a function of the alternative prey type energy content are shown in Figure 4. In particular, it cannot happen that the less profitable prey type is included in the predator's diet when encountered simultaneously with the more profitable prey type but not taken when encountered alone.
The last model discussed in this article examines whether a predator should spend time to recognize which type of prey it encountered before deciding whether to attack the prey or not [32]. This example is more complex for several reasons, including the fact that the corresponding decision tree now has three different levels (whereas the previous two examples are described by two-level trees). While the NE corresponds exactly to the optimal strategy in two-level decision trees, this is not the case here. When recognition time is small, we show that there are NE of the optimal foraging game that lead to suboptimal foraging (Figure 7(a)). However, these suboptimal NE are easy to exclude by equilibrium selection techniques borrowed from evolutionary game theory [30]. Specifically, optimal foraging is always given by the unique NE outcome that corresponds to the stable equilibrium point (or set of equilibrium points) as the predator learns its optimal strategy (i.e. as its strategy evolves in the direction of the arrows in Figures 2, 4, 7). This method taken from evolutionary game theory to determine optimal foraging behavior differs from the more traditional approach based on the (modified) zero-one rule. This latter approach can be applied to the prey recognition game. Kotler and Mitchell [32] show that the zero-one rule yields just two possible optimal outcomes: either complete opportunism or completely selective. Instead of analyzing for the effects of increasing recognition time as we have done, they concentrate on what happens when the abundance of the less profitable prey increases (which, in our notation, means p 2 increases). They emphasize the somewhat counterintuitive result that, with low abundance, the less profitable prey is excluded from the diet. At intermediate abundances it is included, and then with high abundance it is excluded again.
Game-theoretic methods play an important role in the traditional approach as well. Specifically, because the energy intake rate is the same at all points of the NE component, we need to compare only two numbers; the energy intake rate at any point of the NE component (the gray line segment in Figure 7(a)) and the energy intake rate at the other NE point (0,0). Our analysis shows that, when recognition time is small, the optimal foraging strategy is to always pay the extra time to recognize the encountered prey type (i.e., never attack the encountered prey item immediately q A~0 , Figure 7(a)) and to include it in the diet if it is the more profitable prey type (i.e., not to include the alternative prey type 2, q A2~0 ). As the recognition time increases, the optimal foraging strategy is not to waste time recognizing the encountered prey type (Figure 7c, d). In this case, all encountered prey types are included in predator's diet and so q A2 is not uniquely defined. That is, since all encountered prey are immediately included in predator's diet, the question whether to include the recognized prey type in the diet becomes irrelevant and so the preference for the alternative prey type is any number between 0 and 1.
For the three optimal foraging games modeled in this paper, the predator's encounter probabilities with different prey types do not change over the system's renewal cycle. In particular, there are no interactions among predators, such as competition for the same prey, that may alter the length of this cycle as the predator's behavior in these interactions changes. On the other hand, interactions among predators can be added to their decision trees. Our analysis of optimal foraging behavior through extensive form game-theoretic methods can then be generalized to the resultant multi-level trees, an important area of future research.

Supporting Information
Appendix S1 The first section of the Appendix, Decision trees and the functional responses, describes a general approach to construct functional responses from decision trees. The second section, Zero-one rule and the Nash equilibrium, generalizes the classical zero-one rule of the optimal foraging theory derived for the multi-prey Holling type II functional response to a more general functional responses. This section also shows how the zeroone rule relates to the Nash equilibrium of the underlying optimal foraging game. Appendix Foraging with simultaneous resource encounters derives the Nash equilibrium strategy (8), (10) and Appendix The Nash equilibria of the prey recognition game derives the Nash equilibrium (13), (14). (PDF)