1 Introduction

The canonical evolutionary game theory model of Maynard Smith and Price (1973) plays an important role in biology, economics, political science, and other fields. Its equilibrium concept, an evolutionarily stable strategy (ESS) describes evolutionary outcomes in environments where populations are large and matching is uniformly random.Footnote 1 Since an ESS is a refinement of Nash equilibrium, it obviously cannot explain any behavioral departure from purely self-serving behavior in the one-shot Nash sense. In particular it cannot account for cooperative behavior in say, a prisoners’ dilemma, or shed light on altruism more generally, nor can it account for any other non-Nash behaviors such as spite (Hamilton 1970; Alger and Weibull 2012) or costly punishment (Fehr and Gächter 2000).

In order to explain such deviations from Nash behavior, evolutionary game theory turned to models with a finite number of agents hence departing from the first of the mentioned conditions of Maynard Smith and Price (1973). Thus in Schaffer (1988), the finite set of individuals have “market power” and can influence average fitness while making simultaneous decisions (playing the field). In the model preferred by Maynard Smith (1982)—namely repeated games—a few agents, usually just two, can perfectly monitor and record each others’ past actions and condition their strategies hereupon (in evolutionary theory, the repeated games approach is usually referred to as direct reciprocity). Both of these frameworks have led to a large body of research in economics and game theory (see e.g. Alós-Ferrer and Ania 2005; Leininger 2006; Samuelson 2002; Vega-Redondo 1997, and references therein).

Others, beginning with Wright (1921, 1922) and his F-statistic, focused on studying populations where individuals do not get matched in a uniformly random manner. When matching is non-uniformly random the fitness of an individual will depend on the group of individuals he is matched with, and groups with different compositions will on average meet with varying reproductive success (Kerr and Godfrey-Smith 2002); see also Bergström (2002). Take the prisoners’ dilemma. If cooperators have a higher chance compared to defectors to be matched with cooperators, matching is non-uniformly random, and specifically it is in this case assortative. If the matching is assortative enough, cooperators will end up receiving a higher average fitness than defectors and thus positive levels of cooperation can become evolutionarily stable. Assortative matching has also been shown to lead to more cooperative outcomes in Moran processes (Cooney et al. 2016).Footnote 2

Non-uniformly random matching is a realistic description in situations where a large group of individuals cannot perfectly monitor each others’ past behaviors but receive some signals about opponents’ types and exert some influence on the matching process (Wilson and Dugatkin 1997; Bergström 2003). It can also result due to prolonged interaction of individuals in separated groups (Maynard Smith 1964), if individuals are matched according to a “meritocratic matching” process in the sense of Nax et al. (2014), if matching depends on the geographical location of individuals (Eshel et al. 1998; Nowak and May 1992; Skyrms 2004), or if (genetically) similar individuals match assortatively as in models of kin selection (Hamilton 1964; Grafen 1979; Hines and Maynard Smith 1979; Alger and Weibull 2010; Ohtsuki 2010). Several other processes are listed in Bergström (2013) who also shows that the index of assortativity of Bergström (2003) and Wright’s F-statistic are formally equivalent. In general, the above conditions lead to what biologists refer to as structured populations.Footnote 3

Now, the existing literature on non-uniformly random matching usually deals with special cases—the typical being the two-player, two-strategy case where matching is assortative. Exceptions to this include Kerr and Godfrey-Smith (2002) who study many-player games with two strategies, van Veelen (2011) who uses a setting similar to ours and discusses inclusive fitness, and Alger and Weibull (2016) who develop a general model to investigate the evolutionary stability of preferences. Here we consider the general case and define Nash equilibrium and ESS within the resulting population game (Sandholm 2010, pp. 22–23). The fitness function of the population game is derived from two primitives: a (symmetric, normal-form game) payoff matrix and a function that assigns particular population compositions to group compositions (called a matching rule). Given this structure of fitness functions, we then show how several results known from population games carry through to our setting. In particular, any Nash equilibrium is a steady state for the replicator dynamic, any (Lyapunov) stable steady state for the replicator dynamic is a Nash equilibrium, and any ESS is an asymptotically stable state of the replicator dynamic.

More substantially, we push the literature forward by deriving results on the efficiency of the Nash equilibria of population games. A key point—well known from the prisoners’ dilemma—is that under uniformly random matching, Nash equilibrium may be inefficient in the sense that the average fitness of the population is not maximized. Since ESS and Nash equilibrium coincide in evolutionary models based on uniformly random matching, it follows that uniformly random matching generally fails to produce outcomes that are efficient. When matching is non-uniformly random, this raises the following question: If we keep the payoff structure fixed and vary the matching rule, will some matching rule lead to efficiency? Our main result in this regard (Proposition 3) tells us that any efficient outcome will in fact be a Nash equilibrium under some matching rule. Such efficient outcomes could, for example, be reached endogenously by populations who can influence the matching process.Footnote 4

The structure of the paper is as follows. Section 2 describes the general setup, introduces matching rules, and defines Nash equilibrium and ESS. Section 3 contains our main theoretical results. Section 4 provides a number of applications in two-player, two-strategy normal-form games. Finally, Sect. 5 concludes.

2 Population games under matching rules

In this section we formulate the basic model as a population game under the replicator dynamic (see Taylor and Jonker 1978, Sandholm 2010, pp. 22–23). At each point in time there is a unit mass of individuals each of whom follows one of \(m \in \mathbb {N}\) pure strategies. The individuals are drawn into groups of size \(n \in \mathbb {N}\) according to a particular protocol which we term a matching rule and describe in detail below.Footnote 5 In the groups, individuals execute their strategies and receive payoffs (fitness) determined by the composition of strategies in the groups they are drawn into. The average fitness level of individuals following a given pure strategy across the groups determines the strategy’s (overall) fitness and therefore the proportion of individuals that follow that pure strategy at the next point in time. This leads to a dynamical system of the replicator variety which we study in continuous time.

2.1 Groups and matching rules

Let \(M =\{1,\ldots ,m\}\) denote the set of pure strategies. An individual who follows (pure) strategy \(i \in M\) is interchangeably said to be of type i or an i-type. As mentioned, n is the (finite) group size. A group type \(g \in G \equiv \{ \hat{g} \in \mathbb {N}^m:\sum _{i \in M} \hat{g}_i=n\}\) is a vector that specifies a number of individuals \(g_i\) of each type \(i = 1,\ldots ,m\). With group size n and m pure strategies, there are \(\frac{(n+m-1)!}{n!(m-1)!}\) distinct group types (see Aigner 2007, p. 15). Hence the cardinality of the set of group types G is \(\gamma \equiv \frac{(n+m-1)!}{n!(m-1)!}\). To simplify notation in the following define \(P_{ig}=\frac{g_i}{n} \in [0,1]\), which is the fraction of individuals in group type g that are of type i. The matrix with typical element \(P_{ig}\) is denoted by \({{P}} \in \mathbb {R}^{m \times \gamma }\).

The frequency distribution of different (individual) types at a moment in time is called a population state and denoted by \({x}\in \Delta _m\) (throughout \(\Delta _m \equiv \{ {x} \in \mathbb {R}_+^m:\sum _{i=1}^m x_i=1\}\)). Note that the i’th element in a population state \({x}\) simply is the proportion of i-type individuals in the population. The frequency distribution of group types is called a group state and denoted \({z} \in \Delta _\gamma \) with \(z_g\) the proportion of groups of type g. A matching rule is a function that maps population states into group states.

Definition 1

(Matching Rule) A matching rule is a function \({f}:\Delta _m\rightarrow \Delta _{\gamma }\) such that

$$\begin{aligned} x_i=\sum _{g\in G}P_{ig}f_g({x}) \qquad \text { for all }i\in M \end{aligned}$$
(1)

or, more concisely,

$$\begin{aligned} {x}={P}{f}({x})\text {.} \end{aligned}$$
(2)

Note that \(P_{ig}f_g({x})\) is the fraction of the (total) population that is of type i and is allocated into a g-type group under the matching rule \({f}\). So (1) (or equivalently, (2)), ensures that the fraction of i-type individuals allocated into the different groups equals the fraction \(x_i\) of i-type individuals that are actually present in the population. This of course is an entirely natural consistency requirement given our interpretation of matching rules as mappings that allocate individuals into groups.

Let \(w_{ig}\) denote the fraction of i-type individuals that is allocated to a g-type group. It is easily seen that,

$$\begin{aligned} w_{ig}({x}) = \frac{P_{ig}f_g({x})}{x_i}, \end{aligned}$$
(3)

where of course \(x_i>0\) must hold (otherwise there would be no individuals of type i in the first place). Note that \(w_{ig}({x})\) (also) may be interpreted as the probability that an individual of type i is drawn into a group of type g.

2.2 Payoffs and equilibrium

Having described how agents are allocated into groups by means of a matching rule \({f}\), we now formulate the interaction as a population game (see Sandholm 2010, pp. 22–23 for example). Recall from the beginning of Sect. 2.1, that a group type g is a vector that specifies how many individuals of each of the m types reside in the group. Within each group individuals receive payoff according to a symmetric normal-form game. In such games the payoff of each player depends only on the strategy he follows and the number of other players that follow each of the m strategies (as opposed to who uses each strategy). The game is represented by a matrix \({A}\in \mathbb {R}^{n\times \gamma }\). Its typical entry \(A_{ig}\in \mathbb {R}\) is interpreted as the payoff a type i individual receives upon executing his strategy in group type g.Footnote 6

Since \(A_{ig}\) is the payoff to an individual of type i in group type g and \(w_{ig}({x})\) is the probability that an i-type individual ends up in a group type g (see the paragraph following Definition 1), the (ex-ante) population-wide expected payoff/fitness to an i-type individual when the population state is \({x}\) (and \(x_i>0\)) equals

$$\begin{aligned} F_i({x}) = \sum _{g \in G} w_{ig}({x})A_{ig}\text {.} \end{aligned}$$
(4)

This defines fitness functions \(F_i:\mathrm{int}\left( \Delta _m\right) \rightarrow \mathbb {R}\), that are the coordinate functions of \({F}:\mathrm{int}\left( \Delta _m\right) \rightarrow \mathbb {R}^m\).

We extend the definition of \({F}\) to include the boundary of \(\Delta _m\) by setting \(w_{ig}({x})=\lim _{\tilde{x}_i \downarrow 0}P_{ig}f_g({\tilde{x}})/\tilde{x}_i\) whenever \({x}\in \mathrm{bd}_i(\Delta _m)\).Footnote 7 We will assume that the matching rule \({f}\) is such that \({F}\) can be extended to a Lipschitz continuous function on \(\Delta _m\). Now notice that under condition (1), if \(P_{ig}>0\) (equivalently \(g_i>0\)), then \(\lim _{x_i\rightarrow 0} f_g({x})=0\) and so \(\lim _{\tilde{x}_i \downarrow 0}f_g({\tilde{x}})/\tilde{x}_i\) precisely is the i’th partial (upper) derivative of \(f_g\), \(\partial _i^+ f_g({x})\) when \(x_i=0\). Hence \(w_{ig}({x})=P_{ig}\partial _i^+ f_g({x})\) when \(x_i=0\).

Given the above observations, the following condition is sufficient to ensure Lipschitz continuity of \({F}:\Delta _m\rightarrow \mathbb {R}^m\).

