Opinion formation on dynamic networks: identifying conditions for the emergence of partisan echo chambers

Modern political interaction is characterized by strong partisanship and a lack of interest in information sharing and agreement across party lines. It remains largely unclear how such partisan echo chambers arise and how they coevolve with opinion formation. Here, we explore the emergence of these structures through the lens of coevolutionary games. In our model, the payoff of an individual is determined jointly by the magnitude of their opinion, their degree of conformity with their social neighbours and the benefit of having social connections. Each individual can simultaneously adjust their opinion and the weights of their social connections. We present and validate the conditions for the emergence of partisan echo chambers, characterizing the transition from cohesive communities with a consensus to divisive networks with splitting opinions. Moreover, we apply our model to voting records of the US House of Representatives over a timespan of decades to understand the influence of underlying psychological and social factors on increasing partisanship in recent years. Our work helps elucidate how the division of today has come to be and how cohesion and unity could otherwise be attained on a variety of political and social issues.

TE, 0000-0001-7191-7252; FF, 0000-0001-  Modern political interaction is characterized by strong partisanship and a lack of interest in information sharing and agreement across party lines. It remains largely unclear how such partisan echo chambers arise and how they coevolve with opinion formation. Here, we explore the emergence of these structures through the lens of coevolutionary games. In our model, the payoff of an individual is determined jointly by the magnitude of their opinion, their degree of conformity with their social neighbours and the benefit of having social connections. Each individual can simultaneously adjust their opinion and the weights of their social connections. We present and validate the conditions for the emergence of partisan echo chambers, characterizing the transition from cohesive communities with a consensus to divisive networks with splitting opinions. Moreover, we apply our model to voting records of the US House of Representatives over a timespan of decades to understand the influence of underlying psychological and social factors on increasing partisanship in recent years. Our work helps elucidate how the division of today has come to be and how cohesion and unity could otherwise be attained on a variety of political and social issues.

Introduction
In a political context of growing partisanship and echo chamber formation, a natural question is how such a culture of division arose and what might be to come in the future if the trend continues. To address this question using an opinion formation & 2018 The Authors. Published by the Royal Society under the terms of the Creative

