Introduction

Complex networks are the skeletons of complex systems. The dynamical properties of these systems are normally studied by considering the changes in the states of the nodes as a consequence of the interaction with their neighbors in the network. More recently, but with earlier analysis in social sciences1, there has been a focus on dynamical problems associated with states of the links2,3,4,5,6,7,8,9,10,11,12,13,14,15. However, little attention16,17,18 has been paid to problems in which both node and link states are taken into account in a coupled dynamics: The state of the nodes and the nature of their interactions dynamically update each other. Hence the states of the nodes condition the states of the links as much as the states of the links condition the states of the nodes. This coevolution of states and interactions mediated by links is at the heart of the complexity19 of social systems, where positive or negative interactions are associated with concepts such as friendship, trust, etc. In this paper we consider this general situation in a model of opinion formation with a binary choice for both the state of the node and the state of the link.

The importance of the state of the link in social networks has been emphasized in the context of triangular relations with friendly or unfriendly links. Historically, a first theory about psychological three-person relations is the structural balance theory introduced by Heider1 in 1946. This theory exemplifies the principles that “the friend (enemy) of my friend (enemy) is my friend” and “the friend (enemy) of my enemy (friend) is my enemy”. Later, it was translated to the language of graphs20 and has since been a scientific challenge in the study of social systems2,3,4,9,10,11,12,17. In particular Leskovec et al.12 concluded that Heider balance theory cannot explain the observed triangular patterns in a large data set, and proposed the status theory as an alternative explanation of triangle formation in networks. Both theories predict different signs (positive or negative, meaning, respectively, friendly or unfriendly) for a given link in some triangles. The question of the state of the link is also important in the context of opinion dynamics and social polarization21,22,23,24. The mechanism behind polarization can be controversial25,26,27,28 but an example in relation to link states is the one on opinions on climate change: Bliuc et al.22 found that although 97 percent of the papers in scientific community agree that climate change is caused by humans, less than half of the U.S. population shares this belief. The authors propose that the anger towards their opponents would be most likely to be responsible for this public opinion polarization. While in studies of social balance only the state of the link is considered and the question addressed is about the structural balance of triangles, only the state of the node is considered in most studies of opinion formation, as for example in27,28. A step beyond these studies are those, either in opinion formation (friendly or unfriendly link)15 or epidemics (active or inert link)29,30, in which both nodes and links have a state, but the state of the link is either fixed or, else, determined by the state of the connecting nodes, so that, still, there is no coupled dynamics of node and link states.

The dynamical interplay between the states of the nodes and the state of the links has been considered in the context of an Ising model18 and a susceptible-infected model17. In both cases the dynamics to approach structural balance is described by energy minimization of an appropriate Hamiltonian in a fully connected network. A different approach is that of Carro et al.16 in the context of language competition (node state: language preference, link state: language use) where a genuine non-equilibrium dynamics with no Hamiltonian minimization is implemented in a complex network. This leads to a wide range of asymptotic states, including long-lived dynamical states. Here we also consider a non-equilibrium dynamics in the context of opinion formation and we focus on binary or pairwise relations: Nodes can be in either of two states or opinions and links can be positive (friendly) or negative (unfriendly). Satisfactory pairwise relations are those of friendly links connecting nodes in the same state or unfriendly links connecting nodes in different states. The basic assumption is that unsatisfying pairs evolve to satisfying ones either by updating the state of the link or by updating the state of one of the nodes (see Fig. 1). We note that the node-link state dynamical coevolution considered here is essentially different of the one considered in coevolving voter models31,32. In this latter case a link has no state, but the network evolves dynamically with a link connecting nodes in different states being rewired with some probability to connect nodes in the same state. Although one can associate a binary state of the link as existing or non existing, the dynamics is local in our present model, with a change of the state of the link only between neighbors. However, there is a non local network dynamics of random rewiring in the coevolving voter model.

Figure 1
figure 1

We present in this figure all six possible configurations of pairs constructed by two types of link states, friendly (solid line) and unfriendly (dashed line), and two types of node states, blue opinion and white opinion. Thus, the pairs a, c and e are unsatisfying while pairs b, d and f are satisfying. Moreover, we also depict the dynamical rules that turn unsatisfying pairs into satisfying ones through node or link updates. p is the probability of link update and \(1-p\), the complementary probability, is the probability of node update.

As a main result of our study, we find a phase transition from a dynamically active state to an absorbing frozen configuration in which all pairwise relations are satisfactory. This transition shares many features with the one found in the coevolving voter model31. Here, the absorbing phase occurs beyond a critical value pc of the parameter that measures the ratio of time scales for links and nodes updates. This implies that, despite a dynamical rule of local convergence, a global convergence to the absorbing state only occurs when the states of the links evolve fast enough in comparison with the evolution of the states of the nodes. The two phases separated by pc can be also characterized dynamically: From general random initial conditions and for \(p > {p}_{c}\) the evolution of an order parameter that measures global ordering indicates an exponential approach to the absorbing state, while for \(p < {p}_{c}\) the order parameter falls into a plateau value characterizing partial ordering of the system. While the above scenario is valid in the thermodynamic limit where the number of nodes tends to infinite, finite-size effects introduce new time scales: In the absorbing phase the frozen configuration is reached in a characteristic time that scales logarithmically with system size, while in the active phase finite-size fluctuations bring the system to a frozen configuration in a characteristic time that scales exponentially with system size. In addition, we find a transition associated with the network topology of the frozen configurations, whether they have been reached in the absorbing phase or as a result of a finite-size fluctuation in the active phase. This is a finite-size transition that disappears in the thermodynamic limit. It manifests itself via group splitting in the network and we refer to it as a finite-size topological transition.

This paper is organized as follows. After introducing our dynamical model, we discuss a mean-field rate equation approach, suitable for homogeneous random networks33, that is based on the assumption that each node has exactly μ neighbors. These equations, that neglect fluctuations and are only valid in the thermodynamic limit, predict a continuous transition between absorbing and active phases and allow the calculation of pc as a function of the mean degree of the network μ. Next we report Monte Carlo simulations of the model on Erdős-Rényi networks that confirm the rate equation predictions, and describe the dynamical properties of the active and frozen phase, including finite-size effects. We finally summarize our results.

Results

Coupled evolution of node and links property in the imitating process

