Skip to content

Repository files navigation

Agent-Based Model of Online Social Media and Social Networks

National Identity Polarisation in Catalonia

An agent-based model (ABM) of attitude dynamics applied to national identity in the case of Catalonia, Spain. The model integrates online social media (filter bubbles) and offline/online social networks to examine how national identity attitudes can become polarised through the interaction of social influence, network structure (group composition) and algorithmic content filtering.

This research was carried out at the University of Glasgow as part of my PhD project. An earlier version of the accompanying paper was awarded Best PhD Student Paper at the Social Simulation Conference (SSC) 2022, Milan, following its plenary session presentation.

This repository contains the NetLogo model code, experimental design, and data analyses for the model outputs supporting the paper Chueca Del Cerro, C. (2024) The power of social networks and social media’s filter bubble in shaping polarisation: an agent-based model. Applied Network Science, 9, 69, 1-32, https://doi.org/10.1007/s41109-024-00679-3

Supplementary materials are also available on OSF.


Model Overview

The model simulates how agents' national identity attitudes evolve through repeated exposure to information within their social networks, integrating established models of opinion dynamics, social influence and collective action (Deffuant et al., 2002; Hegselmann and Krause, 2002; Mäs and Flache, 2010).

Each agent is initialised with a national identity value drawn from the Centre d'Estudis d'Opinió (CEO) October 2011 survey dataset on Catalan national identities. At each simulation step, agents receive information either from a connected agent or an information hub and make two sequential decisions:

  1. Whether to share the information with their network
  2. Whether to update their national identity attitude in response

Agents account for the national identity similarity of their in-group members when deciding whether to share received information.

Network Structure

Two distinct network layers are used to reflect offline and online social contexts:

Network Topology Average Degree Network Size
Offline Watts–Strogatz small-world 23 100% of agents (2,500)
Online Barabási–Albert scale-free 45 80% of agents (2,000)

Filter Bubbles and Homophily

Two experimental conditions test how algorithmic and network structure factors independently and jointly shape polarisation:

  • Filter bubbles — when active, agents preferentially receive attitude-supportive information; when inactive, agents receive attitude-supportive and attitude-discrepant information with equal probability.
  • Homophilous network formation — when active, initial network edges are rewired preferentially between agents with similar attitudes (following the bounded confidence principle); when inactive, initial network edges are preserved.

How to Use the Model

Key Controls

  • FILTER-BUBBLE switch — toggles the content filtering algorithm described above
  • NETWORKS switch — toggles homophilous vs. random network group composition
  • Calibrate? switch — toggles whether random national identity distribution or CEO2011 dataset is used for initialisation

Running the Model

  1. Press SETUP to initialise the population and generate offline and online network links
  2. Press GO to run the simulation continuously
  3. Observe resulting national identity dynamics on the histogram output

Note: The View panel does not display the network visually due to the large number of edges. Please use the histogram and exported data for analysis instead.

Things to Notice

After running the model, national identity attitudes typically polarise into one, two or multiple clusters depending on the experimental condition.

Things to Try

  • How does the presence of filter bubbles affect attitude distribution?
  • How do outcomes differ when starting from a random network versus a homophilous network configuration?

Repository Structure

SocSim2022/
│
├── SSC_model.nlogo                              # Main NetLogo model file
│
├── data2011_calibrated.csv                      # CEO Oct 2011 survey data
|
├── data2011_normdis.csv                         # Random Normal distribution version
|
├── offline_edges.csv                            # Initial offline network (Watts–Strogatz) edge list
|
├── online_edges.csv                             # Initial online network (Barabási–Albert) edge list
│
├── CEO Analyses - attribs                       # R analysis: agent attributes (calibrated CEO2011 dataset)
│                                                
├── CEO Analyses - output                        # R analysis: model output evaluation (calibrated dataset)
│                                                  
├── ND Analyses - attribs                        # R analysis: agent attributes (Random Normal dist dataset)
│                                              
├── ND Analyses - output                         # R analysis: model output evaluation (Random Normal dist dataset)
│                                                
├── Catalan Centre of Opinion Studies - Survey.. # Survey documentation / source data reference
│                                                 
├── README.md
└── LICENSE

Requirements

NetLogo Extensions

extensions [csv nw table rnd palette]

R Packages

install.packages("tidyverse")

How to Run

  1. Open SSC_model.nlogo in NetLogo (version 6.x recommended)
  2. Ensure offline_edges.csv, online_edges.csv, and the relevant CEO dataset CSV are in the same directory as the model file
  3. Press SETUP, then GO
  4. Run the accompanying R scripts to reproduce the paper's statistical analyses and figures

Citation

If you use this model or its outputs in your own research, please cite:

Chueca Del Cerro, C. (2024) The power of social networks and social media’s filter bubble in shaping polarisation: an agent-based model. Applied Network Science, 9, 69, 1-32, https://doi.org/10.1007/s41109-024-00679-3


References

  • Deffuant, G., Amblard, F., Weisbuch, G., and Faure, T. (2002). How can extremism prevail? A study based on the relative agreement interaction model. Journal of Artificial Societies and Social Simulation, 5(4).

  • Dunbar, R.I.M., Arnaboldi, V., Conti, M., and Passarella, A. (2015). The structure of online social networks mirrors those in the offline world. Social Networks, 43, 39–47.

  • Flache, A. (2018). Between monoculture and cultural polarization: Agent-based models of the interplay of social influence and cultural diversity. Journal of Archaeological Method and Theory, 25, 996–1023.

  • Flache, A., Mäs, M., Feliciani, T., Chattoe-Brown, E., Deffuant, G., Huet, S., and Lorenz, J. (2017). Models of social influence: Towards the next frontiers. Journal of Artificial Societies and Social Simulation, 20, 1–31.

  • Flaxman, S., Goel, S., and Rao, J.M. (2016). Filter bubbles, echo chambers, and online news consumption. Public Opinion Quarterly, 80(S1), 298–320.

  • Hegselmann, R., and Krause, U. (2002). Opinion dynamics and bounded confidence models, analysis, and simulation. Journal of Artificial Societies and Social Simulation (JASSS), 5, 1–33.

  • Lubbers, M. (2019). When networks speak volumes: Variation in the size of broader acquaintanceship networks. Social Networks, 56, 55–69.

  • Mäs, M., and Flache, A. (2013). Differentiation without distancing: Explaining bi-polarization of opinions without negative influence. PLoS ONE, 8, e74516.

  • Noelle-Neumann, E. (1974). The spiral of silence: A theory of public opinion. Journal of Communication, 24(2), 43–51.

  • Salzarulo, L. (2006). A continuous opinion dynamics model based on the principle of meta-contrast. Journal of Artificial Societies and Social Simulation, 9(1), 1–29.


Acknowledgements

With thanks to Dr. Stefano Picascia for technical support and guidance during model development.


Author

Dr. Cristina Chueca Del Cerro
Portfolio

License

GPL-3.0 license

About

An agent-based model (ABM) of attitude dynamics applied to national identity in the case of Catalonia, Spain with varying social network group composition and social media filter bubbles. Including the codes and analyses.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages