We use a software modelling approach to create a population of agents, who make a certain decision at every time step. The attribute that governs this decision is on a continuous scale from 0 to 1. Individuals are connected via links resulting in an underlying interaction network topology. The influence of link neighbours creates diffusion dynamics within the modelled population, leading to social contagion processes of the property in question. The model is generic in the sense that the actual decision that is made does not need to be specified and can be interpreted, e.g., as environmental awareness [22] or an investment in game theory [3].
Agent behaviour types
In addition to the structure of a population, social contagion is also deeply connected to the response of individuals to their surroundings. Not all individuals or groups react in the same way to their environment. While some are easier influenced by their peers and reciprocate observed behaviour, others might be less flexible and do not change their actions based on the behaviour of others. A simple example of such nonreciprocators is the strategy of socalled continuous cooperators in the public goods game [3]. These players do not deviate from their decision to always invest in the creation of a public good, even when their peers do not contribute.
In the presented model, the population is divided in three types of agents: nonreciprocative type A, nonreciprocative type B, and reciprocative type S. Their attribute is given by the decision mechanism, which differs for each type. This behavioural type, not to be confused with the contagious property, is constant over time for each individual. Type A and type B individuals abide to the same decision and cannot be influenced by their neighbourhood. Their decision attribute is constantly 0 and 1, respectively, and thus not directly affected by social contagion. Type S individuals make their decision using a bestresponse mechanism, reflecting the mean decision of its direct neighbourhood (link neighbours).
The focus of our investigation is on spreading dynamics and local pattern formation through the population share of reciprocal individuals S, induced by the decisions of nonreciprocal types A and B.
Network topologies
We use six different topology types, as shown in Fig. 1. Each nodes represents an individual. Link neighbourhood is shown via gray lines.

Both the grid topology (Fig. 1a) and the torus topology (Fig. 1b) consist of a regular distribution of link neighbours on a lattice (“large world”). The torus topology includes periodic boundary conditions.

The scalefree network (Fig. 1c) exhibits a distribution of degrees (i.e., number of links for each node) that follows a power law and is generated using the preferentialattachment algorithm by [1].

The cavepeople topology (Fig. 1d) is a version of the caveman networks [31] but with less symmetry. The algorithm uses a parameter to define the cluster size \(c_1\) and the number of clusters \(c_2\). The probability to have a link between individuals of the same cluster is 50%, and the probability of ties between clusters is \(4\ c_2\).

The spatialproximity topology (Fig. 1e) depicts networks with a high clustering based on spatial proximity and was introduced in [41] to model spreading dynamics of epidemics (SIR model).