Let us consider a connected network defined as a set of nodes and links. The nodes represent individuals and the links, understood as undirected connections, indicate a relation between the nodes. Each node holds a binary state variable whose value represents one of two possible opinions. In the figures those two possible values are indicated by a dark (blue) or white color. The links between nodes represent one of the two possible types of relationship: friendly (attraction) and unfriendly (repulsion). In the figures they are indicated, respectively, by a continuous or a dashed line. According to the aforementioned interpretation, we consider that friendly links between pairs of nodes holding the same opinion or unfriendly links between pairs of nodes holding different opinions are satisfying links (or form satisfying pairs), while friendly links between nodes holding different opinions or unfriendly links between nodes holding the same opinion are unsatisfying. All possible situations are displayed in Fig. 1: pairs a, c and e are unsatisfying, while pairs b, d and f are satisfying.

Our basic assumption is that people in a community act in order to maximize their level of satisfaction, a desirable option from the psychological viewpoint. Hence, individuals belonging to an unsatisfying pair connection take action to turn it into satisfying. To convert unsatisfying pairs into satisfying ones, individuals can either change their opinions or alter the link state. Consider, for instance, the unsatisfying a pair in Fig. 1. It can become satisfying if one of the individuals changes its opinion state from white to blue or, alternatively, if they decide to change their link state from unfriendly to friendly. We consider that these two options happen with probability \(1-p\) and p, respectively. A similar scenario holds for the unsatisfying link c. In the case e we need to assign a probability \((1-p)\)/2 to the node holding the blue opinion changing it to white and a probability \((1-p)\)/2 to the node holding the white opinion changing it to blue. In the pairs a, c, it does not matter which one node changes opinion, as it always leads to an f pair.

In a Monte Carlo implementation of these dynamical rules, a link is chosen at random from all existing links. If the corresponding pair is satisfying, nothing happens; otherwise, if the pair is unsatisfying, it is converted into satisfying by applying the rules, with their respective probabilities, displayed in Fig. 1. A Monte Carlo step, as usual, is defined as a number of consecutive link selections equal to the total number of links existing in the system. Most of our results concern an uncorrelated Erdős-Rényi network with N nodes and average degree (number of links per node) μ such that the total number of links is \(L=\frac{1}{2}\mu N\). Defining Li, \(i\in \{a,b,c,d,e,f\}\) as the number of links of type i, the associated densities are \({\rho }_{i}={L}_{i}\)/L, satisfying the obvious normalization condition \({\rho }_{a}+{\rho }_{b}+{\rho }_{c}+{\rho }_{d}+{\rho }_{e}+{\rho }_{f}=1\).

When all pairs are satisfying, no further evolution is possible and the system is dynamically frozen in an absorbing state. Note that an update that converts a pair from unsatisfying to satisfying by changing an individual node state might change the status of another pair, to which the node involved in the update also belongs to, from satisfying to unsatisfying. Therefore, we ask the question of under which conditions the dynamical rules defined above lead to an absorbing, all pairs being satisfying, global state.

In the frozen state, the densities \({\rho }_{a}\), \({\rho }_{c}\), \({\rho }_{e}\) are zero and hence in order to determine whether the frozen state has been reached in a particular realization, we focus on the time evolution of the link densities \({\rho }_{i}(t)\), \(i\in \{a,b,c,d,e,f\}\). This evolution has been analyzed, either using the Monte Carlo procedure explained before or by a set of approximate rate equations, derived in the Method section.

In the Erdős-Rényi Network, where links amongst nodes are generated randomly with probability μ/N, it is possible to relate the different link densities with the number n(t) of nodes holding the white opinion. The relations are

$$\begin{array}{l}{\rho }_{a}+{\rho }_{b}\simeq \frac{n(n-1)}{N(N-1)}\mathop{\to }\limits^{n,N\gg 1}{x}^{2}\\ {\rho }_{c}+{\rho }_{d}\simeq \frac{(N-n)(N-n-1)}{N(N-1)}\mathop{\to }\limits^{n,N\gg 1}{(1-x)}^{2}\\ {\rho }_{e}+{\rho }_{f}\simeq \frac{N(N-1)-(N-n)(N-n-1)-n(n-1)}{N(N-1)}\mathop{\to }\limits^{n,N\gg 1}2x(1-x)\end{array}$$
(1)

where \(x=\frac{n}{N}\).

Rate equation, fixed points and critical line

As described in the Method section, we use a mean-field approximation to derive the rate equations of the aforementioned dynamics, based on the update rules sketched in Fig. 1. The main assumption in the derivation is that each node has exactly μ neighbors distributed randomly amongst all possible nodes. The mean-field treatment is exact in the thermodynamic limit (an infinite system size N) of an all-to-all network where all nodes are connected to each other, but it is only an approximation for other networks that we consider in our simulations. This is the case of an Erdős-Rényi network with a Poisson distribution, of mean degree μ, for the number of neighbors. Furthermore, as the rate equations are deterministic, they can not describe the finite-size fluctuations observed in the numerical simulations. The rate equations are six coupled differential equations for the time evolution of the six types of pair densities \(\{{\rho }_{a},{\rho }_{b},{\rho }_{c},{\rho }_{d},{\rho }_{e},{\rho }_{f}\}\) and include a combination of linear and nonlinear terms of those variables, see Eq. (6). The linear terms reflect the direct change of densities in any type of update, either node or link, and the nonlinear terms are the indirect consequence of node update, by which the status of other links connected to the updated node will also change. The latter effect plays a crucial role in the evolution of the system. We first identify the fixed points of our 6th-order dynamical system, found by setting all time derivatives equal to zero. It turns out that there are two independent sets of fixed points that can be easily obtained by a standard software of mathematical analysis. In the first set all densities take a well defined, non-null, value

$$\begin{array}{lll}{\rho }_{a}^{{\rm{st}}}=\frac{{\rho }_{e}^{{\rm{st}}}}{2}, & {\rho }_{c}^{{\rm{st}}}=\frac{{\rho }_{e}^{{\rm{st}}}}{2}, & {\rho }_{e}^{{\rm{st}}}=\frac{-\,3+2(1-p)(\mu -1)}{8(1-p)(\mu -1)},\\ {\rho }_{b}^{{\rm{st}}}=\frac{{\rho }_{f}^{{\rm{st}}}}{2}, & {\rho }_{d}^{{\rm{st}}}=\frac{{\rho }_{f}^{{\rm{st}}}}{2}, & {\rho }_{f}^{{\rm{st}}}=\frac{1}{2}-{\rho }_{e}^{{\rm{st}}};\end{array}$$
(2)

while in the second set

$${\rho }_{a}^{{\rm{st}}}=0,\,{\rho }_{c}^{{\rm{st}}}=0,\,{\rho }_{e}^{{\rm{st}}}=0,\,({\rho }_{b}^{{\rm{st}}},{\rho }_{d}^{{\rm{st}}},{\rho }_{f}^{{\rm{st}}})\to {\rm{arbitrary}},$$
(3)

