{'fraction_non_alphanumeric': 0.036038675651919136, 'fraction_numerical': 0.012180318948558035, 'mean_word_length': 5.028766086298259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Effect of Segregation on Opinion Formation in Scale-free Social Networks: An Agent-based Approach

We consider the effect of segregation on opinion formation in social networks with and without influential leaders in scale-free random networks, which is found in many social and natural phenomena. We have used agent-based modeling and simulation, focusing on the social impact model of opinion formation. Two simulation scenarios of this opinion formation model have been considered: (1) the original scenario which randomly assigns persuasion strengths to the agents, and (2) a centrality-based scenario, which assigns persuasion strengths proportional to the agents’ centralities. In the latter scenario, hubs are considered more influential leaders who are more connected to others and have higher persuasion strengths than others. The simulation results show a correlation between segregation and change of population opinion in the original model, but no correlation between both variables in the centrality-based scenario. The results lead us to conclude that with strong influential leaders in society, the effect of segregation in opinion formation is neglectable. doi: 10.5829/ije.2021.34.01a.08


INTRODUCTION 1
Opinion formation is a social contagion [1] or collective behavior process [2], describing how opinions forms in society due to the members' communication. Opinion formation is essential in studying consumer behavior, organizational behavior, predicting election results, and many others. Many studies have been conducted on opinion dynamics. Some studies have shown public opinion formation through online social networks, the largest infrastructure for social interactions [3], in general topics and discussions [4,5] as well as in many social movements and national referendums, e.g., the Arab Spring of 2011 [6], the US presidential 2016 election [7], and the Brexit referendum [8].
In opinion formation studies, a common approach is to model social opinions by a binary value to reflect two different opinions, e.g., approval and disapproval in a referendum like Brexit [8]. The social the other group and becomes the majority opinion group of society in equilibrium [13,14].
The concept of leadership is also notable in opinion formation. The existence of influential leaders with high persuasion strengths and a lot of connectivities with other individuals in a society may have lots of effects on opinion dynamics and opinion formation. Some studies have shown the role of troll factories and bot networks with high connectivities to lead the public opinions in election campaigns even by spreading fake news [7,8,15].
In this research, we consider the effect of segregation in the social impact model of opinion formation using an agent-based modeling approach. To understand the role of segregation in the social impact model, we compare the results of two scenarios of the model: the original scenario in which persuasion strengths of the agents are randomly assigned; and a centrality-based scenario in which according to some social psychology studies the strength of persuasion of individuals is proportional to their centralities in the network. Among the various centrality measures, we have used the agents' node degrees, the simplest and the most commonly used centrality measure.
The rest of this paper is organized as follows. Section 2 summarizes the background of this study. In section 3, we explain the methodology. Section 4 presents the results. In section 5, we analyze and compare the results, and Section 6 concludes this study.

1. The Social Impact Model of Opinion Formation
Opinion formation describes how opinions about a specific topic evolve among individuals who interact with each other [16]. Many opinion formation models have been introduced in recent decades, mainly as agent-based models, in which agents represent individuals in society.
The social impact model of opinion formation [2] is based on the social impact theory in psychology formulated by Bibb Latané [9]. According to this theory, the impacts on individuals are exerted by the real, implied, or imagined presence or actions of one or more people or even groups. The impact of source agents on a subject agent depends on three factors: the (spatial, closeness, time, or abstraction) distance of the source agents from the subject agent, the source agents' strength of persuasion, and the number of source agents. The social impact model is a discrete opinion model. Every agent takes an opinion from the conventionally binary values '-1' or '+1'. The binary opinion values could be interpreted as the agents' stances about a specific topic in two stances, for example, 'for'/ 'against' or 'agree'/ 'disagree'.
In the simplest version of the social impact model [17], we have N agents in the model with opinions oi=1 for i=1,2,.., N. In every time step, the impact on agent i is calculated as Equation (1), in which, pj denotes persuasiveness strength of agent j, the strength of the agent j to persuade agent i with opponent opinion to change its opinion. Similarly, sj denotes the supportiveness strength of agent j, the strength of the agent j to convince agent i with the same opinion to keep its current opinion. The parameter dij denotes the distance between the agents i and j, and  determines how fast the impact increase between agents i and j by decreasing their distance.
Since opinions are from the binary value set 1, the summations of Equation (1) calculate the impact of the agents to change and keep the current opinion of agent j. The former summation calculates the change impact, and the latter summation calculates the keep impact.
The opinion dynamics is expressed by Equation (2), which predicts the opinion of agent i in the next time step using its current opinion (oi), the social impact on it (Ii), and a random field representing all sources other than social impact affecting the opinion of agent i denoted by hi. The sign function of Equation (2) maps negative values to -1 and positive values to +1.

Segregation in Social Networks
Segregation is a consequence of homophily in real-life social networks. Homophily is the tendency of similar individuals to bounded with each other, which can be related to one or more features, and affects the network structure [18]. Some examples of common features include gender, race, age, and education level. Therefore, links are more likely to form between similar individuals in a common community [19] than between dissimilar individuals, and the segregation phenomenon happens. Segregation is defined as the degree to which two or more groups are separated from one another [10]. Segregation could be used in many aspects of social networks, including individuals' opinions. In [20], for example, segregated opinions about US presidential elections have been detected using data collected from Twitter.
To measure the degree of segregation in a social network, various indexes have been introduced, including the segregation matrix index (SMI) [10,21]. SMI originally assumes two segregated sub-networks, while could be generalized for more sub-networks. Suppose an undirected network of N nodes, with m11 links in sub-network 1 and m22 links in sub-network 2.
SMI assigns a number to each segregated sub-network. To calculate SMI, the densities of links in both subnetworks are calculated using Equations (3) and (4) (4) in which, m11+ and m22+ denote the number of all possible links in sub-networks 1 and 2, respectively, calculated as Equation (5) and Equation (6), assuming sub-networks 1 and 2 consists of n1 and n2 nodes, respectively: Then, the density of between-group links is calculated as Equation (7): in which, m12+, the number of all possible links between both sub-networks, is calculated as Equation (8): In the next step, SMI for both sub-networks is calculated by Equation (9) and Equation (10) which are normalized to a quantity between -1 and +1. The subnetwork with higher SMI is more segregated.

3. Opinion Leadership in Social Networks
Opinion leaders are individuals who exert personal influence on other people in certain situations [22] and have a significant role in opinion formation. From the social-psychological viewpoint, the influence of an opinion leader on the others is related to three factors: (1) who one is: the personification of certain values by the opinion leader's figure; (2) what one knows: the competence or knowledge related to the leaders; and (3) whom one knows: the strategic location in the social network [23]. One's influence on group opinions depends on how well-connected one is in the social network that determines communication [24]. Noelle-Neumann proposed a 10 item 'personality strength' scale to measure to what extent people perceive self-confidence in leading and influencing others, and according to a survey with 270 samples accomplished by Weimann and colleagues, network centrality was compared to the 10-item personal strength rating and a correlation of +0.54 was found between the individual's number of communication links and the personality strength measures, and they claimed this correlation was even higher when relating the personality strength to the number of communication links within the individual's clique or group [25]. Another study on a fandom newsgroup in USENET [26], shown a direct correlation between the number of posts with the influential ability. Some studies use the term evangelists for well-connected opinion leaders in online social networks to express their influence on society's opinion formation [27,28]. Some studies have also revealed a correlation between opinion leadership and leaders' centrality in the network using an agent-based modeling approach [12][13][14]25].
Therefore, from the social structure point of view, leaders are the more influential people who are wellconnected to other nodes, often called 'hubs' [29,30]. Although the correlation between influence and network centrality has been explained in the literature, less attention has been paid to the role of opinion leaders in the context of opinion formation on social networks.