Assumption 1

The matching rule \({f}\) satisfies the following:

  1. (i)

    \({f}\) is Lipschitz continuous

  2. (ii)

    if \({x}\in \mathrm{bd}_i(\Delta _m)\), then \(\partial _i^+ f_g({x})\) exist for all \((i,g)\in M\times G\) such that \(g_{i}>0\).

Note that the differentiability requirement is satisfied trivially if the matching rule is differentiable at the boundary of \(\Delta _m\).

In this way, through condition (4), a payoff matrix A and a matching rule f define the payoff function F. We identify the population game induced by A and f by this payoff function and write \(F^{A,f}\) to refer explicitly to the payoff matrix and matching rule. A Nash equilibrium of the induced game is defined as usual (Sandholm 2010, p. 24).

Definition 2

(Nash equilibrium) A Nash equilibrium of the induced population game \(F^{A,f}\) is a population state \({x}^*\in \Delta _m\) such that for \(i\in M\) with \(x^*_i>0\):

$$\begin{aligned} F^{A,f}_i({x^*}) \ge F^{A,f}_k({x^*}) \text { for all }k\in M. \end{aligned}$$
(5)

Following standard arguments, continuity of \({F}^{A,f}\) implies that a Nash equilibrium exists. Therefore, a population game under a matching rule \({f}\) that satisfies Assumption 1 is guaranteed to have a Nash equilibrium.

In the evolutionary game theory literature, the key equilibrium refinement concept is that of an Evolutionarily Stable Strategy or State (ESS). ESS is usually defined in games with uniformly random matching and in the special case when \(n=2\) (see for example Hofbauer and Sigmund 1998, p. 63). Since matching can be non-uniformly random, there are possible nonlinearities introduced into the payoff function through the matching rule f. Thus, the appropriate definition of an ESS needs to have the local character of Pohley and Thomas (1983). We formulate the definition by means of a uniform invasion barrier (see e.g.  Sandholm 2010, p. 276) as in this manner what “local” means is made clear.

Definition 3

(ESS) An ESS of the induced population game \(F^{A,f}\) is a population state \({\hat{x}}\in \Delta _m\) for which there exists \(\bar{\varepsilon }>0\) such that for all \({y}\in \Delta _m{\setminus } \lbrace {\hat{x}}\rbrace \) and all \(\varepsilon \in (0,\bar{\varepsilon })\)

$$\begin{aligned} {\hat{x}}\cdot {F}^{A,f}(\varepsilon {y}+(1-\varepsilon ) \hat{{x}})>{y}\cdot {F}^{A,f}(\varepsilon {y}+(1-\varepsilon ) \hat{{x}}). \end{aligned}$$
(6)

Assumption 1 ensures that \(F^{A,f}\) is continuous. Therefore, if it holds the standard result that an ESS is a refinement of Nash equilibrium applies.

Proposition 1

Let \(F^{A,f}\) be the population game induced by payoff matrix A and matching rule f. Let also \({f}\) satisfy Assumption 1. Then any ESS of \(F^{A,f}\) is a Nash equilibrium.

Proof

By way of contradiction, assume that some \({\hat{x}}\in \Delta _m\) is an ESS but not a Nash equilibrium. Then, there exists some \({y}\in \Delta _m\) such that \(({y}-{\hat{x}})\cdot {F}^{A,f}\left( {\hat{x}}\right) >0\). But from the definition of an ESS, there exists some \(\bar{\varepsilon }\in (0,1)\) such that \(({y}-{\hat{x}})\cdot {F}^{A,f}\left( \varepsilon {y}+(1-\varepsilon \right) {\hat{x}})<0\) for all \(\varepsilon \in (0,\bar{\varepsilon })\). As explained before, the two conditions of Assumption 1, imply continuity of \({F}^{A,f}\). By continuity therefore \(({y}-{\hat{x}})\cdot {F}^{A,f}\left( {\hat{x}}\right) \le 0\), a contradiction. \(\square \)

2.3 Examples of matching rules

Before turning to describe the dynamical system that will determine the evolution of the population in our model, we provide some examples of matching rules. Note that all of the examples satisfy Assumption 1.

2.3.1 Complete segregation

Different strategies do not mix. All individuals are allocated into groups with only individuals of the same type and thus all groups contain a single type of individuals each (n individuals that follow the same strategy). The group types that have n individuals of the same type get a non-negative frequency whereas all other kinds of groups get a frequency of zero. Due to the consistency requirements for matching rules, we get that the group type that contains n i-types should get a frequency of \(x_i\). So, formally, the matching rule for complete segregation is the following.

$$\begin{aligned} \begin{array}{ccl} f_g\left( {x}\right) =x_i,&{}\quad \text {if }P_{ig}=1\\ f_g({x})=0,&{}\quad \text {otherwise.} \end{array} \end{aligned}$$
(7)

For example, say Say \(n=2\) and \(m=2\) with the two strategies being C and D. There are three group types: \(\{CC\}\), \(\{CD\}\) and \(\{DD\}\). The matching rule for complete segregation takes the form

$$\begin{aligned} f_{\{CC\}}(x_C,x_D)=x_C\qquad f_{\{CD\}}(x_C,x_D)=0\qquad f_{\{DD\}}(x_C,x_D)=x_D. \end{aligned}$$

2.3.2 Uniformly random matching

Let us define an opponent profile to be a collection \(\nu =(\nu _j\in \mathbb {N})_{j\in M}\) such that \(\sum _{j=1}^m\nu _j=n-1\). We denote the set of all opponent profiles by \(\mathbb {O}\). The set \(\mathbb {O}\) consists of all possible combinations of types of other individuals that an individual can find in the group in which he is matched.