there are no unsatisfying pairs, but there is an arbitrariness in the values of the densities of the satisfying links (always verifying the normalization condition \({\rho }_{b}^{{\rm{st}}}+{\rho }_{d}^{{\rm{st}}}+{\rho }_{f}^{{\rm{st}}}=1\)). In the first solution, Eq. (2), the densities of the pair connections reach asymptotically a non-null plateau depending on p and μ and independent of initial conditions. However, in the second set of solutions, Eq. (3), there are no unsatisfying pair connections, and the densities of the satisfying ones depend on the initial conditions.

The condition \({\rho }_{e}^{{\rm{st}}}\ge 0\) determines that the first solution is only relevant for \(-\,3+2(1-p)\,(\mu -1)\ge 0\) or, given μ, for \(p\le {p}_{c}(\mu )\) with

$${p}_{c}(\mu )=1-\frac{3}{2(\mu -1)}.$$
(4)

A linear stability analysis34 shows that the first solution, Eq. (2), is always stable (negative eigenvalues of the linearized equations) whenever it leads to non-negative densities, and that the set, Eq. (3), is marginally stable (eigenvalues equal to zero). Therefore for \(p < {p}_{c}(\mu )\) there are always active links in the asymptotic state and, consequently, continuous changes of the microscopic state. We say that the system stays in an active, or dynamical, phase. However, for \(p > {p}_{c}(\mu )\), the densities of all active pairs tend to zero and the dynamics reaches a frozen, or absorbing, phase. As order parameter distinguishing one phase from another we choose the density \({\rho }_{e}^{{\rm{st}}}\), which is zero in the absorbing phase and positive in the active phase. Note that, in turn, the condition \({p}_{c}(\mu )\ge 0\) requires \(\mu > 5\)/2. If \(\mu \le 5\)/2 the first solution does not exist and the dynamics always leads to a frozen state. As it follows from Eq. (2), as p approaches the critical value pc from below, the order parameter tends to zero as \({\rho }_{e}^{{\rm{st}}}\sim {({p}_{c}-p)}^{\beta }\) with a critical exponent \(\beta =1\), a continuous phase transition. As this coincides with the mean-field critical exponent of directed percolation35, we speculate that the active-frozen transition that we just described can be categorized under the class of directed percolation, but much more extensive numerical simulations would be needed in order to be conclusive in this point.

These conclusions are based on the study of the rate equations and are strictly valid only in the thermodynamic limit for the all-to-all network. In a finite system, an active state will display fluctuations of the order parameter around its mean value. Due to the stochastic nature of the dynamics, there will be always a fluctuation that takes an active state into a frozen one and, from there on, all microscopic dynamics stops. As discussed in detail in the next sections, the likeness of such fluctuation tends to zero with increasing system size and the average time to reach the frozen state diverges exponentially with system size.

Phase transition

We have carried out extensive Monte-Carlo simulations of the dynamical rules presented in Fig. 1 on an Erdős-Rényi network with mean degree μ and system size N. Once the network, nodes and links, has been constructed, we assign randomly a state (white/blue) to each node and then a state to each link (friendly/unfriendly). The initial density of white nodes is x0 and that of friendly links is \({\ell }_{0}\). Note that the all-to-all network corresponds to \(\mu =N-1\).

Some representative trajectories of the order parameter \({\rho }_{e}(t)\) can be seen in Fig. 2 for \(N=400\) for some system parameters leading to the active phase, panel (a), or to the frozen phase, panel (b). In all curves we have taken the same values of \({x}_{0}=0.5\) and \({\ell }_{0}=0.5\) but different realizations of the networks, initial conditions and the dynamics. Observe the dispersion in the different curves in the active phase and that the microscopic dynamics continues in this phase for the whole range of time displayed in the figure. In the frozen phase, there is no further dynamics when the density of unsatisfied links reaches zero. Note, however, that there is also a dispersion in the times it takes the different realizations of the dynamics to reach the frozen state.

Figure 2
figure 2

We plot some representative trajectories of the density \({\rho }_{e}(t)\) of unsatisfied links, for the Erdős-Rényi network with \(N=400\). Each color corresponds to a different realization. The relevant parameters for panel (a) are \(p=0.8\) and \(\mu =12\), leading to an active phase where the evolution continues for the whole range of time displayed. In panel (b) we take \(p=0.8\) and \(\mu =6\), leading to a frozen phase with a zero density of unsatisfying links. All trajectories are generated using the Monte Carlo method described in the main text and, in both panels, start out from the same value of the density of white nodes, \({x}_{0}=0.5\), and the density of friendly links, \({\ell }_{0}=0.5\), but correspond to different realizations of the network, initial condition and dynamics.

In order to check the validity of the description in terms of rate equations, we compare in Fig. 3 the Monte-Carlo results for the time evolution of the densities \(\{{\rho }_{a},{\rho }_{b},{\rho }_{c},{\rho }_{d},{\rho }_{d},{\rho }_{f}\}\) for an Erdős-Rényi network with \(N=400\) nodes, with the numerical integration of the rate equations. We have set the same average number of neighbors μ in the rate equations and the Monte-Carlo simulations. For the Monte-Carlo simulations the results are the average over 100 realizations. In panels (a) and (c) we take \(\mu =399\) which, for the Erdős-Rényi network, means that all nodes are connected to each other. In this case, as expected, the agreement between the simulations and the rate equations is very good. In panels (b) and (d) we take \(\mu =6\), but still observe a good agreement between simulations and rate equations. For \(\mu =399\), the chosen value of \(p=0.9\) is below the critical one \(p < {p}_{c}(\mu )=0.996\) and, consequently, the dynamics leads to an active state. For \(\mu =6\), on the contrary, the value of \(p=0.9\) is above the critical one \(p > {p}_{c}(\mu )=0.7\) and, consequently, the dynamics leads to a frozen state. These two scenarios are observed both in the Monte-Carlo simulations and in the numerical integration of the rate equations.

Figure 3
figure 3

Densities of the different types of links \(\{{\rho }_{a}(t),{\rho }_{b}(t),{\rho }_{c}(t),{\rho }_{d}(t),{\rho }_{e}(t),{\rho }_{f}(t)\}\) and the density of white nodes x(t) as a function of time. Panels (c and d) are the result of a numerical integration of the rate equations (RE), and have to be compared with the results of the Monte Carlo (MC) simulations with the same value of μ, displayed in panels (a and b). All curves use \(p=0.9\) and start out from same value, \({x}_{0}=0.1\) and \({\ell }_{0}=0.9\). The curves obtained from the Monte Carlo simulation are the result on an average over 100 simulation runs on the Erdős-Rényi network with \(N=400\). Panels (a and c) correspond to the active phase while panels (b and d) correspond to the frozen phase.

To compare the Monte-Carlo simulations with the predictions of the rate equations in the steady state, Eqs (2 and 3) and the critical line Eq. (4), we compute numerically in the simulations the average value \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\). In Fig. 4(a) we show \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\) in the \((\mu ,p)\) plane in a color code, while in Fig. 5(a) we plot it as a function of μ for fixed \(p=0.8\) and in Fig. 5(b) as a function of p for fixed \(\mu =8\), as well as the prediction of the rate equations. It is clear from these figures that the rate equations provide a good qualitative, but also quantitative, agreement with the results of the Monte-Carlo simulations in finite Erdős-Rényi networks. The rate equations also predict the relation \({\rho }_{a}^{{\rm{st}}}={\rho }_{e}^{{\rm{st}}}\)/2 that occurs in the steady state. This has been checked by plotting in Fig. 4(d), \(2{\langle {\rho }_{a}\rangle }^{{\rm{st}}}\) in the \((\mu ,p)\) plane in a color code, making it indistinguishable from the corresponding Fig. 4(a) for \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\). Another prediction of the rate equations is that \({\rho }_{f}^{{\rm{st}}}\) should depend on the initial condition in the frozen phase. We check this by plotting \({\langle {\rho }_{f}\rangle }^{{\rm{st}}}\) in the \((\mu ,p)\) plane in a color code for two different values of the initial condition in Fig. 4(b,e).

Figure 4
figure 4

These figures plot in a color code the density of links obtained from Monte Carlo simulation as a function of μ and p. The critical line obtained from the rate equations is plotted as a red line. As it can be seen, the values of \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\) displayed in panel (a) and \(2{\langle {\rho }_{a}\rangle }^{{\rm{st}}}\) in panel (d) are indistinguishable as it was predicted by Eqs (2 and 3), namely \({\rho }_{a}={\rho }_{e}\)/2 in the active phase and \({\rho }_{a}={\rho }_{e}=0\) in the frozen phase. Panels (b and e) represent \({\rho }_{f}\) for different initial conditions, confirming that in the frozen phase (above the critical line) the density of unsatisfying pairs depends on the initial condition, while in the active phase (below the critical line) they are independent of the initial condition. Finally, based on Eq. (1), the rate equations predict that the relation \({\rho }_{f}^{{\rm{st}}}=2{x}^{{\rm{st}}}(1-{x}^{{\rm{st}}})\) should hold in the frozen phase as it is indeed the case: compare, above the critical line, panels (c and b) for one initial condition and panels (e and f) for a different one.

Figure 5
figure 5

We plot the stationary density average \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\) obtained from Monte Carlo simulations (dashed lines) and compare it with the analytical solution of the rate equations (solid lines). In panel (a) we plot this magnitude as a function of μ for fixed \(p=0.8\), while in panel (b) we plot it as function of p for fixed \(\mu =8\).

For an Erdős-Rényi network, Eqs (13) imply that the density of white links in the steady state should be \({x}^{{\rm{st}}}=1\)/2 in the active phase, while it depends on the initial condition in the frozen phase. Moreover, in the frozen phase, the relation \({\rho }_{f}^{{\rm{st}}}=2{x}^{{\rm{st}}}(1-{x}^{{\rm{st}}})\) should hold. This is checked in Fig. 4(c,f) where we plot \(2{\langle x\rangle }^{{\rm{st}}}(1-{\langle x\rangle }^{{\rm{st}}})\) in the \((\mu ,p)\) plane in a color code yielding plots which are indistinguishable from the corresponding Fig. 4(b,e), respectively, for \({\langle {\rho }_{f}\rangle }^{{\rm{st}}}\) in the frozen phase, \(p > {p}_{c}(\mu )\).

A more detailed analysis of the dependence of xst and hence of \({\rho }_{b}^{{\rm{st}}}\), \({\rho }_{d}^{{\rm{st}}}\) and \({\rho }_{f}^{{\rm{st}}}\) on the initial condition, in the frozen phase has been performed in Fig. 6(a,b). We set a value of x0 (initial density of white nodes) and generate many initial conditions varying the value of the initial density of friendly links \({\ell }_{0}\in (0,1)\). Each of these microscopic configurations evolves to \({x}^{{\rm{st}}}=1\)/2 for \(p < {p}_{c}(\mu )\) but generates a spread of final values of xst for \(p > {p}_{c}(\mu )\). The spread is delimited by the lines \(x=1\)/2 and \(x={x}_{f}\), being xf a value that depends on x0, μ and p. The value \({x}_{f}({x}_{0},\mu )\) for fixed \(p=0.8\) and the value \({x}_{f}({x}_{0},p)\) for fixed \(\mu =6\) have been plotted in Fig. 6(a,b), respectively, for different values of x0.

Figure 6
figure 6

We plot the dependence of xst on the initial condition in the frozen phase both for fixed \(p=0.8\), panel (a) and fixed \(\mu =6\), panel (b). The solid curves are the result of a numerical integration of the rate equations (RE). In the frozen phase, the spread of xst, due to varying \({\ell }_{0}\) from 0 to 1, for given x0 are spanned between the xf (curves) and x = 1/2 (beige line). The colored area is the region between the largest and smallest possible value of xf for which we used the condition \({\ell }_{0}={\ell }_{1}=1-{\ell }_{2}\) (see initial condition in section method). In active phase, \(p < {p}_{c}(\mu )\), for any initial condition, \({x}^{{\rm{st}}}=1\)/2 (pink line). Finally, for comparison, xf obtained from Monte Carlo (MC) for \({x}_{0}=0.1,0.9\) are depicted by a dashed line.

We have also carried out numerical simulations in regular lattices in one and two dimensions with nearest neighbors (results not shown). The qualitative phenomenology is the same than the one described previously: while the dynamics always leads to a frozen phase in dimension one (\(\mu =2\)), in dimension two we still find a transition from an active to a frozen phase at a critical value \({p}_{c}\) that, however, is smaller than the equivalent \({p}_{c}(\mu )\) of an Erdős-Rényi network with \(\mu =4\).

In the following sections we describe separately the active and the frozen phases, studying in each case the survival probability and the characteristic decay time, as well as some topological properties of the asymptotic pattern reached by the dynamical evolution.

Active phase