METHODOLOGY
We have used an agent-based modeling approach [31], which has widely been used in opinion formation models [32,33]. To study the effect of segregation on opinion formation, we considered a noise-free social impact model; thus, we supposed hi=0 in Equation (2), the equation for opinion dynamics. More details of our method are described in the following subsections.

1. Equilibrium Phases
In the noise-free social impact model, after some time steps of the simulation, one of the following equilibrium phases or states may occur [12] and terminate the simulation run:  Frozen phase: No change is observed in the agents' opinions advancing the time step.
 Orderly fluctuated phase: At least one agent changes its opinion every other time steps, i.e., after some time steps, there are agents whose opinions are the same as their opinions in two time steps ago (and other agents' opinions are the same as the previous time step). Figure 1 shows how an orderly fluctuated phase may occur. Possible opinions are shown in black and white. The agents' persuasiveness and supportiveness strengths assumed to be the same, and dij between every agent pairs, i, and j, are supposed to be equal. Applying the social impact model rules cause the circular agents to change their opinions, regularly in every time step, while the rectangular agents do not change their opinions.

2. The Network Topology
The structure of the social network of interacting agents affects opinion dynamics. Heavy-tailed distributions occur in complex systems, including social networks, and can help in data interpretation [34]. Although the universality of scalefreeness in social networks is controversial, it is common to claim that most of these networks are scalefree in the real-world [35].
In this research, we used the Barabási-Albert algorithm [36] to generate random scale-free networks of agents' connections. This algorithm starts from m0 nodes, and using a preferential attachment mechanism adds every new node with m1 edges that links the new node to previously added nodes with probability proportional to the nodes' degrees. The generated network is a scale-free network with power-law node degree distribution. We assumed m=2 and m0=2 to generate random networks using this algorithm. Scalefree networks generated by this algorithm have a large number of small loops, which in turn cause many segregated nodes and groups [37].

Two Assignment Scenarios
We regarded two scenarios: the original scenario and the centralitybased scenario. In the original scenario, the persuasiveness and supportiveness strengths were assigned using a random variable from the uniform distribution Uniform(0, 100). In the centrality-based scenario, we considered the correlation between opinion leadership and the centrality of the agents in the network (as discussed in section 2). Therefore, persuasiveness and supportiveness strengths, i p and i s respectively, are assigned directly proportional to the node degrees according to Equation (11): where d(i) denotes node degree of agent i and  denotes the maximum node degree in the network. Figure 2 shows the pseudo-code for the simulation algorithm. We assumed 1000 agents (line 1). For every agent i, pi and si are assigned according to the simulation "scenario" (line 8), which is either "original" or "centrality-based" as mentioned before. It is also assumed that 1/(dij)  =1.

4. Pseudo-Code of the Model
The 'for' loop at line 16 implements a one time step of the model. The simulation time steps continue by the 'while' loop of line 11 until a 'frozen' or 'orderly fluctuated' phase occurs. During this 'while' loop, values of S and  are calculated. S indicates the difference of SMIs of both opinion groups, calculated as: in which, S-1 and S+1 denote SMI values of '-1' and '+1' opinion groups, respectively.  indicates the difference between the percentage of '-1' opinion group before and after each time step, calculated as: in which next and current denote the percentage of '-1' opinion group in the next time step and the current time step, respectively.
Every iteration of the 'for' loop of line 2 runs one replication of simulation. In every simulation replication, a new random seed is assigned to generate a various random numbers sequence. After 30 replications of simulation, implemented by for loop at line 2, the scatter plot for S and  variables is drawn, and the Pearson correlation coefficient is calculated in line 40.

RESULTS
To study the correlation between segregation and opinion formation in both mentioned scenarios of the social impact model of opinion formation, the original and the centrality-based scenarios, the simulation algorithm ( Figure 2) has been run for both scenarios. The outputs of the simulation runs are presented in this section.

1. The Original Social Impact Model
Each simulation replication continues until an equilibrium phase, frozen or orderly fluctuated phase; therefore, every time step becomes one data sample for considering the correlation. Figure 3 shows  values, the percentage of '-1' opinion group, at every time step until an equilibrium phase for simulation of the original model.
As Figure 3 shows, simulation replications start from initial =50%.  As discussed for the pseudo-code of the simulation, for every time step depicted in Figure 3, a pair of S and  variables is calculated. The scatter plot of these pairs is shown in Figure 4, which shows a positive correlation between S and . The calculated Pearson correlation coefficient is equal to 0.728 (p-value < 0.01), indicating a strong positive correlation between S and . Both normality and homoscedasticity test have been passed. We used the D'Agostino-Pearson method and Levene method for the normality and homoscedasticity tests, respectively. The straight line on the scatter plot has been fitted using the least-square method.

2. The Centrality-Based Social Impact Model
Very similar to the original model, the diagrams for the centrality-based model have been generated. Similar to      Figure 4 for the original social impact model, Figure 6 shows the scatter plot of pairs of S and  variables. Unlike the original model, none of the normality and homoscedasticity tests, which are the conditions for calculating the Pearson correlation coefficient, have been passed; therefore, there is no correlation between S and  in this scenario.

DISCUSSION
The scatter plots presented in the previous section reveal the association between segregation and change of the agents' opinions. As these plots show, there is a strong correlation between segregation and opinion change in the original scenario, and there is no correlation between these parameters in the centrality-based scenario.  In the scatter plot of Figure 4 for the original model, when S=0, which means both opinion groups have the same SMI, none of both groups dominate the other group; therefore, the number of members of both opinion groups does not change much. Thus,  remains the same as the previous time step, =0, and the fitted line passes roughly through (0,0). A positive value for S means that the group with opinion '-1' is more segregated than the group with opinion '+1'.
As Figure 4 shows, the opinion '-1' becomes more dominant, and some agents from the other group ('+1' opinion group) change their opinion to '-1'. Hence,  increases and result in a >0. With similar reasoning, S<0 results in a <0, as the figure shows. The calculated Pearson correlation coefficient, r=0.728, reveals a strong correlation between the independent variable S and the dependent variable .
In the centrality-based scenario, as Figure 6 shows, there is no correlation between S and . In this scenario, since persuasiveness and supportiveness strengths are proportional to the agents' centrality, there are some powerful leaders in society. As explained in section 2, these well-connected agents with high power of leadership could be called evangelists. The few evangelists affect many non-leader (or follower) agents; therefore, many segregated groups are affected by these evangelists. Thus, the segregation phenomenon does not play a significant role in this scenario, as Figure 6 implies, and many segregations are broken.
As comparing Figure 3 and Figure 5 reveals, the trend of  in both scenarios are entirely different. In the original scenario of the model, the diversity of opinion population changes is much less than the centralitybased scenario. It happens due to the various assignments for pi and si in both scenarios. Ii could be regarded as a linear combination of two random variables pj and sj. In the original scenario, pj and sj have the uniform distribution Uniform(0, 100), but in the centrality-based scenario, corresponding variables have power-law distribution according to the node degree distribution in the Barabási-Albert network, P(k)k - with =2.90.1 [36]. Since for 3, the variance of the power-law distribution is theoretically infinite and empirically very greater than the variance of Uniform(0,100), which is equal to 100 2 /12, the variance of the linear combination random variable, Ii, is very greater and cause more diversity of  in the centralitybased scenario advancing the time steps, as comparing the Figure 3 and Figure 5 shows. More details about this comparis on are discussed in [12].

CONCLUSION
The segregation phenomenon and leadership power play essential roles in the social impact model of opinion formation. The results from simulations in this research implies that when powerful leaders exist in a social network, segregation has less impact on opinion formation, and the leadership power of influential wellconnected leaders influences the opinion of society; therefore, the final combination of opinion groups' populations may differ much from the starting one due to these few influential well-connected leaders' existences.
On the other hand, without powerful leaders in a network, segregation strongly affects opinion formation in such a way that with a strong correlation, the more segregated opinion group is less affected by the other group and more affects the other opinion group. In this case, society's opinion may change, but the diversity of change is not so much compared to the case with powerful leaders.
According to the social impact model, influential leaders with strategic points in the network and high influential strengths connect many other individuals and try to persuade them. However, the opposite opinion segregated group(s) resist the leaders' influential strength. If the influential power dominates the segregation resistance, leaders could achieve the major opinion of the society; otherwise, segregated opposite opinion group(s) persist their own opinion. Other convinced people may emerge as opinion leaders during a successful opinion spreading by the leaders, causing a collective behavior breaking many segregated groups until the majority opinion forms.
The conclusions mentioned above could justify that influential well-connected leaders have essential roles to lead society in many social movements. Without these leaders, the segregation phenomenon determines society's opinion formation, which has less effect on society's opinion. In many social decisions, some groups try to form their own desired opinion in society and try to have an opinion leadership role, sometimes using troll and bot networks.
Our conclusion is according to the real world from a sociological viewpoint. Some studies have emphasized the leaders' structural positions in the network, the central points in the network terminology. For example, as discussed in [38], in social movements, social structural conduciveness is necessary (but not sufficient) for social movement mobilization; leaders create the impetus for movements, and structural conditions affect the emergence and effectiveness of leaders. In the online networks, this process may happen at a much faster rate and a larger scale [39,40]. Furthermore, in some cases, bots and trolls influence public opinions, and the main leaders of the opinions are not clear for the public, such as the suspected influence of Russia in Brexit [8] and the 2016 U.S. presidential election [41].
On the other hand, highly segregated groups may resist to opinion change persuasions. The political science literature has confirmed the observation of geographical segregation and partisan alignment, that people tend to segregate themselves into their own political worlds, blocking out discordant voices and surrounding themselves with reassuring news and companions [39].
In this research, we relaxed the noise parameter of the social impact model of opinion formation. However, this parameter is very important and depends upon other parameters, including environment variables and individuals' behaviors in the opinion dynamics process. Further studies could also consider the effects of the noise parameter.
Although this study shows the correlation between segregation and distribution of persuasion strength of the agents in scale-free networks, further studies need to be carried out to understand this correlation in other common network topologies for modeling social networks and using various probability distributions for persuasion strengths of the agents.
According to the results of this research, we concluded a positive correlation between segregation and forming the majority opinion in society using an agent-based simulation approach. However, similar to many other computational social science studies, this conclusion could be more considered by social psychologists using other tools and approaches.