1 Introduction
Driven by the evolution of digital communication, there is an increasing interest for mathematical models of opinion dynamics in social networks. A few such models have become popular in the control community, see the surveys [1, 2]. In the perspective of the control community, opinion dynamics distinguish themselves from consensus dynamics because consensus is prevented by some other dynamical feature. In many popular models, this feature is an opinion dependent limitation of the connectivity. This is the case of bounded confidence (BC) models [3, 4]
, where social agents influence each other iff their opinions are closer than a threshold. This way of defining connectivity, however, seems at odds with several social situations, since it may require an agent to be influenced by an unbounded number of fellow agents. Instead, the number of possible interactions is capped in practice by the limited capability of attention by the individuals. For instance, online social network services are based on recommender systems that select a certain number of news items, those which are closer to the user’s presumed tastes. However, to the best of our knowledge, this important observation has not been incorporated in any suitable model of opinion dynamics, with the partial exception of
[5]. The latter paper compares different models of interaction, including one in which each agent is influenced by a fixed number of neighbors.In a striking contrast, this observation has been made in the field of biology by a number of quantitative studies about flocking in animal groups (these include both theoretical and experimental works) [6, 7, 8, 9]. The importance of this way of defining connectivity has been also captured by graph theorists, who have studied a the properties of what they call nearestneighbors graph. For instance, it is known that must be logarithmic in to ensure connectivity [10] and flocking behavior [11].
In this paper, we provide the first analysis of the nearestneighbor opinion dynamics. In this analysis, our contribution is threefold: (1) We describe the equilibria of the dynamics, distinguishing a special type of clustered equilibria that are constituted of separate clusters; (2) We discuss the robustness of clustered equilibria to perturbations consisting in the addition of new agents; (3) We provide a proof of convergence for small groups, that is, groups such that .
Our work differs from [5] in several aspects. As per the model, the dynamical model in [5] is synchronous and continuoustime, whereas ours is asynchronous and discretetime. As per the analysis, [5] focuses on the equilibria and their properties (for instance, the distribution of their clusters’ sizes) are studied by extensive simulations, whereas we study the dynamical properties (robustness to perturbations, convergence) by a mix of simulations and analytical results. Our robustness analysis is based on the approach taken by Blondel, Hendrickx and Tsitsiklis for BC models [12]. Our convergence result is inspired by classical proofs of convergence for randomized consensus dynamics [13, Chapter 3], but its interest and difficulty originate from the lack of reciprocity in the interactions: this feature clearly distinguishes our model from bounded confidence models, where interactions are reciprocal as long as the interaction thresholds are equal for all agents [3, 5, 14, 15, 16, 17].
2 The dynamical model
Let and be two integers with
and let be the set of agents. Each agent is endowed with a scalar opinion , to be updated asynchronously. The update law
(1) 
goes as follows. An agent is selected from ; the elements of are ordered by increasing values of ; then, the first elements of the list (i.e. those with smallest distance from ) form the set of current neighbors of . Should a tie between two or more agents arise, priority is given to agents with lower index. Agent may but not necessarily does belong to . Once is determined, agent updates his opinion to
while the remaining agents do not change their opinions
We show a couple of simulations to illustrate the possible behaviours of the model, see Figure 1 and 2. For these simulations we set , and choose the initial opinion of every agent uniformly at random in . At every step, we choose from the node that updates opinion, independently and uniformly at random. The simulation of Figure 1 shows a typical outcome: the agents form two distinct groups (of 10 agents each) with homogeneous opinions; for every agent, his neighbors at time have almost the same opinion. This last observation does not hold in the simulation of Figure 2: the two pairs of agents that at time have opinion about 0.6 and about 0.7, respectively, have neighbors with different opinions. These distinct behaviors lead us to distinguish different kinds of equilibria: this will be the topic of the next section.
3 Equilibria
In this section we discuss some properties of the equilibria of system (1). Motivated by the simulations, we introduce the following terminology. Given a configuration , the directed graph that represents the possible interactions (i.e. the opinion dependancies for any possible selection of the node to be updated) is
where is the set of neighbors of , should be selected to update his opinion. Clearly, if the graph is complete. A configuration is an equilibrium for the asynchronous dynamics if
If , then contains only links between nodes with the same opinion: in this trivial case, every configuration is an equilibrium because agents cannot change opinion.
A configuration is called clustered if
that is, if for every node all of his neighbors have the same opinion. Furthermore, a clustered configuration for some is called consensus.
It is immediate to see that clustered configurations are equilibria. However, there exist equilibria that are not clustered. It is possible to obtain a simple counterexample with and and exploiting the tie break rule. Consider any configuration of the form
where and . The above is an equilibrium even if .
The tie breaking rule is not central for the existence of nonclustered equilibria, as one can see in the following example inspired by Figure 2.
Example 1.
Consider with
where and . For instance, the neighbors of agent 12 are because
while the remaining agents are at distance or larger. Such configuration is an equilibrium with .
A simple analysis shows that clustered configuration are those in which the agents form clusters of at least participants with the same opinion. To make this claim formal, let be the set of nodes that share the same opinion of .
Lemma 1.
A configuration is clustered if and only if for every .
Proof.
By definition, in a clustered configuration for every . Assume for every . For any there are at least nodes (including ) with : such nodes have zero distance from and hence . This holds for every so the configuration is clustered. On the other hand, assume that exists with . The set must contain a node with so not in , violating the definition of clustered configuration. ∎
From this result, it follows that a clustered configuration allows up to
distinct sets (and this bound is tight). For the special case of consensus, this claim becomes the following corollary.
Corollary 2.
Consensus is the only possible clustered configuration if and only if
4 Robustness of the Equilibria
The clustered equilibria of the dynamics described above have interesting robustness properties regarding the addition of new nodes or the removal of nodes. The model shows different behavior with respect to a standard Asynchronous Bounded Confidence (ABC) model. In this section, we briefly introduce for comparison the ABC model; then we provide a few simulations to motivate the following discussion of the robustness properties.
4.1 ABC model
Given a fixed range of confidence , we introduce the Asynchronous Bounded Confidence (ABC) update law
(2) 
where is the agent that updates his opinion. The neighborhood of is and always contains itself. The new opinion of agent is
while the remaining agents do do not change opinion
4.2 Simulations
We present a simulation to show the difference between model (1) and model (2) when a few agents are added to a consensus configuration (which is an equilibrium for both models). We set for model (1) and for model (2). We start with 10 agents sharing opinion ; at steps we add a new agent, with opinion chosen uniformly at random in . We select the agent that updates his opinion among those present at that time, independently and uniformly at random: the same selection is used in both models. Figure 3 contains the plots of the simulation. The upper plot regards the dynamics of model (1): the four new agents converge to the consensus opinion, which does not change; they are too few to form a new cluster. The lower plot contains the dynamics of the model (2): the consensus configuration is not preserved and the agent added at step remains isolated during the dynamics and keeps his opinion. The other three new agents join the original ten; this group of 13 agents converge to the same opinion which however is different from the original consensus value.
4.3 Robustness of the equilibria
We now provide a general discussion that explains the observations from Figure 3. Let with be given and consider a clustered equilibria of the model (1). We first discuss the addition of a new agent with opinion to the configuration , that becomes with . Before the addition of the new node, clusters have to contain at least agents. This fact remains true after the addition and we have that
for every , meaning that the original (clustered) portion of the configuration remains unperturbed. For a generic value of the limit of the dynamics has the same cluster locations of , with one of the clusters getting a new member. For some specific values, it may happen that the configuration is a nonclustered equilibrium. In any case, none of the original agents changes opinion. Instead, in the metric ABC model (2) with uniform visibility radius , either the new agent is further apart from the original agents and nothing happens or he falls within the visibility radius of a cluster of agents. In the latter case both the new agents and the agents in the cluster change opinions, converging to an intermediate value.
Assuming sufficiently large, the removal of an agent from a clustered equilibrium presents interesting differences too. In the metric ABC model (2) the removal of an agent does not trigger any dynamics in the remaining agents. In model (1), if the agent is removed from a cluster with agents or more, nothing happens. But if the agent is removed from a cluster with agents, the new configuration is not an equilibrium anymore and the remaining nodes from that group will evolve towards some new equilibrium.
5 Convergence to consensus
In this section we show that process (1) converges to a consensus, provided and the choice of the agent that updates his opinion at time
is an i.i.d. uniform random variable over
. We recall from Section 3 that the consensus is the unique clustered equilibrium for .For , let
be the sequence of opinion vectors and
a sequence of agents. Given an initial configuration , we consider the dynamics(3) 
where is the agent that updates his opinion at time .
We introduce two functions that, given an opinion vector , return respectively the index of the smallest and largest components, with ties sorted
The outer sorts possible ties; note that .
In the following two lemmas we prove the properties of the dynamics in which the agent with smallest opinion is the one that updates his opinion.
Lemma 3.
Given with and an initial configuration consider dynamics (3) with and the scalar sequence . Then:

