Content uploaded by Henrique Ferraz de Arruda
Author content
All content in this area was uploaded by Henrique Ferraz de Arruda on May 03, 2019
Content may be subject to copyright.
Opinion Diversity and Social Bubbles in Adaptive Sznajd Networks
Alexandre Benatti,1Henrique Ferraz de Arruda,1Filipi Nascimento
Silva,2C´esar Henrique Comin,3and Luciano da Fontoura Costa1
1S˜ao Carlos Institute of Physics, University of S˜ao Paulo,
PO Box 369, 13560-970, S˜ao Carlos, SP, Brazil
2Indiana University Network Science Institute, Bloomington, IN, USA.
3Department of Computer Science, Federal University of S˜ao Carlos, S˜ao Carlos, Brazil
(Dated: May 3, 2019)
Understanding the way in which human opinion changes along time and space constitutes one
of the great challenges in complex systems research. Among the several approaches that have
been attempted at studying this problem, the Sznajd model provides some particularly interesting
features, such as its simplicity and ability to represent some of the mechanisms believed to be
involved in opinion dynamics. The standard Sznajd model at zero temperature is characterized by
converging to one stable state, implying null diversity of opinions. In the present work, we develop
an approach – namely the adaptive Sznajd model – in which changes of opinion by an individual
(i.e. a network node) implies in possible alterations in the network topology. This is accomplished
by allowing agents to change their connections preferentially to other neighbors with the same state.
The diversity of opinions along time is quantified in terms of the exponential of the entropy of the
opinions density. Several interesting results are reported, including the possible formation of echo
chambers or social bubbles. Also, depending on the parameters configuration, the dynamics may
converge to different equilibrium states for the same parameter setting. We also investigate the
dynamics of the proposed adaptive model at non-null temperatures.
I. INTRODUCTION
An important property of complex systems involv-
ing several components regards the distribution of the
states of their components along time. For instance, con-
sider the distribution of the number of species in a given
ecosystem [1]. When only a few species are present, en-
vironmental changes can imply complete extinction of
life. Contrariwise, an ecosystem containing many diverse
species will tend to be more robust. Similar situations
can be found in economy, scientific ideas, arts, among
many other areas. Therefore, it becomes interesting not
only to quantify the diversity of individuals in given com-
plex systems along time, but also to study how these
systems tend to yield more or less uniform state distri-
butions. In addition, it is also important to understand
how modifications in such systems, e.g., by increasing or
reducing inter-connectivity, can influence the respective
diversity of states.
The importance of such studies has been reflected in
the proposal of several modeling approaches, including
the well-known Axelrod [2] formulation of cultural di-
versity/overlap. Such an approach often considers the
complex system of interest to be represented as a com-
plex network. In the Axelrod approach, each opinion is
represented as a vector of Ffeatures that typically take
discrete values. The opinions are allowed to change so
that two neighboring nodes influence one another result-
ing in more similar opinions. Other methods have been
derived from the Axelrod model, such as [3], which takes
into account the movement of the agents, and [4], which
considers the influence of mass media on the opinion dy-
namics. Furthermore, there are many other proposed
approaches for modeling opinion dynamics [5, 6]. For
example, in [7] the authors describe a model were the
agents explore other opinions in a time-varying network
using a random walk dynamics.
Another approach that has been developed and used
for studying opinion dynamics is the Sznajd model [8].
The complex system of interest can be represented as a
network, and topological interactions can be made to in-
fluence the dynamics of opinions. More specifically, it
is frequently adopted that when a pair of neighboring
nodes share the same opinion o, the nodes connected to
this pair tend to be influenced by o. This dynamic de-
pends on a parameter of temperature, w, that controls
the spontaneous change of opinion [9]. Many works have
investigated the Sznajd model [5]. For example, in [10]
the authors include a parameter of social temperature
(the probability of an agent accepting another agent’s
opinion). In [11], the Sznajd model is used for modeling
the distribution of votes in an election process. Some
models incorporating a continuous opinion formulation
have also been defined [12].
The characterization of the diversity of the opinion dy-
namics has often been approached in terms of relative
frequencies of the opinions, while the consideration of
information theory principles such as entropy are more
rarely employed. For instance, in [13] the authors inves-
tigated the relationship between the rewiring parameter
of the Watts-Strogatz model and the diversity of opinions
using the Sznajd model. They found that opinion diver-
sity tends to be inversely proportional to the amount of
shortcuts in the network. For quantifying the diversity of
opinions, they calculated the entropy of the probability
distribution of opinions in the network. It was identified
that an important factor for quantifying diversity in the
Sznajd dynamics is the time required for the dynamics
arXiv:1905.00867v1 [physics.soc-ph] 2 May 2019
2
to reach the steady state.
Because low diversity can be undesired in some situa-
tions, it becomes interesting to devise means to promote
opinion diversity. The current work approaches this is-
sue by considering the Sznajd dynamics and remodeling
of the network topology by changing the opinion of some
nodes and reassigning their connectivity in the network.
More specifically, if a node changes opinion from o1to o2,
it can be disconnected from its neighbours having opinion
o1and reconnected, with probability q, to another node
having opinion o2. Other studies have also incorporated
a rewiring dynamics [10, 14–17].
An approach based on the voter model is proposed
in [14], where a node iis selected at random, and with
a given probability, the agent ican rewire one edge and
connect to a target node that has the same opinion as i.
This mechanism is similar to the proposal for this study.
However, here we employ a more elaborate opinion dy-
namics, in which the sources of the rewires are not chosen
at random. In another study [15], the authors propose
a rewiring dynamics which aims at avoiding connections
with minority and different opinions. The new target
connections are set to neighbors of neighbors.
In social networks, people usually have many connec-
tions, but it is expected that the majority of them can
communicate only with a small number of friends because
of time constraints. Furthermore, many of the social net-
working services automatically suggest connections be-
tween individuals who share common interests. Due to
these characteristics, we propose a dynamics that is exe-
cuted in a network with a limited number of connections
and with the possibility of opinion induced rewiring. This
type of network modification is hoped to promote the di-
versity of opinions in the simulated system. However,
several parameters can influence this effect, including
the temperature w, the network average degree hki, the
rewiring probability p, and the opinion induced rewiring
probability q. So, we perform several experiments in or-
der to identify the effect, isolatedly or combined, of these
parameters on the diversity. Interestingly, this dynamics
can result in a network with more than one connected
component, which can be associated with social bubbles.
Several results are reported and discussed, including
the capability of the proposed dynamics to simulate sit-
uations that result in social bubbles, the fact that the
computed diversity can be strongly affected by the prob-
ability of an agent spontaneously changing its opinion,
and, the possible emergence of two distinct types of opin-
ion distributions with the same dynamics configuration.
As in the standard Sznajd model, the increase in the
temperature led to faster convergence times. Addition-
ally, in the proposed dynamics, the computed diversity
can be strongly affected by the temperature. Depend-
ing on the employed parameters, our dynamics results in
an “echo chamber” (also known as “filter bubbles”), in
which the agents can be connected only with others that
have the same opinion. This result agrees with studies
performed on real social networks [18].
The remaining of this paper is organized as follows. In
section II, we present the Sznajd model. In section III,
we describe the employed methodology as well as the di-
versity measurement and the used network model. In
section IV, we present the results and discussions. Fi-
nally, in section V, we provide the conclusions.
II. THE SZNAJD MODEL
Many different dynamics have been proposed to simu-
late the transmission of opinions [19]. Furthermore, some
of these approaches take into consideration the structure
of complex networks, such as in [20–22]. In this study,
we focus on the Sznajd model [8].
Because there are some variations of the Sznajd dy-
namics on networks, we considered the version adopted
in [22]. In this model, the network nodes are the agents,
NOdefines the maximum number of opinions, and the
agents can also be in an undecided state (null opinion).
The dynamics start with agents having opinions ran-
domly chosen with uniform probability. For each iter-
ation, a node iis selected, and the opinions can change
according to the dynamics rules, as follows:
•If the node iis undecided nothing happens;
•If the node ihas an opinion o, one of the ineigh-
bors, q, is randomly selected with uniform probabil-
ity. By considering the agents iand q, the following
rules are applied:
–If qis assigned as undecided, the opinion of
qis assigned as owith probability inversely
proportional to the idegree;
–if iand qhave the same opinion, than their
neighbors are assigned as owith probability
inversely proportional to the iand qdegrees,
respectively;
–If iand qhave different opinions, nothing hap-
pens.
Apart from these rules, there is another parameter,
w(0 ≤w≤1 ), called temperature, which is used to
control the probability of an agent to change its opinion
randomly, with uniform probability among the remaining
opinions. This change does not assign the node to the
undecided opinion.
III. METHODOLOGY
In this section we describe the adopted variation of the
Sznajd model and the employed methodology to quantify
the results, including the definition of the diversity mea-
surement [23].
3
A. Adaptive Sznajd Model
We adopt the Sznajd model to simulate friendship
dynamics, which consequently can promote diversity of
opinions and can lead to social bubbles. For that, we
included rules that control the rewiring of the edges,
which modify the structure of the network according to
the agent’s opinions. This dynamics is henceforth called
Adaptive Sznajd Model (ASM). At the same iteration of
the Sznajd model, if one or more nodes change their opin-
ions, the following rules are applied with probability q
(opinion induced rewiring probability):
•If an agent changes its opinion to another that is
different from the opinions of all other nodes, noth-
ing happens;
•If the new opinion is equal to all of its neighbors,
nothing happens;
•If the two above situations did not occur, the node
deletes one connection with a node that has a dif-
ferent opinion and connects to another node having
the same opinion. This connection is randomly se-
lected with uniform probability.
The above rules are not employed when the agent’s opin-
ion changes only because of the temperature.
B. Diversity
In order to quantify the effective number of states,
many researchers from distinct areas have been employ-
ing measurements of diversity [23]. For example, to com-
pute diversity of species in ecology [24], to calculate prop-
erties of networks [25], to identify influential spreaders
in information diffusion [26], and to analyze brain re-
gions [27]. Additionally, in [13] the authors quantified
the diversity of opinions in the Sznajd model. As in [13],
in order to compute diversity, here we considered each
opinion as representing one different state.
The diversity is defined based on information theory,
more specifically on the Shannon entropy of the opinions
frequency in the network. The diversity is calculated as
D= exp (H),(1)
where His the the Shannon entropy, which is defined as
H=−
n
X
o=1
ρoln(ρo),(2)
where ρois the relative frequency of state oand nis the
number of states (number of different opinions). Here,
n=NO+ 1, because of the null opinion. Taking an
example in which ρ1= 1 and the remaining states are
zero, then D= 1. Furthermore, in the case when ρ1=
0.5, ρ2= 0.5, and the remaining states are zero, D= 2.
In other words, if there is a single state, D= 1, and if
there are xstates with similar probabilities, D≈x.
C. The adopted network model
In this study, we test our dynamics on Watts-Strogatz
(WS) networks [28]. This model starts with a regular
network with Nnodes, here we adopt a regular 2D lattice
having toroidal boundary condition. Each edge of the
network is rewired with probability p. If a given edge
(i, j) is to be rewired, a new node l6=iis randomly chosen
with uniform probability, and the edge is altered to (i, l).
Here, we fixed the number of nodes as N= 1089. We
chose this network model because it allows the generation
of networks ranging from a lattice-like topology (p≈0)
to a completely random connectivity (p= 1).
D. Identifying the equilibrium states
Since the considered dynamics will exhibit, for each
given network topology, varying diversity along time, it
is important to devise means to standardize the time in-
terval in which the diversity is studied. Figure 1 shows
examples of the unfolding of diversity along time for four
different dynamics configuration, namely: (a) hki= 8,
q= 0, p= 0.001, and w= 0 (this is the standard Sznajd
model); (b) hki= 8, q= 1, p= 0.001, and w= 0; (c)
hki= 8, q= 0.6, p= 0.001, and w= 0; and (d) hki= 8,
q= 0.6, p= 0.001, and w= 0.05. Observe that tem-
perature is set to zero for cases (a) to (c), while case (d)
considers a non-zero temperature.
An interesting result, also found for many other config-
urations, is that the diversity always tend to an equilib-
rium value, after which it remains constant or nearly so
(in the case of non-zero temperature). So, it is possible
to perform our analysis of diversity after equilibrium is
achieved, which is henceforth adopted. For each set of
parameter values used in the experiments, the number of
iterations necessary for achieving the equilibrium state
was visually determined.
IV. RESULTS AND DISCUSSION
In the following, we present the results and their re-
spective discussion regarding the proposed Sznajd model,
describing the influence of temperature (w), opinion in-
duced rewiring probability (q) and average network de-
gree (hki) on the diversity of opinions.
A. Convergence in the ASM
We begin by analyzing the diversity of opinions as a
function of the number of iterations of the dynamics,
shown in Figure 1. Each plot shows 100 executions of
the dynamics using the same network parameters. In the
case of Figure 1(a), which was computed with q= 0 (the
standard Sznajd model), the diversity always goes to 1,
but for some cases it may take a long time to reach this
4
(a)hki= 8, q= 0, p= 0.001, and w= 0. (b)hki= 8, q= 1, p= 0.001, and w= 0.
(c)hki= 8, q= 0.6, p= 0.001, and w= 0. (d)hki= 8, q= 0.6, p= 0.001, and w= 0.05.
FIG. 1. Diversity of opinions as a function of the number of iterations of the dynamics. The parameters used in each experiment
are indicated below each plot. Each curve represents a different executions of the dynamics.
consensus state. In contrast with this result, by consid-
ering q= 1, (see Figure 1(b)), the dynamics leads to a
diversity higher than one. So, there is more than one
opinion in the final state of the dynamics. Furthermore,
in most cases the obtained diversity is close to 2, which
indicates that each opinion is held by half of the nodes.
The cases with diversity higher than 2 happen due to
the presence of isolated nodes having the null opinion.
By considering an intermediate value of the opinion in-
duced rewiring probability (q= 0.6), in the majority of
the cases, the dynamics leads the diversity to be near 1
(see Figure 1). However, there is a possibility to have di-
versity equals to 2. By employing the same parameters,
but also including temperature (w= 0.05), the measured
diversity tends to values near one. In addition, the tran-
sient time reduces significantly (one order of magnitude).
B. Parameters analysis of the ASM
In order to better understand how diversity changes
according to the initial configuration of the networks
and parameter qof the dynamics, we plot the average
curves of diversity and the respective standard deviations
against qfor distinct values of rewiring parameter p. Here
we considered some selected sets of parameters, as shown
in Figure 2. The high values of standard deviations are
found because the diversity can attain many different val-
ues at the equilibrium. This effect is observed for many
of the tested parameters, as shown in Figure 1. So, in
order to better visualize the results, we plot only 25% of
the standard deviations. All values were obtained after
the dynamics reached the equilibrium, and the dynamics
was executed 100 times for each set of parameters. The
results indicate that lower values of presult in higher di-
versity. In other words, the more organized the network
is, the more diverse the opinions become. Furthermore,
for q < 0.5, the average diversity tends to be close to one,
while for q > 0.5 the diversity increases according to q.
5
FIG. 2. Average diversity of opinion as a function of the
opinion induced rewiring probability (q) for different rewiring
probabilities (p). The averages were calculated over 100 real-
izations of the dynamics. Shaded regions represent 25% of the
standard deviation respectively to the curves with the same
color.
In the following, we analyze the relationship among the
mean diversity and opinion induced rewiring probability,
q, and temperature, w. These results are shown in Fig-
ure 3. Each point in the surface was computed using 500
executions of the dynamics. In Figure 3(a), we present
the results for hki= 4, in which there is a well-defined
region with diversity approximately equal to 2 (yellow re-
gion of the network). A visualization of a typical network
obtained for a dynamics having diversity equal to 2 for
w6= 0 is shown in Figure 4. Colors represent the opinion
of the nodes. The visualization shows that the network
becomes divided into two main communities, each com-
munity being associated to a different opinion. So, sev-
eral sets of parameters of the dynamics led to two social
bubbles with approximately the same number of agents.
When we consider hki= 8, this situation also happens,
but for a more restricted set of parameters. Contrariwise,
for hki= 12 there are no social bubbles. As a conclusion,
as the average degree increases, the possibility of having
a social bubble decreases. Furthermore, the possibility of
social bubbles appearing in the dynamics also increases
for lower values of wand higher values of q.
In another example, we considered a network having
2500 nodes with ten opinions that were randomly as-
signed as an initial condition. After the transient, the
dynamics converge to 10 groups and there are no nodes
with the null opinion. Interestingly, because of the tem-
perature (w= 0.05), the groups of agents do not generate
disconnected components. In other words, some agents
are connected to others with different opinions. Addi-
tionally, the computed diversity is 9.55, which means that
the groups of different opinions have similar sizes.
(a)hki= 4.
(b)hki= 8.
(c)hki= 12.
FIG. 3. Mean diversity measurement as a function of q(opin-
ion induced rewiring probability) and w(temperature). The
network rewiring probability is p= 0.01 and the average de-
gree is (a) hki= 4, (b) hki= 8 and (c) hki= 12.
C. Twin Equilibrium States in the ASM
In order to better understand the conditions in which
social bubbles can happen, we plot histograms of diver-
sity by varying the opinion induced rewiring probability
6
FIG. 4. Network visualization by considering 2 opinions and
the following parameters: hki= 4, q= 0.5, w= 0.05, and p=
0.06. The colors represent the opinions. This visualization
was created using the software implemented in [29].
FIG. 5. Network visualization by considering ten opinions and
the following parameters: hki= 4, q= 0.5, w= 0.05, and p=
0.06. The colors represent the opinions. This visualization
was created using the software implemented in [29].
(q). The histograms and the respective average diversi-
ties are shown in Figure 6. In this case, we set w= 0
to analyze only the relationship between diversity and q.
When qincreases, the probability of having higher values
of diversity also increases. Interestingly, for all cases, the
diversity is usually near 1 or 2. In other words, inter-
mediate diversity values rarely occur, and they can only
happen for specific values of q. So, its is clear that the
average diversity (red line in the plot) cannot correctly
describe the behavior of the dynamics in the equilibrium
state. We can also analyze the most likely diversity to be
attained at the equilibrium state of the dynamics, which
is given by the position of the largest peak of each his-
togram shown in Figure 6. This information is presented
in Figure 7 together with the average diversity. The re-
sults show that there are two more likely organizations;
the first consists of two social bubbles with similar sizes,
and the second a single opinion that spans the entire net-
work. Therefore, a larger diversity of opinions is usually
observed when q > 0.75.
FIG. 6. Distributions of diversity values obtained for 1000
realizations of the dynamics for several values of q. The re-
maining parameters of the dynamics are hki= 8, p= 0.001,
w= 0. The red line shows the mean diversity of each his-
togram.
V. CONCLUSIONS
The study of human opinion dynamics remains a chal-
lenging research activity. The Sznajd model has been of-
ten employed in order to reproduce and predict aspects
of opinion changes. While standard approaches are char-
acterized by a single equilibrium state at zero tempera-
7
FIG. 7. Comparison between the most likely diversity and
the mean diversity, according to the histograms presented in
Figure 6.
ture, it is interesting to consider more flexible behaviors
capable of capturing more elaborate aspects of opinion
dynamics. In the present work, we developed an adap-
tive Sznajd model in which the connections of the net-
work representing the interactions between individuals is
allowed to change in order to accommodate neighboring
agents to share the same opinion. More specifically, after
changing its opinion, one agent is allowed, with a certain
probability, to modify its connections to new neighbors
with the same opinion.
Several interesting results were obtained. First, we
found that the average degree hkistrongly influences
the opinion dynamics. More specifically, the smaller this
value, the higher the diversity and the chance of appear-
ing an echo chamber, which is also facilitated by larger
values of the parameter q(opinion induced rewiring prob-
ability). The effect of the parameter wis more elabo-
rate in the sense that, when it takes smaller values the
chance of obtaining echo chambers is increased. How-
ever, for larger values of w, the diversity increases but
the probability of having social bubbles tends to become
zero. Overall, it has been observed that small parameter
variations can lead to rather distinct opinion dynamics,
which corroborates the complexity of such systems and
complicates the chances of characterizing and predicting
human opinion. This complexity is further substantiated
by the identification that different equilibrium states can
be reached for the same parameter configuration. We
also observe that the formation of social bubbles in the
adaptive Sznajd model is in agreement with experimental
results [18].
The reported approach and results pave the way to sev-
eral future works. For instance, it would be interesting
to consider more opinions, other network types and sizes.
Other possible related research include the characteriza-
tion of phase transitions and other criteria controlling the
topology modifications.
ACKNOWLEDGMENTS
Alexandre Benatti thanks Coordenao de Aperfeioa-
mento de Pessoal de N´ıvel Superior - Brasil (CAPES)
- Finance Code 001. Henrique F. de Arruda acknowl-
edges FAPESP (grant no. 2018/10489-0). C´esar H.
Comin thanks FAPESP (grant no. 18/09125-4) for finan-
cial support. Luciano da F. Costa thanks CNPq (grant
no. 307333/2013-2) and NAP-PRP-USP for sponsorship.
This work has been supported also by FAPESP grants
11/50761-2 and 2015/22308-2.
[1] S. A. Levin, Ecosystems 1, 431 (1998).
[2] R. Axelrod, Journal of conflict resolution 41, 203 (1997).
[3] C. Gracia-L´azaro, L. F. Lafuerza, L. M. Flor´ıa, and
Y. Moreno, Physical Review E 80, 046123 (2009).
[4] A. H. Rodr´ıguez and Y. Moreno, Physical Review E 82,
016111 (2010).
[5] C. Castellano, S. Fortunato, and V. Loreto, Reviews of
modern physics 81, 591 (2009).
[6] Y. Dong, M. Zhan, G. Kou, Z. Ding, and H. Liang,
Information Fusion 43, 57 (2018).
[7] P. F. Gomes, S. M. Reia, F. A. Rodrigues, and J. F.
Fontanari, Physical Review E 99, 032301 (2019).
[8] K. Sznajd-Weron and J. Sznajd, International Journal of
Modern Physics C 11, 1157 (2000).
[9] M. S. Ara´ujo, F. S. Vannucchi, A. M. Timpanaro, and
C. P. Prado, Physical Review E 91, 022813 (2015).
[10] M. He, B. Li, and L. Luo, International Journal of Mod-
ern Physics C 15, 997 (2004).
[11] M. Gonzalez, A. Sousa, and H. Herrmann, International
journal of modern physics C 15, 45 (2004).
[12] S. Fortunato, International Journal of Modern Physics C
16, 17 (2005).
[13] B. Messias, F. N. Silva, C. H. Comin, and L. d. F. Costa,
arXiv preprint arXiv:1809.00729 (2018).
[14] P. Holme and M. E. Newman, Physical Review E 74,
056108 (2006).
[15] F. Fu and L. Wang, Physical Review E 78, 016104 (2008).
[16] R. Durrett, J. P. Gleeson, A. L. Lloyd, P. J. Mucha,
F. Shi, D. Sivakoff, J. E. Socolar, and C. Varghese, Pro-
ceedings of the National Academy of Sciences 109, 3682
(2012).
[17] G. Iniguez, J. Kert´esz, K. K. Kaski, and R. A. Barrio,
Physical Review E 80, 066119 (2009).
[18] D. Nikolov, D. F. Oliveira, A. Flammini, and F. Menczer,
PeerJ Computer Science 1, e38 (2015).
[19] R. Hegselmann, U. Krause, et al., Journal of artificial
societies and social simulation 5(2002).
[20] F. A. Rodrigues and L. DA F. COSTA, International
Journal of Modern Physics C 16, 1785 (2005).
[21] M. Gonz´alez, A. Sousa, and H. J. Herrmann, The Eu-
ropean Physical Journal B-Condensed Matter and Com-
8
plex Systems 49, 253 (2006).
[22] A. T. Bernardes, D. Stauffer, and J. Kert´esz, The Eu-
ropean Physical Journal B-Condensed Matter and Com-
plex Systems 25, 123 (2002).
[23] L. Jost, Oikos 113, 363 (2006).
[24] T. Leinster and C. A. Cobbold, Ecology 93, 477 (2012).
[25] B. A. N. Traven¸colo and L. d. F. Costa, Physics Letters
A373, 89 (2008).
[26] G. F. De Arruda, A. L. Barbieri, P. M. Rodr´ıguez, F. A.
Rodrigues, Y. Moreno, and L. da Fontoura Costa, Phys-
ical Review E 90, 032812 (2014).
[27] R. F. Betzel, J. D. Medaglia, and D. S. Bassett, Nature
communications 9, 346 (2018).
[28] D. J. Watts and S. H. Strogatz, nature 393, 440 (1998).
[29] F. N. Silva, D. R. Amancio, M. Bardosova, L. d. F. Costa,
and O. N. Oliveira Jr, Journal of Informetrics 10, 487
(2016).