The smallworld topology (Fig. 1f) is based on the Kleinberg model [20], using a lattice topology and a number of longrange links, added to the network, leading to a shorter average pathlength on the network. When adding longrange links, the probability of connecting two random nodes is proportional to \(1/d^q\) with q being the clustering coefficient and d the distance of the nodes.
Attribute distributions
The population consists of three different types of agents. The minority of the individuals in the system (\(10\%\)) are of the nonreciprocative type A or type B, with the identical population shares \(N_\text{A} = N_\text{B} = 5\%\). The majority of the population consists of reciprocal individuals type S with a population share \(N_\text{S} = 90\%\). The allocation gives the proportion of bonding (links between similar individuals) and bridging (links between different individuals), ultimately shaping the contagion dynamics. In random distributions, the average neighbourhood of all individuals is only influenced by the population shares. Homophilic distributions result in highly selfsimilar link neighbourhoods of each individual. Figure 2 shows the allocation mechanisms for different distributions of type A (green rectangles) and type B (red squares) and type S (black and coloured circles) on the network. Random positioning on the network results in mixed attribute distribution (Fig. 2a) which generally leads to low bonding and high bridging in the network. Ordered distributions (Fig. 2b, c) are given by homophilic allocations, generally leading to high bonding and low bridging.
Homophilic attribute distribution mechanism
To create homophilic attribute distributions, we use a mechanism to generate highly ordered allocations, which operates as follows: first, two random nodes are chosen. One of them is transformed into a type A node, and the other one into a type B node. All the other nodes do not have any type at this stage. Second, all link neighbours of type A and type B that do not have a type assigned to them yet are selected. The selected nodes form a ’pool’ of potential type A and type B nodes, respectively. In each step, a random node from the pool of potential type As is transformed into type A. Simultaneously, this process is done for the pool of potential type Bs, so that one type A and one type B are added in each step. This process is repeated until the desired number of types A and B is reached. When a pool becomes empty and further transformations are required, a new pool is created consisting of the typeless link neighbours of all already transformed nodes of type A or type B. All nodes which are not transformed into type A and type B are considered as reciprocal type S nodes. For the rare cases in which one type hinders the growth of the other type completely, such that the final number of \(N_\text{A}\) or \(N_\text{B}\) cannot be reached, the procedure is cancelled and the initial nodes of type A and type B are reselected.
Figure 2b shows this process on the grid topology for \(N_\text{A} = 11\) (green rectangles) and \(N_\text{B} = 11\) (red squares). The algorithm starts with the enlarged nodes and progresses to include the next proximate nodes of the neighbourhoods. Blue circles and orange circles mark nodes of the pools of potential candidates, which have not been selected to transform. Figure 2c shows the mechanism when type A and type B are in close proximity. Here, the pools of potential As and Bs intersect, such that the trait distribution evolves into deformed regions of type A and type B. However, in large populations, these cases are rarely observed for most of the used topology types, with the exception of scalefree networks.
Intermediate homophilic distributions
Social ties of populations are not necessarily static, but often dynamic. Who interacts with whom can change over time, leading to constant updates of the network structure [12, 46]. It has been shown that dynamic social networks can promote cooperation [37] and that adaptive networks have important consequences for the spreading of diseases [14].
Attribute distribution in realworld examples with social contagion typically displays intermediate states of mixed and homophilic allocations. Diffusion is known to be amplified by bridging ties, which link two otherwise unconnected network clusters [26, 45], weak ties [13], referring to less frequent interactions, and long ties [5], connecting socially distant locations. These notations are interchangeable to a certain degree. Structural changes associated with bridging can dramatically accelerate the spread of disease, the diffusion of job information, the adoption of new technologies, and the coordination of collective action [5].
Another aspect influencing diffusion in a societal context is relocation, such as student exchange and university enrolment [40], and migration, influencing the evolution of norms [29]. Leaving a familiar environment to replace it with a new neighbourhood introduces drastic changes to the network, both at the point of origin, as well as at the destination point and is thus of great interest when investigating attribute distribution effects in populations.
To capture variations in bonding and bridging, we introduce three gradual alterations mechanisms of the structural proximity between individuals. These mechanisms relate to the phenomena of adjusting of social ties, longrange interactions, and exchange of the societal environment. These random and targetoriented changes in the network have been implemented to test the robustness of diffusion effects under the homophilic attribute treatment.
Dynamic rewiring
To perform a dynamic analysis of the network, we adjust the social ties between individuals by a similar approach as presented in [38], but replacing the need for a satisfaction level and fitness with a random choice of individuals, keeping the rewiring dynamics as generic as possible. The adjustment of ties between an individual i and an individual j is done by removal of their link followed by rewiring of i with a random chosen link neighbour of j. The number of adjusted ties is given by R. An illustration of the rewiring of \(R=50\) is shown in Fig. 3a. Correlated with the adjustments, measuring the level of homophily can be done by calculating the mean of \(k_{i(x)}/k_i\) for each individual i with the link number \(k_{i(x)}\) of its neighbours of identical type X and link degree k.
In real social networks, individuals are able to leave the system and new ones are able to join. However, in our investigation, the number of individuals of certain types needs to be kept constant, so that different simulation runs can be compared. This means every time a individual of a certain type leaves the system, a new one needs to enter it. Since it does not enter at the same position, the new node might have different links, but the same type. Therefore, this process can also be approximated by dynamic rewiring.
Structural bridges and relocation
We increase bridging by adding long ties between nonreciprocative and reciprocative individuals. For illustion, Fig. 3b shows the homophilic attribute distribution with four longdistant links between randomly chosen type A and type S individuals (bridged type S nodes are highlighted as black circles). Furthermore, we perform positional swaps between two randomly chosen individuals, one nonreciprocative and the other of reciprocative type, to capture reallocations. Figure 3c shows the allocation of four swaps of type A with type S individuals when initially having the homophilic allocation (swapped type S nodes are highlighted as black circles).
For each long tie or swap, both individuals A and S are randomly chosen, with the additional condition that each individual is only allowed to swap once. In general, both mechanisms can be applied to the two nonreciprocative type A or type B, leading to a smooth transition from homophilic to mixed allocations when increasing the number of alterations. Since we are particular interested in changes which foster the promotion of a single behaviour in the population, we limit additional long ties and swapping to type A and type S individuals (targetoriented alterations) while leaving type B unaltered.