The active, or dynamical, phase is a steady state characterized by the existence of a microscopic evolution. This occurs if the link-update probability is smaller than the critical value, \(p < {p}_{c}(\mu )\). All types of links \(\{a,b,c,d,e,f\}\) are present in this active steady state and their corresponding densities fluctuate around well defined values. The amplitude of these fluctuations around the steady state values decrease with system size and, eventually, tend to zero in the thermodynamic limit when the number of nodes \(N\to \infty \). See Fig. 7(a) for a typical dependence of the density \({\rho }_{e}(t)\) with time and system size. As shown in the same figure, the steady-state value \({\langle {\rho }_{e}\rangle }^{{\rm{st}}}\) can be resonably well approximated by the prediction Eq. (2) of the rate equations.

Figure 7
figure 7

Representative time evolution of \(\langle {\rho }_{e}\rangle \). Panel (a) corresponds to the active phase and panel (b) to the frozen phase (note the log-linear scale). All trajectories in both panels use the same value of \(p=0.8\) and initial condition \({x}_{0}=0.5\) and \({\ell }_{0}=0.5\) but different realizations of the network and the dynamics. In both cases, the averages use 100 runs that did not end in the frozen phase. In panel (b) we observe an exponential behavior \(\langle {\rho }_{e}\rangle \propto {e}^{-t/{\tau }_{0}}\) with a small dependence of \({\tau }_{0}\) with system size. In panel (a), the fluctuations of \(\langle {\rho }_{e}\rangle \) around the well defined value decrease with system size.

The existence of absorbing states and the ergodicity of the stochastic dynamical rules imply that for a finite system there is always a fluctuation that will take the system towards one of the absorbing states. Therefore, for a finite system, the ultimate fate is to end in the absorbing phase. The key point is to analyze the dependence of the time \(\tau \) to reach the absorbing state on system size. \(\tau \) is a random variable and we present in panels (a) and (b) of Fig. 8 its probability density function (pdf) \(f(\tau )\) for two values of \((\mu ,p)\) corresponding to the active phase and several values of the system size N. It appears from these figures that, at least for large \(\tau \), the pdf can be fitted by an exponential form \(f(\tau )\sim {e}^{-\tau /\langle \tau \rangle }\). The average value of the distribution \(\langle \tau \rangle \) is plotted in panels (e) and (f) Fig. 8 as a function of the system size N, showing an exponential dependence \(\langle \tau \rangle \sim {e}^{\alpha N}\). This exponential dependence indicates that the decay to the absorbing state becomes very rare for increasing system size. From the point of view of Statistical Mechanics, in the limit \(N\to \infty \), the active state remains forever and represents a genuine macroscopic phase.

Figure 8
figure 8

In panels (a and b) we plot the probability density function of the characteristic time to decay to the frozen state, \(f(\tau )\) for two different sets of parameters belonging to the active phase, and for different system sizes. The corresponding mean values of the distributions, \(\langle \tau \rangle \) are displayed as a function of system size in panels (e and f), showing an exponential form, \(\langle \tau \rangle \sim {e}^{\alpha N}\). Panels (c and d) plot \(f(\tau )\) for two different sets of parameters belonging to the frozen phase. These distributions have well defined maximum located at \({\tau }_{1}\). The dependence of \({\tau }_{1}\) as function of system size are plotted in panels (g and h) displaying a logarithmic behavior, \({\tau }_{1}\sim \,\mathrm{log}(N)\).

The active phase is remarkable in the sense that it indicates the failure of the local dynamical rule. While the evolution is dictated by a tendency to reduce the unsatisfying pairs, the final state is one of coexistence of all types of links. This is reminiscent of other dynamical models, the most notable being that of Axelrod36,37 that predicts that local convergence can generate global polarization in an agent-based model of dissemination of culture.

From the topological point of view, the active phase is characterized by a continuously evolving, and apparently disordered, structure of nodes and links, see Fig. 9(a,b). The topology of the corresponding frozen phases that appear at a later time due a to a finite-size fluctuation, see Fig. 9(c,d), will be analyzed in another section.

Figure 9
figure 9

In panel (a) we display a snapshot of a configuration of the dynamics with parameters \(p=0.3\) and \(\mu =4\) (active phase). In this configuration, all types of pair connections exist and evolve in time. This dynamics further evolves until a finite-size fluctuation takes it to the absorbing state displayed in panel (c), where there are no unsatisfying links. As it is evident from the figure, the system divides in more than two friendly groups with different opinions, a situation that corresponds to \(\mu < {\mu }_{{\rm{split}}}\approx 14\) for these parameters. In panel (b) we show an also active configuration for \(p=0.7\) and \(\mu =16 > {\mu }_{{\rm{split}}}\). This configuration evolves until a fluctuation, for large times, takes it to the absorbing one displayed in panel (d). In this absorbing configuration there are only two groups, a situation corresponding to \(\mu > {\mu }_{{\rm{split}}}\). In all cases displayed, the number of nodes is \(N=30\).

Frozen phase

When the link-update probability is larger than the critical value \(p > {p}_{c}(\mu )\) the system falls into the absorbing or frozen phase. At variance with the system in the active phase, the densities of unsatisfied links \({\rho }_{a}(t)\), \({\rho }_{c}(t)\) and \({\rho }_{e}(t)\) continuously decrease during the time evolution and never reach a plateau from which they eventually escape. Therefore, there is a continuous decay towards the absorbing phase, contrarily to the decay of the active phase that was produced by a rare fluctuation. This is evidenced in panel (b) of Fig. 7 where we plot the time evolution of \({\rho }_{e}(t)\) for different system sizes. We observe an exponential decay \({\rho }_{e}(t)\sim {e}^{-t/{\tau }_{0}}\) with a very small dependence of \({\tau }_{0}\) on the system size N and approaching a limiting value relatively close to the prediction of the rate equation. The time to reach the absorbing state, \(\tau \), is also a random variable characterized by a pdf \(f(\tau )\). As shown in panels (c) and (d) Fig. 8, corresponding to two different points in the frozen phase, the tail of \(f(\tau )\) can still be fitted by an exponential function \({e}^{-t/{\tau }_{2}}\), but this function now presents a well defined maximum located at \({\tau }_{1}\), the characteristic time for decay unto the frozen state. This characteristic time is plotted in panels (g) and (h) of Fig. 8 showing a logarithmic increase with system size \({\tau }_{1}\sim \,\mathrm{log}\,N\). It is possible to relate the exponential decay observed in \({\rho }_{e}(t)\) with this logarithmic dependence. The transition to the absorbing state will occur at the time \({\tau }_{1}\) when the density of unsatisfying pairs falls below a value of order 1/N, i.e. \({\rho }_{e}({\tau }_{1})\sim 1\)/N. Replacing \({\rho }_{e}(t)\sim {e}^{-t/{\tau }_{0}}\). We arrive at \({\tau }_{1}\sim {\tau }_{0}\,\mathrm{log}\,N\), a logarithmic dependence on system size, as observed. Snapshot of typical frozen configurations are displayed in Fig. 10(a,b). In the next section we discuss the possible topological structures of the frozen phases.

