Introduction

Multi-agent models of opinion formation are used to investigate many collective phenomena in social networks, such as the formation of consensus1,2,3,4,5, information spreading and aggregating6,7,8 and wisdom of crowds9,10. An opinion formation model generally contains two aspects: an opinion updating rule and an underlying social structure. The agents are usually supposed to be boundedly rational in the process of updating opinions11,12. Therefore, myopic updating rules, such as taking a linear combination of other agents' opinions and following a majority rule, are prominent in existing models1,2,3,9,10,13,14,15,16,17. The social structure, which is represented by various sorts of networks, might be assumed to be fixed during the process of formation, randomly time-varying, or time-varying according to certain principles1,9,17,18,19.

One of the extensively studied models is the Hegselmann-Krause model (HK model for short), where all agents are boundedly confident such that each agent updates her opinion by averaging all agent opinions that differ from her own by less than a threshold called the bound of confidence20,21,22,23,24,25,26. The social structure in the HK model is based on the homophily principle in sociology27. This model represents opinion dynamics in the real world to a certain extent, while still leaves a plenty of room for improvement. For example, cutting off connections with other individuals exclusively according to the bound of confidence is quite unrealistic. From experience, we might be more inclined to communicate with those who hold similar opinions, but communicating actively or passively with others who have quite different opinions is sometimes inevitable in the real world. Motivated by this consideration, a modified bound confidence model is proposed in Ref. 28, in which each agent collects some randomly selected opinions regardless of the opinion distance and one agent is influenced by the weighted average of the selected opinions if it is inside her bound of confidence. In this way, agents might be influenced by some quite different opinions.

By modifying the traditional HK model, in this paper we present a bounded confidence plus random selection model, where each agent can directly communicate with those whose opinions are inside her bound of confidence and meanwhile selects a few long-range neighbors outside the bound according to a similarity-based probability rule, i.e., one agent has a relatively large probability to be a neighbor of another agent outside her bound of confidence if the distance between their opinions is relatively small. We introduce a parameter to tune the randomness of the selection of neighbors, which also represents to what extent the difference on opinions affects two agents' neighboring relationship. We theoretically prove that all agents could reach a consensus in bounded time steps regardless of the values of bound of confidence and we provide an upper bound of convergence time. We also show that a larger bound of confidence, a larger number of long-range neighbors and higher randomness in the choice lead to faster convergence to a consensus. This is apparently different from the traditional bounded confidence models where the population might be divided into multiple clusters if the bound of confidence is below a certain threshold.

Besides the proposed model mentioned above, we also investigate the opinion formation in another scenario that, ignoring the bound of confidence, each agent selects all her neighbors randomly according to the aforementioned similarity-based probability rule. This model also represent the homophily principle in social networks in the sense that agents with similar opinions have high probabilities to communicate with one another. The probability of any pair of agents being neighbors is proportional to the distance between their opinions. An related model was proposed in Example 8.7 of Ref. 29, in which agents place positive weights on all others and place higher weight on opinions closer to their own. Since the underlying network is completely connected and there is a lower bound on weights, a consensus is reached among all agents from any starting opinions. As for our model, we find that opinions of the whole group can also reach a consensus, but in the probability sense and more long-range neighbors and higher randomness in the choice lead to faster convergence.

Results

The bounded confidence plus random selection model

Consider agents in a social network as a vertex set V = {1,2,…,n}. The opinion of agent i at time t is denoted by . The distance between two agents, say i and j, in terms of opinions is denoted by . The process of selecting neighbors consists of two steps. Firstly, agents choose their neighbors according to the bound of confidence denoted by r > 0. More specifically, the set of agent i's neighbors whose opinions are inside her bound of confidence is defined as

Each agent also chooses several long-range neighbors outside her bound of confidence according to a similarity-based rule. The probability that agent i chooses agent j as her long-range neighbor is as follows (The detailed selecting process can be found in the Method section):

For simplicity, we assume that all agents randomly select the same number of long-range neighbors, which is set to be β. All the long-range neighbors of agent i compose her another set of neighbors, N1,2(t). The overall set of neighbors of agent i is denoted by . We introduce the parameter α in (1) to tune the randomness of the selection. A relatively small α corresponds to that agents are less affected by opinion distance in the selection of long-range neighbors and thus, the selection is highly random. We can also interpret the parameter α as a measure of the openness of the society. A relatively small α corresponds to that the society is more open to different opinions.

As for the opinion updating rule, each agent i is assumed to adopt the algebraic average of opinions of her neighbors and her own as the new opinion, i.e.,

where is the cardinality of the set Ni(t). The updating rule (2) has the same form as that in most of the traditional opinion formation models1,2,3,9,20,21,22,23,24,25,26.

In contrast to the traditional bounded confidence models where the bound of confidence heavily affects the convergence of opinions and separated clusters might appear under a relatively small bound of confidence, the opinions in the proposed model can reach a consensus in finite time regardless of the values of bound of confidence. For the case where at least one long-range neighbor outside the bound of confidence, the upper bound of convergence time is

It is clear that a positive bound of confidence guarantees opinions of all agents reach a consensus in finite time and the convergence time decreases as r increases (see the Supplementary Information (SI) for details).

After characterizing the convergence of the opinion formation, the following computer simulations focus on how the convergence speed is influenced by different values of α, β and r. We conduct the simulations on 100 agents whose initial opinions are randomly distributed in the interval [0,1]. The value ranges of the parameters are as follows: , and . The result is shown in Fig. 1, which consists of four subfigures corresponding to four different values of r. Here we say the whole group reaches a consensus, if the distance between the maximum and the minimum of all opinions is less than 10−4.

Figure 1
figure 1

Impact of the openness of the society (α) and the number of long-range neighbors (β) on the opinion formation under different bounds of confidence (r).