the set sequence and the scalar sequence are constant;

for every the sequences are nondecreasing and satisfy ;

for every the sequences are constant.
Proof.
The proof goes by induction. First, consider the trivial case with . This condition means for every and thus so everything remains unchanged.
Next, consider the case with . We have
Therefore,
and
Moreover, the cardinality of the set is strictly smaller than . This implies that and also . The claims follow by induction and by observing that only the agents can update their opinions at some time and the updated value belongs to . ∎
Lemma 4.
Given with and an initial configuration consider the dynamics (3) with and the scalar sequence . Then
Proof.
First, compute for a generic . We have
thanks to Lemma 3. Then,
Next, consider the set
and observe that either or because . Since the set contains at most elements, the set is empty. Hence,
for every , a fact that implies
Using Lemma 3 we know that for every and that for every therein, . Therefore
and the thesis follows because . ∎
Lemma 5.
Given with and an initial configuration consider the dynamics (3) with and the scalar sequence . Then:

the set sequence and the scalar sequence are constant;

for every the sequences are nonincreasing and satisfy ;

for every the sequences are constant.
Moreover,
The next equivalence will be crucial in the following.
Lemma 6.
Given with , consider and define the quantities
Then, for every if and only if .
Proof.
We prove the equivalent claim that with exists if and only if . Indeed, if consider the vector such that
where . The set contains the smallest elements of so , while the set contains the largest elements of , so . For the converse, assume that with exists, meaning
Both sets and contain elements, so the sets
contain at least elements each. These two sets are disjoint, thus the vector has at least components. ∎
The next lemma describes a “shrinking sequence”.
Lemma 7.
Proof.
If and the agent that updates his opinion at time is chosen independently and uniformly at random over , then process (3) converges almost surely to a consensus, from any initial configuration. The almost sure convergence is guaranteed because the finite sequence of updates introduced in the Lemma 7
appears infinitely often with probability one. This fact is proved in the following theorem, which provides the desired converge result.
Theorem 8.
Let with be given. Let
be a sequence of independent and uniformly distributed random variables over
and consider dynamics (3). If , thenfor any , with .
Proof.
Let and observe that, for any and ,
because the updates in the dynamics (3), based on model (1), involve convex combinations: the element with highest opinion cannot increase it and the element with lowest opinion cannot decrease it. We introduce the sequence of events with
i.e. the event is the occurrence of the finite sequence introduced in Lemma 7 in the time window . In the same lemma we proved that, given the occurrence of , we have . Observe that
where is the number of times occurred up to time . If then for and the rightmost limit above is zero almost surely. Hence, almost surely, which implies the convergence to consensus. Moreover, because every update in (3) is a convex combination of a subset of the current opinions.
It remains to prove . The events of the sequence are not independent but the events in the subsequence where are. Each of these events has probability
thus . Hence, . From the second BorelCantelli lemma [18, Ch. 2, Thm 18.2] ∎
The result continues to hold for dynamics where is not uniformly distributed over
, as long as the probability to sample each agent is constant and positive. The proof has been based on exhibiting one suitable “shrinking sequence”: however, it is clear that plenty of other sequences could do the job and actually play a role in inducing convergence of the dynamics. Therefore, the proof does not imply any good estimate of the convergence time.
6 Conclusion
In this paper we have introduced a new model of opinion dynamics with opiniondependent connectivity following the nearestneighbors graph. The model is motivated by the rise of online social network services, where recommender systems select a certain number of news items to present to users, reducing the number of possible interactions to those which are closer to the user’s presumed tastes. The resulting dynamics is substantially different from comparable models in the literature, such as boundedconfidence models. One key difference is the inherent lack of reciprocity of the interactions, which makes all convergence analysis challenging. Another key difference is the robustness of the formed clusters, whose opinions are hard to sway by external leader nodes. This feature makes control approaches based on leadership, like [19], unsuitable to nearestneighbors dynamics.
References
 [1] A. V. Proskurnikov and R. Tempo, “A tutorial on modeling and analysis of dynamic social networks. Part I,” Annual Reviews in Control, vol. 43, pp. 65–79, Mar. 2017.
 [2] A. Proskurnikov and R. Tempo, “A tutorial on modeling and analysis of dynamic social networks. Part II,” Annual Reviews in Control, vol. 45, pp. 166–190, 2018.
 [3] U. Krause, “A discrete nonlinear and nonautonomous model of consensus formation,” Communications in Difference Equations, pp. 227–236, 2000.
 [4] G. Deffuant, D. Neau, F. Amblard, and G. Weisbuch, “Mixing beliefs among interacting agents,” Advances in Complex Systems, vol. 03, no. 01n04, pp. 87–98, 2000.
 [5] A. Aydoğdu, M. Caponigro, S. McQuade, B. Piccoli, N. Pouradier Duteil, F. Rossi, and E. Trélat, “Interaction network, state space, and control in social dynamics,” in Active Particles, Volume 1: Advances in Theory, Models, and Applications, N. Bellomo, P. Degond, and E. Tadmor, Eds. Springer, 2017, pp. 99–140.
 [6] M. Ballerini, N. Cabibbo, R. Candelier, A. Cavagna, E. Cisbani, I. Giardina, V. Lecomte, A. Orlandi, G. Parisi, A. Procaccini, M. Viale, and V. Zdravkovic, “Interaction ruling animal collective behavior depends on topological rather than metric distance: Evidence from a field study,” Proceedings of the National Academy of Sciences, vol. 105, no. 4, pp. 1232–1237, 2008.
 [7] I. Giardina, “Collective behavior in animal groups: Theoretical models and empirical studies,” HFSP Journal, vol. 2, no. 4, pp. 205–219, 2008, pMID: 19404431.
 [8] E. Cristiani, P. Frasca, and B. Piccoli, “Effects of anisotropic interactions on the structure of animal groups,” Journal of Mathematical Biology, vol. 62, no. 4, pp. 569–588, 2011.
 [9] A. Aydoğdu, P. Frasca, C. D’Apice, R. Manzo, J. Thornton, B. Gachomo, T. Wilson, B. Cheung, U. Tariq, W. Saidel, and B. Piccoli, “Modeling birds on wires,” Journal of Theoretical Biology, vol. 415, pp. 102–112, 2017.
 [10] P. Balister, B. Bollobás, A. Sarkar, and M. Walters, “Connectivity of random knearestneighbour graphs,” Advances in Applied Probability, vol. 37, no. 1, pp. 1–24, 2005.
 [11] C. Chen, G. Chen, and L. Guo, “On the minimum number of neighbors needed for consensus of flocks,” Control Theory and Technology, vol. 15, no. 4, pp. 327–339, 2017.
 [12] V. D. Blondel, J. M. Hendrickx, and J. N. Tsitsiklis, “On Krause’s multiagent consensus model with statedependent connectivity,” IEEE Transactions on Automatic Control, vol. 54, no. 11, pp. 2586–2597, 2009.
 [13] F. Fagnani and P. Frasca, Introduction to Averaging Dynamics over Networks, ser. Lecture Notes in Control and Information Sciences. Springer Nature, 2017.
 [14] V. D. Blondel, J. M. Hendrickx, and J. N. Tsitsiklis, “Continuoustime averagepreserving opinion dynamics with opiniondependent communications,” SIAM Journal on Control and Optimization, vol. 48, no. 8, pp. 5214–5240, 2010.
 [15] A. Mirtabatabaei and F. Bullo, “Opinion dynamics in heterogeneous networks: Convergence conjectures and theorems,” SIAM Journal on Control and Optimization, vol. 50, no. 5, pp. 2763–2785, 2012.
 [16] C. Canuto, F. Fagnani, and P. Tilli, “An Eulerian approach to the analysis of Krause’s consensus models,” SIAM Journal on Control and Optimization, vol. 50, no. 1, pp. 243–265, 2012.
 [17] F. Ceragioli and P. Frasca, “Continuous and discontinuous opinion dynamics with bounded confidence,” NonLinear Analysis and its Applications B, vol. 13, no. 3, pp. 1239–1251, 2012.
 [18] A. Gut, Probability: A Graduate Course, 2nd ed. Springer, 2013.
 [19] F. Dietrich, S. Martin, and M. Jungers, “Control via leadership of opinion dynamics with state and timedependent interactions,” IEEE Transactions on Automatic Control, vol. 63, no. 4, pp. 1200–1207, 2018.
Comments
There are no comments yet.