Figure 10
figure 10

In panel (a) we display a final absorbing configuration of the dynamics in the case of parameters \(p=0.8\) and \(\mu =4\) (a point in parameter space corresponding to the frozen phase) that contains more than two groups, a situation corresponding to \(\mu < {\mu }_{{\rm{split}}}\). Panel (b), with parameters \(p=0.95\), \(\mu =16\) (also in the frozen phase), shows a frozen configuration with two groups, as it corresponds to \(\mu > {\mu }_{{\rm{split}}}\). In both cases, the number of nodes is \(N=30\).

Finite-size topological transition

A fully satisfying, absorbing, configuration obtained in an Erdős-Rényi network displays a transition associated with some structure that can be described as “group splitting”. By that, we mean that the nodes organize in several groups, defining a group as a set of nodes holding the same opinion and connected by friendly links among themselves and by unfriendly links to the members of other groups. This group splitting structure appears both when the absorbing configuration has been reached from a finite-size fluctuation of an active phase, \(p < {p}_{c}(\mu )\), see Fig. 9(c,d), or when it corresponds to the frozen phase in parameter space, \(p > {p}_{c}(\mu )\), see Fig. 10(a,b).

The number of components is an important topological property of a network. We characterize the absorbing configurations by the number of groups \({N}_{g}\). This number is a stochastic variable that depends on the initial condition, the system parameters and the particular realization of the dynamics. We denote by \({f}_{\#{\rm{groups}}}({N}_{g})\) the probability distribution function of this variable as:

$${f}_{\#{\rm{groups}}}({N}_{g})=\sum _{n=1}\,{p}_{n}\delta ({N}_{g}-n),$$
(5)

with \({\sum }_{n}\,{p}_{n}=1\) and δ is the Dirac-delta function. The shape of these discrete distributions for small μ can be approximated by a continuous Gaussian shape, as shown in Fig. 11. What we have observed is that there is a transition in which \({f}_{\#{\rm{groups}}}({N}_{g})\) changes from a unimodal distribution at \({N}_{g}=2\) (meaning that all realizations end up in two groups) to a wide distribution in which different realizations reach a state in which two large groups coexist with a varying number of smaller groups. Examples of two groups-splitting can be seen in Figs 9(d) and 10(b), whereas more than two groups are displayed in Figs 9(c) and 10(a). The topological transition appears when crossing the line \({\mu }_{{\rm{split}}}(p)\) in parameter space \((\mu ,p)\) such that for \(\mu > {\mu }_{{\rm{split}}}\) the system always fall into exactly two friendly group with different opinion, \({N}_{g}=2\), but for \(\mu < {\mu }_{{\rm{split}}}\), the system splits in more than two friendly groups, \({N}_{g} > 2\). The exact location of the transition line \({\mu }_{{\rm{split}}}(p)\) depends on the initial condition and on system size N. The simulations indicate that for the initial condition \(({x}_{0}=0.5,{\ell }_{0}=0.5)\) the value μsplit is roughly independent on p, see panels (a) and (b) in Fig. 11. Furthermore the transition point μsplit grows with system size, see panel (c) of Fig. 11, and we speculate that it tends to infinity with N, in such a way that in the thermodynamic limit, a typical absorbing configuration always contains more than two groups. For a different set of initial conditions, it is not true that the line \({\mu }_{{\rm{split}}}(p)\) is independent of p, but the same conclusion is reached about the disappearance of the two-groups phase in the large N limit.

Figure 11
figure 11

We plot in different panels the probability density function of the number of groups for fixed p but different μ for the initial condition \({x}_{0}=0.5\), \({\ell }_{0}=0.5\). The distributions with the same color in panel (a and b) correspond to the same μ but different p and are, roughly speaking, indistinguishable, implying that, for these particular initial conditions, the mean value and the variance of \({f}_{\#groups}\) do not depend on p but on μ. In addition we can see that in panels (a and b) with \(N=30\) splitting occurs for \(\mu < {\mu }_{{\rm{split}}}\simeq 14\) but in panel (c) with \(N=250\) it occurs for \(\mu < {\mu }_{{\rm{split}}}\simeq 22\), providing evidence that the critical value for splitting increases with system size.

The size G of the largest white group is also a random variable described by the corresponding pdf \({f}_{{\rm{giant}}}(G)\). The mean value and variance, \(\langle G\rangle \), \({\sigma }^{2}[G]\) of that distribution depend, besides p and μ, on the initial densities of white opinions x0 and friendly links \({\ell }_{0}\), in a similar functional form that the final density \({\langle x\rangle }^{{\rm{st}}}\) displayed in Fig. 6(c,d). For a given initial condition, \(\langle G\rangle \) and \({\sigma }^{2}[G]\) increase linearly with system size N (not shown). In Fig. 12 we show that \({f}_{{\rm{giant}}}(G)\) can be well represented by a Gaussian distribution.

Figure 12
figure 12

Probability density function of the size of the largest group of the frozen phase for \(p=0.8\) and \(\mu =6\). The results for different system sizes have been rescaled by defining \(\xi =(G-\langle G\rangle )\)/\(\sigma [G]\), and can be clearly fitted by a Gaussian distribution (solid line). In all cases the initial condition is \({x}_{0}=0.5\), \({\ell }_{0}=0.5\).

Summary and Discussion

We have introduced a model of opinion formation in the context of the study of coupled dynamics of node and link states in a complex network: We postulate that friendly/unfriendly links can affect the process of changing opinions so that friends like to have the same opinion and unfriendly relations are satisfied with different opinions. We have proposed a dynamical rule for the evolution of unsatisfied pairwise relations to satisfactory relations by either node or link updates. The relevant parameter of the problem p is the probability for link update instead of a node update in the local dynamics rule. By a mean-field rate equation analysis, corroborated by Monte Carlo simulations, we find an absorbing continuous phase transition from a frozen to a dynamically active phase occurring for a critical value of p. In spite of a dynamical rule of local convergence, global convergence to the satisfactory absorbing phase does not occur for slow link update. In the active phase, the densities of all possible pairwise relations fluctuate around well defined values that depend on μ and p. However, finite-size fluctuations take the system to a frozen configuration, but this occurs in a characteristic time that grows exponentially with system size. In the frozen phase, the system orders dynamically, with an order parameter decaying exponentially to zero. For a finite system, the characteristic time to reach the absorbing state in this phase grows logarithmically with system size. The final frozen configurations reached continuously in the absorbing phase or those reached by a finite-size fluctuation in the active phase show a group structure such that the links within a group are friendly and the links between groups are unfriendly. There is a finite-size topological transition between a two-group and a multi-group structure of those final frozen configurations. An interesting feature of these results is the polarized configuration of the final absorbing states in both the active and absorbing phases (Figs 9 and 10). In these configurations, two large and opponent groups with different opinion emerge out of a disordered configuration, illustrating the process of social polarization21,22,23,24 in opinion formation. We note that this polarization is in contrast to the consensus configuration observed in the final absorbing state of the coevolving voter model31 in its active phase. A challenging open question for future research is how these transitions are modified when the network evolves dynamically as in a coevolving voter model31: An unsatisfying pair could evolve to a satisfying pair by rewiring a link in the network with some probability.

Method

Rate equation of coupled evolution of node and link in imitating process in the mean-field approximation

To predict the behavior of the different densities of pairs as a function of time, we derive the rate equations of the dynamic sketched in Fig. 1 on a network in which each nodes has exactly μ links as

$$\begin{array}{rcl}\frac{d{\rho }_{a}}{dt} & = & -{\rho }_{a}+(1-p)(\mu -1)\\ & & \times \,(\,-\frac{{\rho }_{a}^{2}}{\chi }+\frac{1}{2}\frac{{\rho }_{c}{\rho }_{f}}{\varphi }+\frac{1}{2}\frac{{\rho }_{e}{\rho }_{f}}{2\varphi }-\frac{{\rho }_{e}{\rho }_{a}}{2\chi })\\ \frac{d{\rho }_{b}}{dt} & = & p{\rho }_{a}+\frac{(1-p)}{2}{\rho }_{e}+(1-p)(\mu -1)\\ & & \times \,(\,-\frac{{\rho }_{a}{\rho }_{b}}{\chi }+\frac{1}{2}\frac{{\rho }_{c}{\rho }_{e}}{\varphi }+\frac{1}{2}\frac{{\rho }_{e}^{2}}{2\varphi }-\frac{{\rho }_{e}{\rho }_{b}}{2\chi })\\ \frac{d{\rho }_{c}}{dt} & = & -{\rho }_{c}+(1-p)(\mu -1)\\ & & \times \,(\frac{1}{2}\frac{{\rho }_{a}{\rho }_{f}}{\chi }-\frac{{\rho }_{c}^{2}}{\varphi }+\frac{1}{2}\frac{{\rho }_{e}{\rho }_{f}}{2\chi }-\frac{{\rho }_{e}{\rho }_{c}}{2\varphi })\\ \frac{d{\rho }_{d}}{dt} & = & p{\rho }_{c}+\frac{(1-p)}{2}{\rho }_{e}+(1-p)(\mu -1)\\ & & \times \,(\frac{1}{2}\frac{{\rho }_{a}{\rho }_{e}}{\chi }-\frac{{\rho }_{c}{\rho }_{d}}{\varphi }+\frac{1}{2}\frac{{\rho }_{e}^{2}}{2\chi }-\frac{{\rho }_{e}{\rho }_{d}}{2\varphi })\\ \frac{d{\rho }_{e}}{dt} & = & -{\rho }_{e}+(1-p)(\mu -1)(\,-\frac{1}{2}\frac{{\rho }_{a}{\rho }_{e}}{\chi }+\frac{{\rho }_{a}{\rho }_{b}}{\chi }+\frac{{\rho }_{c}{\rho }_{d}}{\varphi }\\ & & -\,\frac{1}{2}\frac{{\rho }_{c}{\rho }_{e}}{\varphi }+\frac{{\rho }_{e}{\rho }_{d}}{2\varphi }-\frac{1}{2}\frac{{\rho }_{e}^{2}}{2\chi }-\frac{1}{2}\frac{{\rho }_{e}^{2}}{2\varphi }+\frac{{\rho }_{e}{\rho }_{b}}{2\chi })\\ \frac{d{\rho }_{f}}{dt} & = & p{\rho }_{e}+(1-p)({\rho }_{a}+{\rho }_{c})\\ & & +\,(1-p)(\mu -1)(\,-\frac{1}{2}\frac{{\rho }_{a}{\rho }_{f}}{\chi }+\frac{{\rho }_{a}^{2}}{\chi }+\frac{{\rho }_{c}^{2}}{\varphi }-\frac{1}{2}\frac{{\rho }_{c}{\rho }_{f}}{\varphi }\\ & & +\,\frac{{\rho }_{e}{\rho }_{c}}{2\varphi }-\frac{1}{2}\frac{{\rho }_{e}{\rho }_{f}}{2\chi }-\frac{1}{2}\frac{{\rho }_{e}{\rho }_{f}}{2\varphi }+\frac{{\rho }_{e}{\rho }_{a}}{2\chi })\\ \chi & = & {\rho }_{a}+{\rho }_{b}+{\rho }_{e}+{\rho }_{f}\\ \varphi & = & {\rho }_{c}+{\rho }_{d}+{\rho }_{e}+{\rho }_{f}\end{array}$$
(6)

According to the update rule, the only active pairs are a, c and e, however due to the node update the statues of pairs b, d and f will change because, in the procedure of node update, the states of all pairs connected to the updated node will also be changed. The nonlinear terms in the rate equation are the consequence of this interaction. In the following we explain the derivation of the rate equation. The linear and nonlinear terms should be derived separately.

The linear terms are obtained by the variation of densities due to the direct update of nodes and links in the real time steps. As a way of example, now we derive in detail the first term of the first equation: In any update step, with probability \({\rho }_{a}\) a pair a is randomly chosen. According to the update rule Fig. 1, with probability p it turns into the pair b and changes the global density as \({\rm{\Delta }}{\rho }_{a}=-\,\frac{1}{N\mu /2}\). Also, with probability \(1-p\), the pair a becomes f and changes the global density in the same amount. In addition, the time interval (measured in Monte Carlo steps) in any update step is given by \({\rm{\Delta }}t=\frac{1}{N\mu /2}\). Therefore, the variation of \({\rho }_{a}\) due to the direct effect of update of the pair a is

$${\frac{d{\rho }_{a}}{dt}|}_{a\to b}+{\frac{d{\rho }_{a}}{dt}|}_{a\to f}=p\frac{{\rm{\Delta }}{\rho }_{a}}{{\rm{\Delta }}t}{\rho }_{a}+(1-p)\frac{{\rm{\Delta }}{\rho }_{a}}{{\rm{\Delta }}t}{\rho }_{a}=-\,{\rho }_{a},$$
(7)

where \({\frac{d{\rho }_{i}}{dt}|}_{i\to j}\) is the direct effect of the update from the pair \(i\in \{a,c,e\}\) to the pair \(j\in \{b,d,f\}\). Needless to say that because of conservation of number of pair connections in the network, the negative value of \({\frac{d{\rho }_{a}}{dt}|}_{a\to b}\) and \({\frac{d{\rho }_{a}}{dt}|}_{a\to f}\) should be added to the variation of \({\rho }_{b}\) and \({\rho }_{f}\), respectively. Thus the most general form of linear terms can be written as follow

$$\frac{d{\rho }_{i}}{dt}=+\,\sum _{j}\,{\frac{d{\rho }_{i}}{dt}|}_{i\to j}+[nonlinear\,terms],\,i\in \{a,c,e\},\,j\in \{b,d,f\},$$
(8)
$$\frac{d{\rho }_{j}}{dt}=-\,\sum _{i}\,{\frac{d{\rho }_{i}}{dt}|}_{i\to j}+[nonlinear\,terms],\,i\in \{a,c,e\},\,j\in \{b,d,f\}.$$
(9)

Now, turning back to our example and using Eq. 8 we can write

(10)

The third term of Eq. 10 is zero because there is no direct update from \(a\to d\). Then, the variation of \({\rho }_{b}\) and \({\rho }_{f}\), using Eq. 9, can be written as

(11)
$$\frac{d{\rho }_{f}}{dt}={-\frac{d{\rho }_{a}}{dt}|}_{a\to f}-{\frac{d{\rho }_{e}}{dt}|}_{e\to f}-{\frac{d{\rho }_{c}}{dt}|}_{c\to f}+[nonlinear\,terms].$$
(12)

The third term of Eq. 11 is zero because there is no direct update from \(c\to b\). The other undetermined terms can be obtained easily similarly to the derivation of Eq. 7.

However, the non-linear terms are an indirect effect of the node update. The blue nodes can be an end to any of the links c, d, e and f while the white nodes can be an end to any of the links a, b, e and f. Thus, the node update will change the status of the connected links to the updated node. As case in point, to show how we obtain the nonlinear terms, we derive the first non linear term of the fifth equation \(-\,(1-p)\,(\mu -1)\frac{{\rho }_{a}{\rho }_{e}}{2\chi }\). This term is the implication of a node update from the pair connection a to f. As mentioned before, in any Monte Carlo step, with probability \({\rho }_{a}\) a pair a is randomly picked and with probability \(1-p\) a node update takes place. Now, let us examine the change of the rate of \({\rho }_{e}\) under the update of a to f as presented in Fig. 13. The normalized number of whole pair connections attached to the one side of a pair a is \(\frac{\mu -1}{N\mu /2}\) and from this portion, the fraction of the pair e that is attached to the link a is \(\frac{{\rho }_{e}}{\chi }\frac{\mu -1}{N\mu /2}\). In addition, due to the asymmetry on the shape of pairs e and f, the update from any side of these pairs would result in different pairs. For instance, if the white opinion in the pair e is updated, the new pair convert to d and if blue opinion is flipped, the new one turns to b. Thus, when we deal with pairs e and f, the contribution of nonlinear terms in the node update should be considered by probability \(\frac{1}{2}\). Thus, the global change in the density of the pair e due to the node update from a to f is given by \({\rm{\Delta }}{\rho }_{e}=-\,\frac{{\rho }_{e}}{2\chi }\frac{\mu -1}{N\mu /2}\). This leads to

$${\frac{d{\rho }_{e}}{dt}|}_{a\to f}^{e\to d}=(1-p)\frac{{\rm{\Delta }}{\rho }_{e}}{{\rm{\Delta }}t}{\rho }_{a}=-\,(1-p)(\mu -1)\frac{{\rho }_{a}{\rho }_{e}}{2\chi },$$
(13)

where \({\frac{d{\rho }_{v}}{dt}|}_{i\to j}^{v\to w}\) and its negative value are the change in density of the pairs \(v\in \{a,b,c,d,e,f\}\) and \(w\in \{a,b,c,d,e,f\}\), respectively, due to the node update of the pair i to j. In general

$$\begin{array}{l}\frac{d{\rho }_{v}}{dt}=[linear\,terms]+\sum _{i,j}\,({\frac{d{\rho }_{v}}{dt}|}_{i\to j}^{v\to w}-{\frac{d{\rho }_{v}}{dt}|}_{i\to j}^{w\to v}),\,i\in \{a,c,e\},\,j\in \{b,d,f\},\\ \frac{d{\rho }_{w}}{dt}=[linear\,terms]+\sum _{i,j}\,({\frac{d{\rho }_{v}}{dt}|}_{i\to j}^{w\to v}-{\frac{d{\rho }_{v}}{dt}|}_{i\to j}^{v\to w}),\,i\in \{a,c,e\},\,j\in \{b,d,f\}.\end{array}$$
(14)
Figure 13
figure 13

The pair e becomes d when a node update from a to f takes place.

Note that some terms like \({\frac{d{\rho }_{e}}{dt}|}_{a\to f}^{e\to b}\) are zero. Thus, in this way we are able to obtain all the nonlinear terms of Eq. (6).

Initial condition

When one integrates numerically Eq. 6 it is important to ensure that the initial condition satisfies the relations (1). This is achieved by using as initial condition

$$\begin{array}{rcl}{\rho }_{a}(0) & = & {x}_{0}^{2}(1-{\ell }_{0})\\ {\rho }_{b}(0) & = & {x}_{0}^{2}{\ell }_{0}\\ {\rho }_{c}(0) & = & {(1-{x}_{0})}^{2}(1-{\ell }_{1})\\ {\rho }_{d}(0) & = & {(1-{x}_{0})}^{2}{\ell }_{1}\\ {\rho }_{e}(0) & = & 2{x}_{0}(1-{x}_{0}){\ell }_{2}\\ {\rho }_{f}(0) & = & 2{x}_{0}(1-{x}_{0})(1-{\ell }_{2})\end{array}$$
(15)

where \({\ell }_{0}\) and \({\ell }_{1}\) are the fraction of friendly links within the groups with white and blue opinion, respectively, and \({\ell }_{2}\) is the fraction of friendly links between the white and blue opinion groups. For the sake of simplicity, and otherwise stated, in this work we consider \({\ell }_{0}={\ell }_{1}={\ell }_{2}\).