A relatively large α corresponds to that agents are more inclined to communicate with those who hold similar opinions. The initial opinions of all agents are randomly distributed in [0,1]. Four subfigures are corresponding to four different bounds of confidence. The overall trend in each subfigure is similar to the others, while the convergence time varies under different bounds of confidence. The result is averaged over 100 realizations.

It is shown in Fig. 1 that the final consensus among the opinions of all agents can be achieved in a finite number of steps. By comparing the four subfigures we can see that the convergence time decreases as the bound of confidence increases. This indicates that the bound of confidence has an apparent influence on the convergence speed. Furthermore, for each given r, agents are more inclined to reach a consensus under a small α and a large β. This implies that extensively communicating beyond the difference on opinions facilitates reaching a consensus.

The random selection model of opinion formation

If we assume that agents ignore the influence of bound of confidence and select all neighbors randomly according to the similarity-based probability rule, the result changes dramatically both in theoretical analysis and computer simulations.

Suppose that each agent chooses β neighbors randomly according to the following probability rule (The detailed selecting process can be found in the Method section):

Here we denote the set of agent i's neighbors at time t by Ni(t), which is composed by the β randomly selected neighbors. The opinion updating rule is as follows:

The theoretical analysis indicates that agents in our model reach a consensus in the long run with probability one (see the SI for details).

Though consensus on opinion can be achieved with probability one regardless of the specific values of parameters, the convergence time is still related to the openness of the society, α and the number of neighbors, β. We study the influence of α and β by computer simulations and the maximum number of simulation steps is 104. We conduct the simulations on 100 agents whose initial opinions are randomly distributed in the interval [0,1]. The value ranges of the parameters are as follows: and . The result is shown in Fig. 2. Since the number of steps for convergence under different values of parameters vary up to four orders of magnitude, we plot them on a logarithmic scale. We can see that a relatively small α and a relatively large β help all the agents reach a consensus fast. That is to say, a society where agents communicate with one another extensively and beyond the difference on opinions will make an agreement fast.

Figure 2
figure 2

The number of steps needed to reach a consensus as a function of the openness of the society (α) and the number of neighbors (β).

A relatively large α corresponds to that agents are more inclined to communicate with those who hold similar opinions. The initial opinions of all agents are randomly distributed in [0,1]. The number of steps for consensus is cut off if it exceeds 10000. The result is averaged over 100 realizations.

Discussion

In this paper, we have proposed a bounded confidence plus random selection model of opinion formation, where each agent can directly communicate with other agents whose opinions are inside her bound of confidence and meanwhile randomly selects several long-range neighbors outside her bound of confidence according to a similarity-based probability rule. We introduce a parameter to tune the randomness of the selection of neighbors, which also represents how open the agents are to different opinions. We find that all agents could reach a consensus in finite time and we provide an upper bound of convergence time. Computer simulations further show that a large number of neighbors and selecting neighbors beyond the difference on opinions lead to faster convergence to consensus.

Furthermore, we investigate another situation where agents choose all their neighbors randomly according to the similarity-based probability rule. Theoretical analysis shows that the whole group will reach a consensus with probability one and computer simulations show that the more an agent is inclined to communicate with those who have similar opinions, the slower the convergence speed is.

It is well known that in the traditional bounded confidence models, such as the HK model, if the bound of confidence is not large enough, the whole group of agents might split into different clusters of opinions20,21,22,23,24,25,26. The underlying reason that all the agents in our first model reach a consensus in finite time is that the agents always communicate with at least one agent outside their bound of confidence. This means that there exists no isolated cluster of agents who do not interact with others outside the cluster, which is totally different from the HK model where multiple isolated clusters exist when the bound of confidence is smaller than a certain threshold. This feature allows the distance between the maximum and minimum of all opinions always decreases at a strictly positive rate until the consensus is achieved. The convergence time is finite and its upper bound can be determined in advance for any given number of agents and any bound of confidence.

For the second model, the underlying reason that agents reach a consensus with probability one is that at any time step the probability of any pair of agents being neighbors is strictly positive. As time goes to infinity, any pair of agents are neighbors for infinitely many number of steps with probability one. The sufficient communication among all agents is essential for reaching a consensus.

In our models, agents are homogenous in the sense that they update opinions using the same updating rule. In fact, in the real world individuals are different in certain aspects, such as social status, education level, which results in the diversity of updating rules. Therefore, generalization of the proposed models to opinion formation of heterogeneous agents needs further research. In addition, consensus of opinions is a feature of our models, while persistent disagreement is also common in the real world, which might be caused by the existence of influential and stubborn agents who have great influence on others while do not change their own opinions. Constructing models to represent these situations is also an attractive direction for future work.

Methods

Choosing long-range neighbors outside the bound of confidence

Any agent i's first long-range neighbor is chosen according to the following probability like playing Russian roulette

After the first round, we assume that agent l is selected. At the second round, agent l is deleted from the set of candidates and any agent. is selected as agent i's second long-range neighbor according to the following probability

The following rounds of selecting neighbors are similar and it lasts until β neighbors are obtained. Note that if the number of agents outside the bound of confidence is less than β, agent. simply chooses all the candidates as her neighbors.

Choosing neighbors in the random selection model

Now we assume that each agent randomly chooses all her neighbors according to a probability rule. The number of neighbors at each time step are set to be β (1 ≤ β ≤ n − 1), which are selected sequentially in the way the above subsection mentioned. More specifically, at time t, agent i chooses agent j as her first neighbor according to the following probability

After the first round, we assume that agent l is selected. At the second round, agent l is deleted from the set of candidates and any agent is selected as agent i's second neighbors according to the following probability

The following rounds of selecting neighbors are similar and it lasts until the given number of neighbors are obtained.