Abstract
Psychological explanations of group genesis often require population heterogeneity in identity or other characteristics, whether deep (e.g., religion) or superficial (e.g., eye color). We used agent-based models to explore group genesis in homogeneous populations and found robust group formation with just two basic principles: reciprocity and transitivity. These emergent groups demonstrated in-group cooperation and out-group defection, even though agents lacked common identity. Group formation increased individual payoffs, and group number and size were robust to varying levels of reciprocity and transitivity. Increasing population size increased group size more than group number, and manipulating baseline trust in a population had predictable effects on group genesis. An interactive demonstration of the parameter space and source code for implementing the model are available online.
Across locations and time, humans have lived together in stable groups that display within-group cooperation and out-group antagonism. Tribes, platoons, countries, sports teams, and corporations all persist, favoring “us” over “them.” How do such groups emerge? One answer is that groups form along observable preexisting differences in physical (e.g., race) or cultural (e.g., language) characteristics. However, such observable differences often emerge as a result of people living in distinct groups, which makes this answer somewhat circular. We suggest that groups can emerge in completely homogeneous populations of interacting agents as long as two simple conditions—reciprocity and transitivity—are met. We use agent-based modeling to show that repeated network interaction under these two conditions gives rise to groups. These models suggest that group genesis and perpetuation need not require common identity, shared goals, or cultural differences.
Identity and the Problem of Heterogeneous Populations
Social identity is the predominant paradigm for understanding intergroup phenomena (Brewer & Kramer, 1985; Dovidio, Gaertner, & Validzic, 1998; Tajfel, 1982). In this framework, groups are defined in terms of the individuals who identify themselves as members of those groups (Reicher, 1982). Such identification, whether based on deep (e.g., religion or race) or superficial (e.g., eye color or art preferences) characteristics, predicts both in-group favoritism and out-group antagonism (Brewer & Kramer, 1985; Harmon-Jones, Greenberg, Solomon, & Simon, 1996; Tajfel, Billig, Bundy, & Flament, 1971). Social identity provides an intuitive way of understanding group formation, but identity-based groups—even minimal groups—require preexisting differences among people (i.e., population heterogeneity), whether fundamental (Kunda, 1999) or superficial (Efferson, Lalive, & Fehr, 2008). Although people differ along many dimensions (e.g., race, language, religion, and political orientation), such differences often arise on the basis of preexisting grouping—if only via geographical separation (Howells et al., 1966). This suggests potential circularity in the role of social identity: Groups form because people are different, but people are different because they belong to different groups. To escape this circularity, we examined whether groups form in completely homogeneous populations through two basic principles of social interaction.
Conditions for Group Genesis: Reciprocity and Transitivity
Reciprocity—A helps (or harms) B, and B in turn helps (or harms) A—is a ubiquitous feature of life for organisms ranging from vampire bats and birds to monkeys and humans (Fudenberg, Rand, & Dreber, 2012; Olendorf, Getty, & Scribner, 2004; Trivers, 2006; Wilkinson, 1984). Because reciprocity depends on repeated interactions over time (Trivers, 1971), it occurs more frequently between individuals who are interpersonally close (e.g., friends) rather than distant (e.g., foreign pen pals). Reciprocity is not only a consequence of interpersonal closeness but also a cause, as people prefer to interact more with (i.e., become closer to) those who cooperate more with them (Rand, Arbesman, & Christakis, 2011; Van Lange & Visser, 1999; Wang, Suri, & Watts, 2012).
Transitivity is the phenomenon that individuals generally share their friends’ opinions of other people (Louch, 2000). Imagine a triad of people—A, B, and C. If A and B are friends, and A likes (or dislikes) C, then B should also like (or dislike) C. In short, triads should be balanced such that friends of your friends should be your friends, and enemies of your friends should be your enemies (Heider, 1958). 1 When triads are unbalanced (e.g., you hate your spouse’s best friend), the resulting dissonance (Moore, 1978) causes one person—typically, the one who cares least—to change his or her opinion (Davis, 1963). If A slightly likes C, but B completely hates C, A’s opinion is more changeable than B’s.
We suggest that these two phenomena—reciprocity and transitivity—are sufficient for the emergence of groups within homogeneous populations. More concretely, groups should spontaneously evolve when (a) people move closer to those who cooperate with them, (b) people cooperate more with those who are closer to them, and (c) people move closer to their friends’ friends and move further from their friends’ enemies. 2 The effects of reciprocity and transitivity are well documented in isolation (Dal Bó, 2005; Davis, 1970; Fudenberg et al., 2012; Holland & Leinhardt, 1971), and we suggest that their repeated combination can transform a population of individuals without identity—or any differences whatsoever—into stable, cohesive groups that favor the in-group over the out-group.
Analytic Approach
Psychological research on social dynamics often examines one-time dyadic interactions in isolation, but intergroup phenomena often emerge from the repeated interaction of multiple individuals over time. Studying these multi-agent phenomena was once prohibitively time-consuming (Sherif, 1961), but modern computational techniques can simulate emergent phenomena through agent-based modeling. Agent-based models are programs in which simulated individuals (agents) interact through time according to simple rules (Bonabeau, 2002; Macy & Willer, 2002; Smith & Conrey, 2007). Although the models are rule based, the large number of simulated individuals and interactions allows the emergence of complex behavioral patterns (Marsella, Pynadath, & Read, 2004; A. Nowak, Szamrej, & Latané, 1990; Smith & Conrey, 2007; Vallacher, Read, & Nowak, 2002). Agent-based modeling has been used, for example, to examine the density at which crowds turn lethal (Seabrook, 2011), the origins of preferences for fairness (Rand, Tarnita, Ohtsuki, & Nowak, 2013), and the manner in which people pair with romantic partners (Kalick & Hamilton, 1986).
We used agent-based modeling to examine whether reciprocity and transitivity induce group formation in homogeneous populations. Consistent with previous research on the evolution of cooperation in biology, psychology, and economics (Axelrod & Hamilton, 1981; Fudenberg & Maskin, 1986; M. A. Nowak & Sigmund, 1992; Van Lange, Ouwerkerk, & Tazelaar, 2002), our study used a prisoner’s dilemma game to represent cooperative interactions between agents. In a single prisoner’s dilemma, two people interact, and each has the choice to cooperate or defect. Cooperators pay a cost to give a larger benefit to the other person, whereas defectors maximize their own payoff at the expense of the other person. This simple game captures the essence of social dilemmas: the tension between what is best for the individual (defection) and what is best for the group (cooperation). Figure 1 presents the payoffs used in our simulations.