Model
Let us denote by X the vector of opinions of all nodes in the network, where X i refers to the belief of the ith node. The values of the X i are allowed to range in the interval [21,1], where negative values indicate disagreement and positive values denote agreement with a given proposition. Greater magnitudes indicate stronger opinions. Let C represent the weighted adjacency matrix of the network, composed of the weights on the connections between any pair of two nodes in the network, with C ij referring to the connection between the ith node and the jth node. For the purpose of our model, the connections between nodes are considered to be symmetrical, meaning that C ij ¼ C ji . The value of C ij can range between zero and one, where zero indicates that there is no connection between i and j and one indicates the strongest possible tie between the two.
The payoff (i.e. fitness) of a node in the network is determined as the sum of three different factors: the strength of the node's opinion, the node's level of agreement with neighbouring nodes in the network (nodes with which the node in question has a non-zero connection) and the degree of the node (the total sum of the weights of the node's connections). The importance of each of these three components is described by the parameter a, b and g, respectively.
rsos.royalsocietypublishing.org R. Soc. open sci. 5: 181122 For a network of size N, the fitness of an individual node i is given by (2:1) The first and third terms of the fitness function are the benefits for a greater magnitude of opinion and more connection with neighbouring nodes, respectively, and their forms are self-explanatory. For a given node, the second term sums over all other nodes in the network, determining the cognitive dissonance accrued by interaction with each of them [35,36]. Note that where X i and X j are of opposite sign, meaning that the nodes i and j disagree, their contribution to the second term of the fitness function will be negative. Thus disagreeing nodes incur a penalty. The penalty is scaled by the strength of the connection between the two nodes, as the effects of cognitive dissonance will be most pronounced when there is a strong influence between individuals, thus making contradictory opinions harder to ignore.
The purpose of our model is to understand the behaviour of an opinion network given a set of initial conditions including the starting connections between nodes of the network, the initial beliefs of the nodes in the network and the parameters of the fitness function. The coevolution of network connections and opinions is achieved through an iterative process of mutation ( perturbation) that amounts to a simplified genetic algorithm: changes are made to both connection and opinion values in the network during each iteration, with predetermined step-sizes. At each step, only those changes that improve the fitness of the network are kept (see details in the Methods section). Over many iterations, these random mutations improve the network, leading ultimately to a resting stable state.

Results
Let us start with qualitatively understanding the long-term coevolutionary dynamics of network connections and individual opinions. We make the assumption that the nodes' initial beliefs are distributed randomly over the full range of beliefs and that there exists no initial bias on the connections between nodes (nodes of similar opinions are not already clustered for instance). As shown in equation (2.1), the fitness function of an individual i can be improved unilaterally by increasing the magnitude of its opinion X i , regardless of their network connections. This suggests that individuals tend to adopt extreme opinions, either þ1 or 21 in the long term, and the direction will be determined by the initial configurations within their local neighbourhoods.
Furthermore, taking the partial derivatives of f i with respect to C ij , we obtain We find that node i is likely to increase the strength of its connection to node j, if X i X j . 2g/b. Similarly, we find that node i tends to increase its magnitude of opinion, if P X j C i,j . Àsign(X i )a=b. In particular, for b . g, nodes with opposite views are much more likely to become disconnected, and hence the resulting network tends to divide into two echo chambers with splitting views. To illustrate these effects, we turn to computer simulations to study how the long-term behaviour of the network depends on the parameters b and g (see Methods). Figure 1 demonstrates that the parameter choices of b and g mainly drive the coevolutionary dynamics of opinion and networks. Figure 1a,b reflects what can happen when b is dominant rather than g. There is an initial stage of divergence, but in this case it reduces over time. As the value of maintaining connections is lower than it was for the convergent network, the relationships between nodes that disagree quickly deteriorate, leaving entirely separate populations. In this final state, the nodes in the network have no cognitive dissonance. Their opinions are entirely aligned with those of the other nodes present in their local community. We can relate this scenario to the real-world phenomena of political echo chambers. People with similar opinions group together to the extent that they never hear opinions differing from their own. These results complement other research into decision-making and economic games on evolving networks [37,38]. Figure 1c,d shows that cohesive communities with a consensus of opinion can be obtained for fixed a and b , g. In this case, there is often an initial phase in which opinions become more extreme on both sides of the argument, but then are turned around such that the network converges to consensus (figure 1d). This apparent change in opinion is a result of the coevolving network structure, which at the turn around point has created sufficient connections between individuals that do not agree, such that there is greater benefit to moving toward the same opinion than otherwise (figure 1c). With g higher, rsos.royalsocietypublishing.org R. Soc. open sci. 5: 181122 however, the likelihood of connection overwhelming initial extremism is higher, as early on, more connections are formed. We might expect such an arrangement in the real world in the case of family members; here, it is difficult to rapidly change the level of communication with other individuals on a given topic, but there is still benefit to maintaining cognitive consistency. We would expect this to promote the ultimate convergence of opinions in the local network at least.
To help gain a complete picture of these results, we perform comprehensive simulations across the parameter space (g, b), as shown in figure 2. This illustrates some of the intuitions that might be gained from the analytical solutions for the behaviour of a single node. Where b exceeds g, it is generally expected that there will be division for example, and this is indeed what we see in the plot (figure 2a,b). Where b is small, it is expected that there will be division of opinion, but with a reasonable level of connections in the network. These are the cases located near the bottom of the plot (figure 2a). Interestingly, the divisions between these critical regions are not perfect; there are sprays of random model runs on both sides of the various divides in the plot which defy the expectation given the parameter values. Over many runs, we use these values to form a plot of the variance across the parameter space as in figure 2b.
As revealed by our sensitivity analysis ( figure 2a,b), besides entirely split networks and fully connected networks (figure 1), it is possible to have sub-community formation with multiple levels of inter-group connections (figure 2c,d). Indeed, this is what we find in the case of the US House of Representatives voting records [39]: there is rarely complete consensus or complete division.
We can understand these simulation results intuitively as follows. The a and b terms tend to drive the network opinions apart and the connections between them to zero, whereas the g term tends to pull the network together. The specific parameter choices determine the balance between these two forces, and therefore can lead to a variety of typical behaviours of the coevolutionary dynamics of opinions and networks (figures 1 and 2). It should be noted that the influence of the initial structure of the network on its final state may be drastic. There exist cases in which the initial structure of the network, due to the random initialization used, biases the behaviour of the network to such a great extent that it reverses what would have happened in a graph without any such bias. In particular, these might be cases where by chance a random division in the connections of the network is aligned with the divisions in the opinions of the nodes. This might lead to division in the network regardless of the ratio between the parameters b and g. Alternatively, there may be a case in which there is a strong initial connection between nodes of different opinions, promoting the development of consensus where there might normally have been division. There may also be initial biases, arising from the random initialization by chance, in the distributions of the opinions of the nodes. If the belief values chosen are particularly skewed to one side, even where the values are within their prescribed positive or negative ranges, it may be the case that the nodes will reach consensus when the parameters would normally have induced division. Similarly, a distribution of beliefs that contain only extreme opinions to begin with may stay that way even if the parameters might have predicted consensus. It is notable that the model does not allow people to hold on to weak opinion values for very long. Even for weak a values, once groups are somewhat separated, the b term leads to a mutual reinforcement of opinion between nodes. The greater the magnitudes of the beliefs of the nodes in question, the larger the b term can become, benefiting both of the nodes in question.
As a real-world application of our model, we use voting records of the United States House of Representatives over a timespan of decades [39], to understand the influence of underlying psychological and social factors on increasing partisanship in recent years. This dataset has been previously considered as an excellent example for the measurement of network division over time [39]. House members were considered to have a positive belief level if they identified with the democrats and negative belief level if they were republican. While party affiliation clearly encompasses a broad range of beliefs, we take it as a proxy for belief on a particular topic. Figure 3 shows the calculated division values for different trial years, which span over the last five decades (each year indicating a session of the House of Representatives), along with the inferred model parameter ratio b/g. Figure 4 shows network snapshots over time that are generated by our model with best-fitted parameter values. We found evidence to support that the relative emphases of opinion conformity (represented by b) and general connection (represented by g) have been changing over time. Over this time period, we can see that both network division values and the ratio of b and g have first experienced decreases followed by dramatic increases. In particular, recent years see a clear growth in the level of division, which along with a commensurate growth in b/g, suggests a shift in priority from connection to congruity of opinion. These results demonstrate that our model and specifically the parameters of the fitness function can be used as a way to understand changes in opinion networks over time. Greater network division can be modelled as a growth in the value of local homogeneity of opinion when compared to the general value placed on connections with other nodes.

Discussion and conclusion
Our model provides a method for the simulation of changing opinions on a network, allowing for the coevolution of opinions and the connections between nodes. We have shown that it is possible to influence the final shape of a network through the modification of a fitness function based on the minimization of cognitive dissonance. Example runs of the model have demonstrated that the initial distribution of the nodes in the network and of their opinions can tip the balance of cases where the parameters of the fitness function do not strongly promote division or cohesion in the final network, but that the behaviour of the networks can be connected to those parameter values in intuitive ways. The current model allows for the simultaneous evolution of both the connections between the nodes and their individual opinions. The purpose of the evolution is to maximize the fitness of the network, where the definition of fitness includes the effects of cognitive dissonance, node degree and opinion magnitude. This is in line with other models that have considered the interplay between individual forces acting on a given  node and the combined forces of other nodes in the network [40]. The resulting formulation is reminiscent of a spin-glass model, but is not equivalent (see Castellano et al. for a review of spin-glass models and similar constructions [41]). Cognitive dissonance is defined as the discomfort felt by an individual who holds two competing opinions at the same time. The discomfort it produces prompts individuals to avoid cases where they are confronted with ideas that do not match their own [22,35,36,42]. This brings out the primary assumption of this paper: people do not form their opinions based on evidence, but rather choose the opinions that they hold and the individuals with whom they surround themselves for the purpose of maximizing fitness as we have defined it.
An application of our model to partisanship in the US House of Representatives suggests that it is possible to estimate the fitness function parameters for a real-world network and that the results are logically connected to the meaning of the different parameters. The case study points to a growth in the importance of homophily at the expense of having fewer connections in American politics. The result is greater partisanship and polarization, and has been widely documented [28]. The fitness function forces changes in the network that ultimately lead to clustering of those nodes who share the same opinions and a division of the network into mutually disaffected populations. This structure mimics that of 'echo chambers' in the media and in politics, and is self-reinforcing. If this trend continues, we are likely to see only greater political division in the future rather than a return toward greater cohesion. While some variety is necessary for effective problem-solving, it is concerning to think that politics may become so divided that no compromises can be reached on even the most important questions. Datasets pertaining to changing social networks and the flow of information through them have become significantly easier to access in recent decades with the advent of the Internet and large-scale social networking sites [4,43,44]. The modelling of Twitter or Facebook networks as they change in time can be, for instance, another natural application of this research.
The importance of the underlying substrate topology has been demonstrated clearly for the Prisoner's Dilemma and similar games [45 -47]. We find that the same is true of opinion dynamics. Initial conditions can heavily influence the final behaviour of a given network. One of the fundamental assumptions of this paper was that individuals choose their opinions and their connections only to avoid disagreement with their neighbours in the social network. This is indeed enough to create structure in the network similar to the structures that we see played out in real-world social networks, but it does also beg the question of where the validity of a particular opinion actually comes into play. When does the evidence start to matter in the formation of opinions? Further research should consider the interplay between logical evidence and the influence of other individuals through the medium of cognitive dissonance. A model able to combine these two components effectively would be much more complete and more accurate in the prediction of future states of a given network of opinion. Future research will also consider the application of multiple levels of opinion, delving into the world of belief 'systems' in contrast to single beliefs [21].

Simulation procedure
Summing over all of the nodes, we have f(X, C) ¼ P N i¼1 f i as the total fitness function for the entire network. Expanding this quantity we have: The quantity f (X, C) is used as a measure of the progress of the network as a whole toward the steadystate solution. Any possible improvements to f (X, C) eventually become more and more rare as the network approaches a steady state, and so the rate of actual change of f with respect to each iteration of the model decreases. Specifically, the update step of the model consists of two rounds of random changes to the network, first to the connections and then to the beliefs of the nodes. The number of connections that are changed and the number of beliefs that are changed can be manipulated. The case for which only one node is changed at a time is similar to a Moran process [48], and a change of all of the nodes during each step would be akin to a Wright-Fisher update process [49]. The changes in this model are not made with either of these update processes explicitly, however. Each round includes a validation stage rsos.royalsocietypublishing.org R. Soc. open sci. 5: 181122 which ensures that the changes made have improved the fitness of the nodes in the network. Where there is no change or negative change to the fitness of a node, the corresponding mutation is removed and the state of that node variable is reset to its value at the end of the last iteration. The maximum value of a mutation can also be manipulated, but remains fixed throughout the course of the model run. This is particularly useful for the exploration of edge cases where mutations of either the connections or the beliefs of the nodes approach zero, at which point the connections or beliefs are fixed.
We take X i (t) to denote the belief of the ith node at time t and X 0 i (t) as the state after mutation in time step t. By the same token, C ij and C 0 ij are the values of the connection between the ith and jth nodes at time t and the their mutated values. Let DX i indicate the mutation in the belief of the ith node while DC ij indicates the mutation of the connection between the ith and jth nodes. The value of this mutation is pulled from a uniform distribution in the range [20.001, 0.001]. We then have the following as the update rule for each of the nodes in the network: and Similarly for the connections between nodes, we have the following update rule (with mutations in the range [20.0001, 0.0001]): and In Matlab, the above update rules are enacted as matrix operations, with a vector of mutations being added to X and then validated, while a matrix of changes is added to C before validation.
Eventually, this process brings the network to a steady-state solution where neither the opinions of the nodes nor the connections between them can be changed in a way that is beneficial to the nodes of the network.

Network division
To compare the final states of the networks produced by the model, we introduce a simple metric for network division, which we define as the degree to which two groups are disconnected in a network. The two groups in the case of opinion dynamics will be those who agree and those who disagree. The sums of the weights on connections between nodes of the same type (denoted I) and the weight on connections between nodes of different types (denoted O) are calculated. The value of network division is then calculated to be I/(I þ O). For convenience, we define networks where all nodes converge to the same belief value as having network division values of 0. Where there are only connections in the network between nodes of the same type, the value of network division will be 1. Partially split networks will have values less than 1, but greater than 0 where there are any in-group connections at all. Network division will be equal to 0 in the case of a bipartite graph, where there are only intergroup connections.

Model-data integration
In applying this model to data concerning voting in the US House of Representatives, we calculate the division value using the average number of times that individuals voted together. The in-group connections for democrats becomes the number of democrats for a given year multiplied by the average number of democrat -democrat voting pairs, with a similar construction applied to the republican members. The total in-group connections I is defined as the sum of these two products. The out-group connection O is defined as the average number of democrat-republican pairs multiplied with the total number of members. A network division value for each session of the House of Representatives can then be calculated using the formula described above.
rsos.royalsocietypublishing.org R. Soc. open sci. 5: 181122 As a simplifying assumption, we take the beliefs of the individuals of Congress to be steady, and fix the value of a at 0.5. Theoretically, the parameter a should have no effect in this scenario, as taking the partial derivative of the fitness function with respect to the connections between nodes entirely removes the first term.
We wished to find the b/g values that would produce these same values of network division in a similar network. We begin with a population of nodes that had the same ratio of 'democrats' to 'republicans', meaning nodes with positive or negative belief values, as was found in a given session of the House of Representatives. We then ran the model on this network for 40 different ratios of b/g for each session. Performing a linear regression on the resultant set of data points, we gain a hypothesized relationship between the ratio b/g and network division for that particular arrangement of nodes. We can then use our hypothesized function to find what value of b/g would produce the network division observed. This same process is applied to all of the sessions for which there are data.
Competing interests. We have no competing interests to declare. Authors' contributions. T.E. conceived the model, performed simulations and data analyses; T.E. and F.F. constructed the application of the model to real data and wrote the manuscript. All authors gave final approval for publication.