A matching rule \({f}\) is going to be called uniformly random if the ex-ante probability of an individual (conditional on her type) to face an opponent profile \(\nu \) is independent of the individual’s type, for all \(\nu \in \mathbb {O}\). If this is the case, then the frequencies of group types will follow a multinomial distribution (see for example Lefebvre 2007, p. 22):

$$\begin{aligned} f_g({x})=\frac{n!}{\prod _{j=1}^mg_{j}!}\prod _{j=1}^mx_j^{g_{j}}\text {.} \end{aligned}$$
(8)

One can easily verify that expression (8) indeed describes a matching rule i.e.  that it satisfies (1). To show that the property described above holds for the matching rule of equation (8), first observe that an opponent profile \(\nu \in \mathbb {O}\) along with an individual-type \(i\in M\) uniquely define a group-type. Since \(g_{j}\) is the number of j-type individuals in a g-type group, the group-type created by adding an i-type individual to an opponent profile \(\nu \) will have the following structure:Footnote 8

$$\begin{aligned} g_{j}=\left\{ \begin{array}{ll} \nu _j+1 &{}\quad \text {if }j=i\\ \nu _j &{}\quad \text {if }j\in M{\setminus }\{i\}\end{array}\right. \text {.} \end{aligned}$$
(9)

So, the probability of an i-type individual to end up in a group where she faces the opponent profile \(\nu \) is the same as the probability of an i-type individual to end up in a group with a structure given by (9).

Now recall that the probability of an i-type individual (conditional on her type) to end up in a g-type group is given by \(w_{ig}({x})\) of equation (3). Using this formula for the matching rule of equation (8) yields

$$\begin{aligned} w_{ig}({x})=\frac{P_{ig}}{x_i}f_g({x})=\frac{g_{i}}{nx_i}\frac{n!}{\prod _{j=1}^mg_{j}!}\prod _{j=1}^mx_j^{g_{j}}=\frac{x_i^{g_{i}-1}}{(g_{i}-1)!}\frac{(n-1)!}{\prod _{j\in M{\setminus }\{i\}}g_{j}!}\prod _{j\in M{\setminus }\{i\}}x_j^{g_{j}}\text {.} \end{aligned}$$

Applying this for the particular group that has the composition given by (9) and noting that \(\nu _i=g_{i}-1\) and \(\nu _j=g_{j}\) for all \(j\ne i\), we get that the probability of an i-type to face an opponent profile \(\nu \) is

$$\begin{aligned} \frac{x_i^{\nu _i}}{\nu _i!}\frac{(n-1)!}{\prod _{j\in M{\setminus }\{i\}}\nu _{j}!}\prod _{j\in M{\setminus }\{i\}}x_j^{\nu _{j}}=\frac{(n-1)!}{\prod _{j=1}^m\nu _{j}!}\prod _{j=1}^mx_j^{\nu _{j}} \end{aligned}$$

which only depends on the opponent profile \(\nu \) and the population state \({x}\) i.e.  it is independent of the indiviudal’s type i. Therefore expression (8) describes a uniformly random matching rule.

Notice that for \(m=2\), the uniformly random matching rule becomes

$$\begin{aligned} f_g(x_1,x_2)=\frac{n!}{g_{1}!g_{2}!}x_1^{g_{1}}x_2^{g_{2}}. \end{aligned}$$

That is it boils down to the binomial distribution (see Kerr and Godfrey-Smith 2002, p. 484). And for \(n=2\), we get

$$\begin{aligned} f_{(2,0)}(x_1,x_2)=x_1^2\qquad f_{(1,1)}(x_1,x_2)=2x_1x_2\qquad f_{(0,2)}(x_1,x_2)=x_2^2. \end{aligned}$$

2.3.3 Constant index of assortativity (2 strategies)

Bergström (2003) studies 2-person prisoners’ dilemma population games by using the “index of assortativity” which he defines as “the difference between the probability that a C-strategist meets a C-strategist and the probability that a D-strategist meets a C-strategist.” In terms of notation used in this paper this means that the index of assortativity when the population state is \((x_C,x_D)\) will be:

$$\begin{aligned} \alpha (x_C,x_D)\!=\!{w}_{C\{CC\}}(x_C,x_D)\!-\!{w}_{D{\{CD\}}}(x_C,x_D)\!=\!\frac{f_{\{CC\}}(x_C,x_D)}{x_C}-\frac{f_{\{CD\}}(x_C,x_D)}{2x_D}. \end{aligned}$$

Bergström goes on to analyze prisoners’ dilemma games under assortative matching rules for which the index of assortativity \(\alpha \) is constant for all values of \({x}\). As one easily verifies, the matching rule corresponding to a constant index of assortativity \(\alpha \) is:

$$\begin{aligned} \begin{array}{ccl}f_{\{CC\}}(x_C,x_D)&{}=&{}\alpha x_C+(1-\alpha )x_C^2\\ f_{\{CD\}}(x_C,x_D)&{}=&{}2(1-\alpha )x_Cx_D\\ f_{\{DD\}}(x_C,x_D)&{}=&{}\alpha x_D+(1-\alpha )x_D^2.\end{array} \end{aligned}$$

In the case of \(\alpha =0\) the rule coincides with the random matching rule and in the case of \(\alpha =1\) it coincides with the complete segregation rule (for both of these statements we need \(n=m=2\), i.e., two players and two strategies).

2.3.4 (Almost) constant index of dissociation

It is not possible to use the previous definition of a constant index of assortativity rule for negative values of \(\alpha \)i.e. to dissociative matching—without violating the consistency condition (1) that defines matching rules. Indeed, if such a “constant index of dissociation” rule is imposed without any changes, the matching rule would necessarily violate (1) when \(x_C\) is close to 0 or to 1: in the former case there are not enough C-types with whom the D-types should be matched and vice versa when \(x_C\) is close to 1.Footnote 9 So, to consider a matching rule with an index of dissociation that is constant whenever it is possible, one must “tweak” the construction slightly near the boundary. In the matching rule we propose, we deal with that by matching as many individuals as possible in mixed groups and the remaining individuals in homogeneous groups. So, a matching rule with an (almost) constant index of dissociation \(\beta \in [0,1]\) is given by the following:

$$\begin{aligned} {f}(x_C,x_D)= & {} \left( f_{\{CC\}}(x_C,x_D),f_{\{CD\}}(x_C,x_D),f_{\{DD\}}(x_C,x_D)\right) \\= & {} \left\{ \begin{array}{ll} (0~,~2x_C~,~1-2x_C~) , &{}\quad x_C\in \left[ 0, \frac{\beta }{1+\beta }\right] \\ \left( (1+\beta )x_C^2-\beta x_C~,~2(1+\beta )x_Cx_D~,~(1+\beta )x_D^2-\beta x_D~\right) ,&{}\quad x_C\in \left( \frac{\beta }{1+\beta },\frac{1}{1+\beta }\right) \\ (1-2x_D~,~2x_D~,~0~), &{}\quad x_C\in \left[ \frac{1}{1+\beta },1\right] \end{array} \right. . \end{aligned}$$

2.3.5 Constant index of assortativity (m strategies)

The constant index of assortativity rule of 2.3.3 can be extended to 2-player games with more than two strategies (Bergström 2013) where the index \(\alpha \) denotes the proportion of individuals of any given type to enter a pool that consists only of individuals of the same type (and get matched to individuals from within their pool). The remaining proportion \((1-\alpha )\) enters a common pool where individuals match uniformly randomly. This description generates the following matching rule in our formulation:

$$\begin{aligned} \begin{array}{llll} f_{\{ii\}}({x})&{}=&{}\alpha x_i+(1-\alpha )x_i^2&{} \\ f_{\{ij\}}({x})&{}=&{}2(1-\alpha )x_i x_j&{}\text {if }j\ne i. \end{array} \end{aligned}$$

2.3.6 Constant index of uniform group formation (n players, 2 strategies)

Following a similar way of thinking as in Sect. 2.3.5, an assortative matching rule can be extended to n-player games with two strategies/types. The rule of Eq. (10) describes the following process: a proportion \(\alpha \) of each of the two types enters a pool that consists only of individuals of the same type and (uniform) n-sized groups are formed from within these two pools. The remaining proportion \((1-\alpha )\) enters a common pool where individuals are drawn to form n-sized groups uniformly randomly. This leads to the matching rule being

$$\begin{aligned} \begin{array}{l} f_{(0,n)}(x_C,x_D)=\alpha x_D + (1-\alpha )x_D^n\\ f_{(k,n-k)}(x_C,x_D)= (1-\alpha )\frac{n!}{k!(n-k)!}x_C^kx_D^{n-k}\quad \text {for }k=1,2,\ldots ,n-1\\ f_{(n,0)}(x_C,x_D)=\alpha x_C + (1-\alpha )x_C^n. \end{array} \end{aligned}$$
(10)

2.4 Dynamics

Let \({x}^t\in \Delta _m\) denote the population state at time t. At time t, the population is allocated into groups according to the matching rule \({f}\), hence \({f}\left( {x}^t\right) \in \Delta _{\gamma }\) is the resulting frequency distribution of group types. Regardless of which group an individual of type i ends up in, he will mechanically follow the strategy of his type (as inherited from the parent) and fitness will be distributed accordingly. The average fitness that an i-type individual receives is given by (4), repeated here for the reader’s convenience and with explicit reference to the payoff matrix and matching rule:

$$\begin{aligned} F^{A,f}_i({x}^t) = \sum _{g \in G} w_{ig}({x})A_{ig}\text {.} \end{aligned}$$
(11)

The average fitness across the entire population is,

$$\begin{aligned} \overline{F}^{A,f}\left( {x}^t\right) =\sum _{i=1}^m x^t_i F^{A,f}_i\left( {x}^t\right) ={x}^t\cdot {F}^{A,f}\left( {x}^t\right) . \end{aligned}$$
(12)

All that now remains is to describe how these fitnesses determine the next generation. For this, we use the continuous-time replicator dynamic (Taylor and Jonker 1978) which formalizes the idea that the rate at which the proportion of i-type individuals grows is equal to the amount by which type-i average fitness (\(F^{A,f}_i\)) exceeds the population-wide average fitness (\(\overline{F}^{A,f}\)).

Definition 4

The continuous-time replicator dynamic of the induced population game \(F^{A,f}\) is given by the equations:

$$\begin{aligned} \dot{x}_i^t=x_i^t\left( {F}^{A,f}_i({x}^t)-\overline{F}^{A,f}({x}^t)\right) \qquad \text {for }i\in M \end{aligned}$$
(13)

with \(F^{A,f}_i\) and \(\overline{F}^{A,f}\) defined in equations (11) and (12), respectively.

Definition 5

A steady state of the induced population game \(F^{A,f}\) is a rest point of the dynamical system (13).

Notice that as we do not assume any linearity of the matching rule \({f}\), the fitness functions \(F^{A,f}_i\), \(i=1,\ldots ,m\) will typically be nonlinear. This is in contrast with the linear fitness functions obtained under uniformly random matching. Different notions of stability such as Lyapunov and asymptotic stability are defined as usual in either case, and the associated steady states (if any) are said to be Lyapunov stable, asymptotically stable, and so on. Since any uniform population state—i.e., any state where all individuals are of the same type—will be a steady state, it is clear that stability must be considered or else the model will have no predictive power.

3 Results

In this section we provide our main theoretical results. First we establish that several well-known results from the population games literature extend to games induced by matching rules as long as the latter are well-behaved. Secondly, we show that efficient outcomes can always be supported as Nash equilibria of population games induced by appropriately selected matching rules.

3.1 Dynamic stability and equilibrium

In evolutionary models with uniformly random matching, there is a close relationship between dynamic models of the replicator type and game theoretic concepts such as Nash equilibrium and evolutionarily stable strategies (e.g. Hofbauer and Sigmund 1998, Theorem 7.2.1; Weibull 1995, Proposition 3.10).Footnote 10 Given our formalization of matching rules, similar results hold for population games induced by well-behaved (satisfying Assumption 1) non-uniformly random matching rules. In particular (i) any Nash equilibrium is a steady state of the replicator dynamic, (ii) any Lyapunov stable state as well as any any limit of an interior orbit under the replicator dynamic is a Nash equilibrium, and (iii) any evolutionarily stable strategy of \(F^{A,f}\) is asymptotically stable for the associated replicator dynamic.Footnote 11

The next proposition shows that population games induced by the uniformly random matching rule of Sect. 2.3.2 have the same steady states and ESS as their standard normal-form game counterparts. In this way our concept of matching rules extends the scope of the tools of evolutionary game theory in a consistent manner.

Proposition 2

Let \(F^{A,f}\) be the population game induced by payoff matrix A and the uniformly random matching rule f, given by Eq. (8). Then, the set of Nash equilibria of \(F^{A,f}\) coincides with the set of symmetric Nash equilibria of the underlying normal form game \({A}\). Moreover, the set of ESS of \(F^{A,f}\) coincides with the set of ESS of \({A}.\)

Proof

See Appendix B.1. \(\square \)

3.2 Matching rules and efficiency

Assortative matching has been shown to be able to explain behavioral traits such as altruism or cooperation which cannot arise in Nash equilibrium and so cannot be favored by natural selection if matching is uniformly random, as seen in Proposition 2 (e.g.  Alger and Weibull 2013, 2016). Importantly, such departures from self-regarding behavior may be more efficient than the outcomes under uniformly random matching in the sense that the average fitness may be higher. The classical example here is the prisoners’ dilemma where the outcome of uniformly random matching yields lower average fitness than outcomes under assortative matching (see Sect. 4 and also Bergström 2002). In what follows, the welfare notion that we have in mind is a utilitarian one. Thus, efficiency will be measured by the level of average fitness in the population.

The observation that uniformly random matching—or for that matter any other specifically given matching rule \({f}\)—may not maximize average fitness in a Nash equilibrium \({x}^*\) also remains valid if instead of Nash equilibria we focus on ESS. Thus, evolution under non-uniformly random matching certainly does not imply average fitness maximization. The interesting next question therefore is whether for a fixed underlying normal form game A there exists some matching rule under which average fitness will be maximized at a Nash equilbrium of \(F^{A,f}\). When discussing this topic it is important to understand that when \({f}\) is varied, not only does the set of Nash equilibria (and ESS and also, the set of steady states of the replicator dynamics) change—the efficiency level \(\overline{F}^{A,{f}}({x})\) will also change at any given population state \({x}\). So if some population state maximizes average fitness but is not a Nash equilibrium under some matching rule \({f}~\!'\), it could be a Nash equilibrium under a different matching rule \({f}~\!''\) but no longer maximize average fitness. Any sensible discussion must therefore consider the joint selection of a population state and matching rule as captured by the following definition.

Definition 6

(Evolutionary Optimum) Let \({A}\) be a symmetric n-player, m-strategy normal form game. A population state \({x}^* \in \Delta _m\) together with a matching rule \({f}^*\) is said to be an evolutionary optimum if

$$\begin{aligned} \overline{F}^{A,{f}^*}({x}^*)\ge \overline{F}^{A,{f}}({x}) \text { for all }({x},{f})\in \mathbb {E}=\left\{ ({x},{f}): {x} \text { is a steady state of }F^{A,f}\right\} . \end{aligned}$$

Intuitively, a population state \({x}^*\) and a matching rule \({f}^*\) form an optimum if they lead to maximum average fitness among all population state/matching rule combinations that satisfy the steady state restriction. Note that the restriction to steady states is entirely natural here: any population state that is not a steady state of the replicator dynamics would immediately be “destroyed” by natural selection.Footnote 12 Given these definitions, we can now answer the previous question:

Proposition 3

Let \(({x}^*,{f}^*)\) be an evolutionary optimum. Then there exists a matching rule \({h}\) which satisfies Assumption 1, such that \({x^*}\) is a Nash equilibrium under \({h}\) and \(({x^*},{h})\) is an evolutionary optimum. In particular, \(\overline{F}^{A,{h}}({x}^*)=\overline{F}^{A,{f}^*}({x}^*)\).

Proof

See Appendix B.2. \(\square \)

We obtain the result of Proposition 3 by constructing the matching rule \({h}\) so that types that are not in the support of \({x}^*\) are matched in homogeneous groups, away from other types. In this way these types cannot be receiving higher fitness than the average fitness at \({x}^*\) as \(({x}^*,{f}^*)\) is an evolutionary optimum.

Proposition 3 is telling us that any evolutionary optimum can be attained in the evolutionary environment through some matching rule. That this should be so is easy to see in simple cases. In most standard games (including some of those considered in this paper), there is a premium on coordination/uniformity, and so what is needed in order to reach an evolutionary optimum is a sufficiently high level of assortativity. In games where there is a premium on agents in a group being different—e.g., due to specialization—it will instead be a sufficiently high degree of dissociation that leads to evolutionary optimality. It is not obvious that proposition 3 should hold in the latter case, to say nothing of cases where neither assortative nor dissociative matching rules do the trick.

4 Applications

In this section we apply the concepts that were developed earlier in the paper to analyze some 2-player 2-strategy symmetric, normal form games that are frequently encountered in the literature under matching rules that have a constant index of assortativity (see Sect. 2.3.3). Namely, we consider the Hawk-Dove (HD) game, the Stag Hunt (SH), and the Prisoners’ Dilemma (PD). In all games considered, there is a “cooperative” strategy in the sense that use of this strategy by one player increases the payoff of the player’s opponent. Table 1 provides the names by which the two strategies are referred to in the literature for each of the games along with the games’ defining conditions.Footnote 13 To simplify notation, we will always refer to the Cooperative strategy as C and to the other strategy as D. More than that, we use the following numbers to index the three possible group types: group-type 1 consists of two C-type individuals, group-type 2 is the mixed group-type and group-type 3 consists of two D-type individuals. Finally, when calculating equilibria and steady states for the population games, we will use x to denote the proportion of the population that follows strategy C. Example payoff matrices of the game classes that are considered here are found in Table 3. In the Appendix we develop a method to find Nash equilibria and ESS in \(2\times 2\) population games induced by matching rules and to depict average fitness contours.

Table 1 List of strategy names and defining conditions for the \(2\times 2\) games considered
Table 2 Defining conditions for the three PD game categories (along with \(A_{D2}>A_{C1}>A_{D3}>A_{C2}\))
Table 3 Example payoff matrices for the \(2\times 2\) games considered

Interestingly, in the case of a constant index of assortativity rule, the payoffs from the two strategies are such that it is as if the individuals in the population are playing a \(2\times 2\) game with altered payoffs under uniformly random matching. This is shown in Table 4. The reason for which this is possible with the constant index of assortativity matching rule is because \(f_2\) is proportional to \(x(1-x)\) (see Sect. 2.3.3) and thus the appropriate terms in the payoff functions \(F^{A,f}_i\) conveniently cancel out. Such a simple transformation is not possible with more complicated matching rules.

Table 4 The transformation of symmetric \(2\times 2\) normal-form games resulting from a constant index of assortativity rule. The payoffs displayed are for the row player

Using the transformed game of Table 4, we can characterize the Nash equilibria and ESS of the population game using the definitions of the concepts: when \(\alpha <1\) an \(x\in (0,1)\) is a Nash equilibrium iff

$$\begin{aligned} x\left( A_{C2}-A_{C1}+A_{D2}-A_{D3}\right) =A_{C2}-A_{C1}+\frac{A_{C1}-A_{D3}}{1-\alpha }, \end{aligned}$$

and when \(\alpha =1\) any \(x\in (0,1)\) is a Nash equilibrium iff \(A_{C1}=A_{D3}\). An \(x\in (0,1)\) is an ESS if—together with the above condition—the following hold: \(\alpha (A_{D2}-A_{D3})< A_{D2}-A_{C1}\) and \(\alpha (A_{C1}-A_{C2})> A_{D3}-A_{C2}.\)Footnote 14 Moreover, \(x=0\) is a Nash equilibrium iff \(\alpha (A_{C1}-A_{C2})\le A_{D3}-A_{C2}\), whereas \(x=1\) is a Nash equilibrium iff \(\alpha (A_{D2}-A_{D3})\ge A_{D2}-A_{C1}\). Each of the two uniform population states is an ESS if the respective inequality holds strictly.

Our analysis shows that the \(2\times 2\) games considered have fundamentally different comparative statics with respect to the assortativity parameter \(\alpha \) depending on whether \(A_{D2}+A_{C2}\) is greater or less than \(A_{C1}+A_{D3}\). In particular, if \(A_{D2}+A_{C2}>A_{C1}+A_{D3}\) (which is the case in the HD and sub-additive PD), then for any value of \(\alpha \) the induced population game \(F^{A,f}\) has a unique Nash equilibrium which is also an ESS. On the contrary, for normal-form games with \(A_{D2}+A_{C2}<A_{C1}+A_{D3}\) (which is the case in the SH and super-additive PD) there are regions of the assortativity parameter \(\alpha \) for which the replicator dynamic equation is bistable and the induced population game has three Nash equilibria: one ESS at \(x=1\) where the whole population follows the cooperative strategy (C), one ESS at \(x=0\) where the whole population follows the other strategy (D) and a Nash equilibrium which is not an ESS where part of the population follows C and another part of the population follows D (polymorphic equilibrium). Finally, the case where \(A_{D2}+A_{C2}=A_{C1}+A_{D3}\) (linear PD) is a transitional case and includes a continuum of neutrally stable Nash equilibria for a particular value of the assortativity parameter. These results can be seen in Fig. 1.

Fig. 1
figure 1

Nash equilibria as a function of the index of assortativity for the games of Table 3

Risk Dominance In the case of normal form games with \(A_{D2}+A_{C2}<A_{C1}+A_{D3}\), there is a value of the index of assortativity \(\alpha ^*=\left( \left( A_{D2}-A_{C2}\right) -\left( A_{C1}-A_{D3}\right) \right) /\left( \left( A_{D2}-A_{C2}\right) +\left( A_{C1}-A_{D3}\right) \right) \) for which the basin of attraction of the ESS at \(x=1\) is greater than that of the ESS at \(x=0\) iff \(\alpha \in ( \alpha ^*, 1]\). We can interpret that as follows. Assume that individuals in the population do not know whether each of the other players is going to play C or D and so, using the principle of insufficient reason, they ascribe equal probabilities (equal to 0.5 each) to each other player following C and D.Footnote 15 Then, if \(\alpha \in ( \alpha ^*,1]\) the expected payoff for a player following C is higher than his expected payoff when he follows D and so, given the aforementioned beliefs, it is a best response for all of them to follow C, leading to the population state being \(x=1\). Conversely when \(\alpha \in [ 0,\alpha ^*)\).

So, in the terms described above, we can have a notion of risk dominance in the induced population game. Of course, as in both the SH and the super-additive PD it is true that \(A_{D2}+A_{D3}>A_{C1}+A_{C2}\), when \(\alpha =0\) (uniformly random matching) the risk dominant equilibrium is the one where the whole population follows D (\(x=0\)).

Efficiency When faced with a normal-form game payoff matrix, one might ask what the population state \(x^*\) that maximizes average fitness (under uniformly random matching) is.Footnote 16 One might then try to achieve efficiency by naïvely implementing \(x^*\) as a Nash equilibrium through the application of an appropriate matching rule. The problem in the above is that if the rule that needs to be used is non-uniformly random, then the average fitness in equilibrium will (generically) differ from the one calculated in the beginning and may also no longer be optimal (maximum). We make such efficiency comparisons for our selected classes of games in what follows.

Fig. 2
figure 2

Equilibrium average fitness and normal form game payoff for the games of Table 3

In order to conduct efficiency analysis, we use the methodology described in section A.3 of the Appendix. The comparison between Nash equilibrium average fitness in the induced game \(F^{A,f}\) and expected payoff in the normal form game when both players use the same strategy for our class of games is shown in Fig. 2. Notice that in the HD and SH cases the equilibrium efficiency curve is not defined for some values of x as these states cannot be attained as Nash equilibria of \(F^{A,f}\) under any matching rule f.

In all our classes of games, the level of Nash equilibrium average fitness is strictly increasing with the proportion of C-individuals in the population and thus, Nash equilibrium efficiency is achieved when the Nash equilibrium is \(x=1\) i.e. when the whole population follows C. Now, in the case where \(A_{C2}+A_{D2}\le 2A_{C1}\) (which is true for all SH, super-additive PD, and linear PD games), maximum Nash equilibrium average fitness coincides with the maximum expected payoff players using symmetric strategies can get in the normal form game (which is attained when both players play C with certainty). In the case where \(A_{C2}+A_{D2}>2A_{C1}\) (which can only hold for some HD and some sub-additive PD games), the normal form game maximum expected payoff (under symmetric strategy profiles) is obtained if both players play C with probability \(p_C^*=\frac{A_{C2}+A_{D2}-2A_{D3}}{2(A_{C2}+A_{D2}-A_{C1}-A_{D3})}\).Footnote 17 However, when a matching rule that makes \(x=p_C^*\) an equilibrium is implemented, equilibrium average fitness is reduced below \(A_{C1}\). This is because the proportion of CD pairs—which are efficient in the utilitarian sense—is reduced in favor of more DD and CC pairs which are not as efficient.

4.1 Discussion

Despite some similarity between the two settings, our results differ from those of Alger and Weibull (2013) due to the different nature of the strategy sets and, conseqently, of the assortativity considered.Footnote 18 In particular, even in their “finite games” example, where they analyze \(2\times 2\) normal-form games, Alger and Weibull (2013) take the set of mixed strategies (an infinite, convex set) as the relevant strategy set. An evolutionarily stable strategy in their model is a mixed strategy \(s\in \Delta _m\) such that if the whole population uses s, it cannot be invaded by a (uniform) population using any other mixed strategy \(s'\in \Delta _m\). The index of assortativity is then defined based on differences of probabilities of residents and invaders to encounter a resident i.e.  between mixed strategies. In our model, assortativity is between pure strategies, that are the only ones available to the population. Assortative matching between mixed strategies makes payoffs to the two types nonlinear in the population state. Such nonlinearities cannot be captured in our pure-strategy case (as is shown in Table 4).

One could think that we could recover the results of Alger and Weibull (2013) if the resident population was considered to be using a pure strategy, say C. Even in this case our results differ though, since Alger and Weibull (2013) assume that the population withstands invasion from strategies arbitrarily close to the resident one whereas in our setting, the only possible invading strategy would be the “other” strategy D. Of course, since they only consider stability of homogeneous populations, any polymorphic equilibrium where both strategies are present in the population (see for example the HD game above) is excluded in Alger and Weibull (2013) as that would automatically render both strategies evolutionarily unstable.

5 Conclusion

This paper had two main purposes. Firstly, to extend the existing machinery of evolutionary game theory to include non-uniformly random matching under arbitrary matching rules and group sizes; and secondly, to discuss the relationship between matching and equilibrium efficiency. In Sect. 3.1 we showed that several results that hold for Nash equilibria and evolutionarily stable strategies under uniformly random matching extend to our setting (as one would expect from the literature on population games). As for efficiency, our main result (Proposition 3) showed that any evolutionary optimum will be a Nash equilibrium of the induced population game under some matching rule.

Often, matching is a geographical phenomenon: think of viruses, neighborhood imitation amongst humans, or trait-group/haystack-model-type of interactions (Cooper and Wallace 2004; Maynard Smith 1964; Wilson 1977). But when matching rules correspond to institutions or conventions, not explaining how they come about misses half the story. A clear weakness of most existing models—including the results in this paper—is in this connection that the matching rules are taken as given. An obvious topic for future research would be to model the evolution of the matching rules (i.e., to endogenize them). An example of such an attempt is Nax and Rigos (2016) who endogenize the matching process via allowing individuals to vote for either more or less assortativity. Another direction could involve monitoring: If individuals gain an advantage by increasing their ability to monitor (by increasing their intelligence and memory), we can see how matching rules will over time evolve to be less and less random (typically more and more assortative). This then would be a true endogenous description of matching (institutions, conventions). The simplicity of the framework presented in this paper should definitely put such theories of evolving matching rules within reach.