Summary of the prisoner’s dilemma payoffs used in the simulations. Each of two players has the option to cooperate or defect; cooperation makes the dyad as a whole better off, but is individually costly because defection maximizes the individual’s payoff within a single round.
Although defection maximizes individual payoffs in a single prisoner’s dilemma, repeated interactions allow for reciprocity to develop over time (Fudenberg & Maskin, 1986; Rand & Nowak, 2013; Trivers, 1971). If two people see each other often, it can be payoff maximizing for either of them to cooperate today in order to earn reciprocal cooperation tomorrow. Note that reciprocal strategies can involve changing relational closeness (Rand et al., 2011; Van Lange & Visser, 1999): If A cooperates with B, B is more inclined to interact with A in the future, whereas if A defects, B is less inclined to interact with A.
In our simulations, agents played a series of prisoner’s dilemmas within an initially uniform network (i.e., all agents were equally close to one another at the outset). The probability of both interaction and cooperation was proportional to closeness, or how much players “liked” each other (e.g., “I am close to people whom I see often and to whom I am nice”). Reciprocity was instantiated by allowing agents to adjust their closeness to their partner after each interaction (e.g., “he was nice, so I will move closer”). Transitivity was instantiated by allowing agents to adjust their closeness with third parties on the basis of their partner’s preferences after each cooperative interaction (e.g., “he was nice to me, and he is friends with her, so I will move closer to her, too”). These agent-based simulations provided a formal proof of whether reciprocity and transitivity can induce group genesis in homogeneous populations.
To evaluate the generalizability of these models, we examined two additional variables: individual payoffs and trust (vs. suspicion). The prevalence and apparent benefits of groups within diverse evolutionary settings (Olson, 1965) suggest that groups may increase individual payoffs. We measured payoffs in our simulations, predicting that conditions conducive to group genesis—the presence of reciprocity and transitivity—would yield higher individual payoffs than conditions unfavorable to group genesis. We also manipulated the population level of trust by varying agents’ baseline likelihood of cooperation in the prisoner’s dilemma. We predicted that more trusting agents (i.e., those who more readily cooperated in a prisoner’s dilemma) would form large inclusive groups (like communes), and more suspicious agents would form small, splintered groups (like terrorist cells).
In addition to making a theoretical contribution to the understanding of group genesis and perpetuation, we hope to make agent-based modeling more accessible to psychological science, so we have provided a version of the MATLAB code we used for our simulations (with comments) in the Supplemental Material (for another guide, see Smith & Conrey, 2007). To further emphasize the flexibility of agent-based modeling, we have provided an interactive Web site based on this code: www.mpmlab.org/groups/ (Fig. 2); researchers who visit this site can experiment with the model parameters and experience the power of reciprocity and transitivity to induce group genesis.

