NetLogo banner

 Contact Us

 Modeling Commons

 User Manuals:


NetLogo User Community Models

(back to the NetLogo User Community Models)

Social influence in networks

by Michael Maes (Submitted: 09/05/2013)

[screen shot]

Download Social influence in networks
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

(You can also run this model in your browser, but we don't recommend it; details here.)


Based on the famous bounded-confidence model by Hegselmann and Krause (2002), this program allows you to develop hypotheses about the effects of homophily and network structure on the outcomes of social-influence processes in networks. In particular, you can identify the conditions under which the influence process results in perfect opinion homogeneity (consensus) or opinion diversity (clustering).

Homophily, the first independent variable, models that individuals tend to interact only with others who hold similar opinions. The corresponding "BC-level" slider manipulates how similar two agents need to be to have impact on each others' opinions.

The structure of the network is the second independent variable. The R-slider manipulates the degree to which the network is clustered. That is, if R is set to zero, the network consists of two network clusters where all members of a cluster are connected to each other. There is, however, only a single link between the two clusters. Thus, this network is connected but maximally clustered. When R adopts higher values, the program randomly rewires ties R times, which leads to more links between the network clusters. We implemented the Maslov-Sneppen-rewiring algorithm (2002), which only manipulates network structure and keeps the number of network links in the populations as well as the number of connections of each agent constant.

Each agent is described by a variable that represents her opinion. Opinions can adopt any value between zero and one. On the interface, the color (red shades) of the agents depicts their opinion.

In addition, agents are connected to other members of the population by network links. A network link represents that the connected agents can influence each other. Links are fixed. However, whether or not the opinion of a connected agent is influential at a given point in time depends on the similarity between the agents. On the interface, a green link shows that the two agents hold identical opinions. Black links depicts that the agents hold different opinions, but the opinion difference is not too big. If the opinion difference exceeds the threshold defined by the "BC-level " slider, however, links turn red. This shows that the two agents do not exert influence on each other’s opinions, although they are connected.

Initially, agents are assigned a random opinion value, which is drawn from a uniform distribution. At each tick, the opinions of all agents are updated. The updated opinion is the average of the opinions of the networks contacts that are not too different.

The opinion updating continues until dynamics reach equilibrium. There a two possible equilibria. First, dynamics settle when all agents hold identical opinions (consensus). Second, equilibrium is reached when agents have formed opinion clusters where all members of a cluster hold identical opinions but the opinion differences between members of different clusters exceed the "bounded-confidence" threshold.

On the interface, select the size of the population, using the N-slider, and how strong homophily is, using the BC-level slider. For instance, when you set the BC-level slider to a value of zero, agents are influenced only by those network neighbors that are perfectly similar. A BC-level of 1, on the other hand, assumes that agents are influenced by all network neighbors. A value of 0.5 would imply that agents are influenced only by those network neighbors that hold opinions that differ not more than 0.5 from the focal agent's opinion.

Finally, select a network structure with the R-slider. When you click the setup button, the system is initialized. Next, click the run button and the program will update agents' opinions until equilibrium is reached

On the interface, there are four output graphs, which visualize the dynamics of the model. First, there is a histogram of the opinion distribution in the population. Second, a graph shows the development of the range of the opinion distribution (max[opinion] - min[opinion]). Third, a graph depicts the development of the number of opinion clusters. An opinion cluster is a set of agents with identical opinions. Fourth, a graph reports the development of the variance of the opinion distribution.

In addition, we implemented a simple simulation experiment in the BehaviorSpace tool of NetLogo. With this experiment, you can study populations of 100 agents and explore how influence dynamics are affected by the structure of the network and the degree of homophily. The experiment will conduct 100 independent simulation runs per experimental condition.

We implemented the Maslov-Sneppen rewiring algorithm.

We suggest that you use the model to study how network structure and homophily strength affect the degree of opinion diversity in equilibrium. In addition, there are interesting effects of the two independent variables on the number of ticks needed to reach equilibrium.

Three simple extensions might be interesting. First, you may want to study more diverse network structures (see e.g. the examples in the NetLogo model library). Second, you may want to relax the assumption that all agents have the same degree of homophily. In other words, one might include variation in the BC-level of the agents. Finally, it would be interesting to study the robustness of the model predictions to the effects of randomness. The work by Mäs et al. (2010) and Pineda et al. (2009) has shown that the predictions of the Bounded-Confidence model can change in various unexpected ways when noise is included.

The model is similar to Axelrod's model of cultural dissemination, which has been implemented in NetLogo

The Bounded-Confidence model and many very interesting extensions have been implemented by Jan Lorenz here:

The program was written by Michael Mäs and Andreas Flache.

Corresponding author:
Michael Mäs
ETH Zürich
Clausiussstrasse 37
8092 Zürich



Hegselmann, Rainer and Ulrich Krause. 2002. "Opinion Dynamics and Bounded Confidence Models, Analysis, and Simulation." Journal of Artificial Societies and Social Simulation 5 (3).

Mäs, Michael, Andreas Flache, and Dirk Helbing. 2010. "Individualization as Driving Force of Clustering Phenomena in Humans." PLoS Computational Biology 6 (10):e1000959.

Maslov, S. and K. Sneppen. 2002. "Specificity and Stability in Topology of Protein Networks." Science 296 (5569):910-913.

Pineda, M., R. Toral, and E. Hernandez-Garcıa. 2009. "Noisy Continuous-Opinion Dynamics." Journal of Statistical Mechanics P08001.

(back to the NetLogo User Community Models)