Screenshot of the interactive online demonstration (available at www.mpmlab.org/groups/).
Method: Translating Reciprocity and Transitivity Into Code
Imagine a group of identity-less strangers airlifted to a desert island. As they roam, they occasionally run into one another, and when they do, they each have the chance to cooperate or defect. If both cooperate, they become friends and try to see each other more often; if both defect, they become enemies and try to see each other less often (reciprocity). If one defects and the other cooperates, there is no change in overall closeness because although the cooperator dislikes being taken advantage of, the defector likes a sucker. As people become friends, they become more likely to cooperate when they happen to meet, and as they become enemies, they become more likely to defect. People also have the chance to learn what their friends think of third parties (a process akin to gossip in the real world) and can adjust their preferences accordingly: They move closer to their friends’ friends and further from their friends’ enemies (transitivity). We suggest that repeated interaction of reciprocity and transitivity will rapidly transform selfish, identity-blind agents into stable groups. We used agent-based modeling to computationally test this idea.
Our model is based on four steps.
Probability of interaction: The closeness between players is represented in our model by a symmetric matrix, C. Each cell represents the closeness of player n (column) and player m (row). Thus, the cell C(4,5), which is equal to the cell C(5,4) because the matrix is symmetric, represents the likelihood that players 4 and 5 interact. Initially, all the cells in the matrix are set to .5 (range: 0–1), such that all players are neither close nor far from each other (i.e., they are indifferent). Each round, a random pair of players (n and m) is selected, and a random number between 0 and 1 is generated. If the value of C(n,m) is higher than this random number, players n and m interact; otherwise they do not, and another pair and new random number are selected. In the model, as in real life, greater closeness leads to more interaction.
Interaction behavior and payoffs: When two players n and m interact, they play a prisoner’s dilemma, each deciding whether to cooperate or defect, and each receiving a payoff based on the matrix shown in Figure 1. Two random numbers are generated, one for player n and one for player m. If the players’ closeness—the value of C(n,m)—is higher than a player’s random number, then that player cooperates. If not, then that player defects. For example, if C(n,m) is .80, n’s random number is .91 and m’s random number is .15, then n defects and m cooperates. In the model, as in real life, greater closeness leads to more cooperation.
Reciprocity—moving closer or further from partners: If both players cooperate, they move closer; that is, the value of C(n,m) increases. The amount by which their closeness increases is determined by the reciprocity mobility parameter, r: The distance between C(n,m) and 1 (maximum closeness) is divided by r, and the resulting value is subtracted from 1 to arrive at the new value of C(n,m). For example if C(n,m) for mutually cooperating players is .70 and r is 2, then the distance between .70 and 1 is divided by 2 and subtracted from 1; thus, C(n,m) increases to .85. If r is 3, then the distance between .70 and 1 is divided by 3, and C(n,m) increases to .90. Conversely, if both players defect, they move away from one another; the difference between their current closeness and the minimum closeness value of 0 is divided by r to arrive at the new value of C(n,m). For example, if C(n,m) is .75 and r is 3, the new C(n,m) is .25. No change in C(n,m) occurs when one player cooperates and the other defects. In sum, r represents the tendency of players to reciprocate by changing their future interaction probabilities; values of r greater than 1 instantiate reciprocity.
Transitivity: If both players cooperate, then transitivity operates, and the players compare their closeness to all other players other than themselves. In other words, if n and m both cooperate, they compare C(n,x) with C(m,x) for all x ≠ n,m. Whoever of n and m has the weaker opinion (i.e., smaller absolute difference from the midpoint of .50) adjusts his or her closeness to the target player x by a factor of t, the transitivity mobility factor. For example, if C(n,x) is .62 and C(m,x) is .10 (m really hates x, whereas n likes x only mildly 3 ), and if t has a value of 2, then C(n,x) becomes .31 (half of .62). In less mathematical terms, if Fred and Bob cooperate, they discuss all their mutual acquaintances and shift their views to be more in line, with more extreme views swaying less extreme views. It should generally be true that t is less than r, as direct experience with someone (captured by r) should shape opinions more strongly than hearsay (captured by t). In sum, t represents the mobility of players with transitivity; values of t greater than 1 allow for transitivity.
Steps 1 through 4 are repeated for as long as desired, but most usefully until the matrix stops changing appreciably (i.e., until groups become stable).
Results: The Genesis of Groups
We used this model to answer four specific questions: Do groups form in homogeneous populations under conditions of reciprocity and transitivity? What are the configurations of these groups across parameter space? How are individual payoffs influenced by group-promoting conditions? How does trust influence group genesis? We answered each of these questions by conducting simulations across parameter space, averaging 100,000 model iterations of at least 10,000 rounds for each configuration.
Do groups form in homogeneous populations under conditions of reciprocity and transitivity?
To quantify the extent to which our population of agents forms groups, we used the standard global clustering coefficient used in network science (e.g., Opsahl & Panzarasa, 2009). This value ranges from 0 to 1, with 0 indicating a complete absence of clustering and 1 indicating the presence of completely distinct groups. Fixing N at 50 and varying r and t over the integer values between 1 and 10, we found perfect group formation (clustering coefficient of 1) in all simulations in which there was both reciprocity (r > 1) and transitivity (t > 1). Group genesis was also robust across the number of players (Fig. 3).

Clustering coefficient as a function of round in simulations with reciprocity (r) fixed at 3 and transitivity (t) fixed at 2. Results are shown for seven different numbers of players (N = 10–100). Each line represents averages obtained across 100,000 simulation iterations.
What are the configurations of these groups across parameter space?
Reciprocity (r) and transitivity (t)
Fixing N at 50 and varying r and t across the parameter space in which groups form (1 < r ≤ 10, 1 < t ≤ 10), we found substantial robustness in group configurations. As Figure 4 shows, increasing reciprocity led to slightly fewer but larger groups, and increasing transitivity led to slightly more but smaller groups. However, these effects were relatively small, which suggests that the dynamics of group genesis are generalizable and not specific to particular levels of reciprocity and transitivity. Of course, as in the real world, there was large variability in group formation across individual simulations. Randomness and path dependence mean that simulations with identical parameters may lead to one large group, a couple of similarly sized groups, or even mostly isolated individuals.

Number of groups and group size as a function of the level of reciprocity (r) and transitivity (t) in the model (low = 2, high = 10). Each line represents averages obtained across 100,000 model iterations of 10,000 rounds with N (number of players) = 50.
Number of players (N)
Fixing r at 3 and t at 2, we varied N between 10 and 100 in increments of 5, and this variation exerted a large influence on group structure. As shown in Figure 5, increasing N increased both group size and group number, but group size increased much more dramatically than group number. These results suggest that large populations typically form a small number of large groups rather than a large number of small groups (see Fig. 6). This result is corroborated by real-world data in the networks literature, in domains ranging from collaboration networks of scientists to the structure of the political blogosphere (Girvan & Newman, 2002; Lazer et al., 2009).

Group size and number of groups as a function of the number of players (N). Each line represents averages obtained across 100,000 model iterations of 10,000 rounds with r (reciprocity) = 3 and t (transitivity) = 2.

Typical emergent group structure from simulations for two different population sizes: 10 players (left) and 50 players (right). The smallest circle represents a single player, and larger circles represent groups of increasing size.
How are individual payoffs influenced by group-promoting conditions?
Our agents spontaneously formed into groups, but were they better off for having done so? Average individual payoffs could range from −3 to 3 (Fig. 1); random strategy selection would yield an average payoff of 0, and cooperation of both players would yield an average payoff of 1. Without reciprocity or transitivity (r = 1, t = 1, no groups), agents remained indifferent to each other and interacted at random, earning an average payoff of 0. The same was true of agents with transitivity but no reciprocity (r = 1, t > 1). Reciprocity alone (r > 1, t = 0) allowed individual pairs of agents to learn to cooperate and increased the average payoff to 0.24. With both reciprocity and transitivity (r > 1, t > 1), agents were able to form cooperative groups, and the average payoff increased substantially, to 0.47. Increasing the population size increased payoffs because larger groups conferred more cooperating members, but this effect was relatively small (N = 10: average payoff = 0.44; N = 100: average payoff = 0.49).
How does trust influence group genesis?
Interpersonal trust was manipulated by adjusting players’ baseline cooperation likelihood—given by C(n,m)—by adding a constant, A. To make players more suspicious, we made their probability of cooperating lower than C(n,m) by defining A as less than 0; to make them more trusting, we made their probability of cooperating higher than C(n,m) by defining A as greater than 0. In other words, suspicious players cooperated only with relatively closer others, whereas trusting players cooperated even with relatively distant others.
The influence of trust can be examined via the clustering coefficient (see Fig. 7). When A was sufficiently negative, suspicion prevented players from cooperating and forming stable bonds; the result was a landscape of completely isolated individuals (clustering coefficient = 0). When A was sufficiently positive, not only did groups form quickly, but players formed one large group (akin to a commune). Thus, group formation was predictably influenced by trust, and this result increases the psychological generalizability of this model.

Clustering coefficient as a function of round in simulations with 10 different baseline levels of trust (A). Each line represents averages obtained across 100,000 iterations with N (number of players) = 50, r (reciprocity) = 3, and t (transitivity) = 2. Note that the x-axis is log10-scaled.
General Discussion
Our model provides a simple but powerful tool for studying group genesis, and reveals not only the necessary conditions for group formation, but also the configuration of the resulting groups, the influence of group-promoting conditions on individual payoffs, and the impact of trust. Our results suggest that groups form robustly under conditions of reciprocity and transitivity, for all observed population sizes. Despite high variability across individual simulations, group structure was robust to varying parameter values of reciprocity and transitivity, and responded systematically to population size. Analyses of individual payoffs suggest that conditions for group genesis are adaptive, and manipulating psychological context—trust versus suspicion—coherently influenced group formation. Our agent-based model provides a parsimonious explanation for group genesis: Reciprocity and transitivity combine over time to bind together selfish, identical, and identity-blind agents into distinct clusters.
Consistent with these results, research has documented robust group formation under conditions of reciprocity and transitivity in relatively homogeneous real-world populations, including hunter-gatherers in Tanzania (Apicella, Marlowe, Fowler, & Christakis, 2012), graduate business students at a mixer (Ingram & Morris, 2007), and monk novitiates at an American monastery (Sampson, 1969; illustrated in Fig. 8). In addition, research has documented the power of reciprocity and transitivity to amplify group formation in social networks—to transform even modest degrees of in-group preference into striking patterns of segregation (Kossinets & Watts, 2009; Wimmer & Lewis, 2010). To our knowledge, our research is the first to demonstrate robust group emergence in a fully homogeneous population.

Endogenous group genesis within a relatively homogeneous population of monks in a single monastery (Sampson, 1969). Each dot represents a single monk, and arrows represent ties between monks. Clustering calculations reveal two groups of size 7, one group of size 3, and one isolated individual.
Our work provides a first simple step in modeling group genesis, and future models should explore more complex scenarios. For example, it will be important to examine multigroup formation (i.e., multiplexity; Krohn, Massey, & Zielinski, 1988) because individuals typically belong to multiple groups across different social contexts (e.g., work units, friendship groups, and athletic teams). Smaller groups (e.g., state Democrats) are often subsumed within larger groups (e.g., national Democrats), and so future research might examine hierarchical group formation. More complex reciprocity rules could also be examined. For simplicity, our model assumes that interpersonal closeness remains constant after a prisoner’s dilemma with one cooperator and one defector. Given that research points to the greater power of negativity over positivity (Baumeister, Bratslavsky, Finkenauer, & Vohs, 2001), we ran new simulations in which defection was more powerful than cooperation: When one player cooperated and the other defected, the two players moved somewhat further apart. As in the earlier simulations, stable groups formed, although the clustering coefficient took a small initial dip (from .50 to .43) before proceeding monotonically to maximum clustering (at 1.00), as before. Finally, model complexity could be increased by moving from dyadic interactions to multiplayer interactions. In the Supplemental Material, we present a generalization of the prisoner’s dilemma model to n-player public-goods games and again document robust group genesis.
Our research highlights the importance of understanding social phenomena across levels (Bonabeau, 2002; Brewer, 2013; Gray, Young, & Waytz, 2012; Macy & Willer, 2002; A. Nowak et al., 1990; Smith & Conrey, 2007; Vallacher et al., 2002). In isolation, factors such as reciprocity and transitivity may seem insufficient for group formation, but research has highlighted the ability of complex higher-level phenomena to emerge from simple lower-level principles (Sawyer, 2005; Vallacher et al., 2002; van Veelen, García, Rand, & Nowak, 2012). For example, research on social physics explains phenomena ranging from the direction in which people face at music festivals to the link between group fidgeting and dissolution (Pennebaker, 2003).
Agent-based models shed light on both the configuration of groups and the variability of group formation across a variety of parameters. These phenomena are difficult to examine in the lab because of the vast number of participants required for reliable estimates of effects, and because randomness and path dependence make group configurations sensitive to the outcome of initial interactions (Ingram & Morris, 2007). Previous research has also investigated group genesis (e.g., Efferson et al., 2008; Schelling, 1969, 1971); however, those investigations relied on preexisting differences within the populations studied, such as racial differences (Schelling, 1971) or differences in T-shirt logos (Efferson et al., 2008), whereas we have shown that individual behaviors can lead to group formation even in completely homogeneous populations. Our results provide a parsimonious account of group genesis.
Footnotes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
