Oskar Bosgraaf, Boyu Chen, Alicja Dorobis, Theo Würtzen
This is the repo that holds code to reproduce all of our results and figures.
The simulator itself cannot use any assert statements, as these cannot be compiled into JAX code; however, we do use assert statements in other reused library code, and test some code with pytest, see below.
Disinformation, misinformation and fake news are becoming an increasingly pressing issue, particularly due to today’s nature of information sharing, which has been critically changed by the proliferation of social media and the advent of quick content generated by Artificial Intelligence. The increased spread of false content leads to the polarisation of political views, which can have a profound impact on democratic processes as well as increase the risk of political instability and reduce social cohesion.
This project aims to investigate the sudden transition from neutrality or consensus to bimodal polarisation to draw conclusions about disinformation spread in social networks. This research aims to investigate these mechanisms by firstly replicating the methodology by Evangelatos et al. titled “Modelling Disinformation Spread in Social Networks: Phase Transitions and Mean-Field Analysis” and secondly by expanding this model through incorporating temporal dynamics.
Please find the slides titled "Presentation" attached, which includes a detailed description of findings in the speaker notes.
RQ: How do propaganda events alter the critical threshold at which a social network transitions to a different belief state?
H1: There exists a temperature threshold separating disordered opinion dynamics from ordered consensus states in the absence of external influence.
H2: For a fixed temperature, increasing the memory coefficient increases the robustness of the system against external influence, requiring a larger fraction of exposed agents to induce global opinion alignment.
H3: Network topology affects the system’s vulnerability to external perturbations, with Scale-Free networks being more susceptible due to the presence of highly connected hubs.
The framework utilises a dynamic mean-field framework with a Three-State Potts Model to simulate disinformation adoption on a social network graph. This approach divides the population into three belief categories: adoption, rejection, and neutrality of the disinformed belief. This approach also incorporated a heterogeneous coupling strength, meaning the coupling strength accounts for hubs which exert stronger pulling forces, thus closer mirroring the dynamics of real-world scale-free networks. Furthermore, this study also closely simulates human psychology through memory effects, where a memory coefficient allows an individual’s prior beliefs to influence their current state. Finally, Monte Carlo simulations will be conducted, which will allow for the observation of transient dynamics.
The original study will be extended by adding temporal dynamics through a propaganda event, which is implemented as a time-varying external field. While the initial model utilises memory effect to reinforce a belief, the extended model will use a pulse localized in time to affect a fraction of the population of the network to investigate tipping points / critical thresholds. The pulse will allow us to measure steady state before and after the event. To address the research question, this new model will be studied using multiple Monte-Carlo simulations and parameter sweeps of the model.
In this project, we study the spread of disinformation in social networks using an extended Ising/Potts-style model of opinion dynamics. Agents interact on a network and update their opinions based on neighbour influence, individual memory, temperature (noise), and a time-dependent external field representing propaganda. We systematically investigate how temperature, memory strength, exposure fraction, and network topology influence opinion alignment and polarisation. The model is studied on three different network topologies: Erdős–Rényi, Small-World, and Scale-Free networks.
Evangelatos, S., Veroni, E., Efthymiou, V., & Nikolopoulos, C. (2025). Modeling Disinformation Spread in Social Networks: Phase Transitions and Mean-Field Analysis. ACM Trans. Web, 19(4), 46:1-46:24. https://doi.org/10.1145/3747287
Dorogovtsev, S. N., Goltsev, A. V., & Mendes, J. F. F. (2008). Critical phenomena in complex networks. Reviews of Modern Physics, 80(4), 1275–1335. https://doi.org/10.1103/RevModPhys.80.1275
20.01 - Submit Project plan
22.01 - Reproduce baseline Ising/Potts model without external field & Implement network generation (Erdős–Rényi, Small-World, Scale-Free)
23.01 - Perform temperature sweeps and identify phase transitions & Generate bifurcation plots and example trajectories
26.01 - Finalised core model implementation
28.01 – Compare robustness across network topologies & Finalize numerical results and report draft
29.01 - Presentation prep and finalise slides
30.01 - Presentation
01.02 - Clean up codebase and documentation
git clone https://github.com/Whatisthisname/ComplexSystem.git pip install -r requirements.txt
clustering_coefficient.py holds the functions used to approximate the clustering coefficient in a big graph.
gen_images_of_graphs.py can be executed to generate images of 3 networks that show the different topologies that we experiment with in this project. This was purely for the slides.
ising_efficient.py holds our efficient JAX implementation of the 3-state Potts model with the time-varying external field. It's a class that can be instantiated and then .run_for_steps(*) to store results.
network_generation.py holds 3 functions that each take some network parameters and create a compressed-sparse-row format adjacency matrix for different network topologies (erdos-renyi, scale-free, small-world) that we use in the simulator.
plot_clustering.py can be executed to create plots for the clustering coefficient experiments from the appendix in the slides.
run_data_collection.py can be executed to run the simulation for a range of parameters. The results are then stored in the results/lambda_walk/ directory, for later processing.
sparse_adj_mat.py holds the definition of the sparse_adj_mat.Sparse_Adjacency_Matrix class that is just the implementation and helper functions for the compressed-sparse-row format for adjacency matrices.
test_clustering_coefficient.py uses pytest to test the implementation of the approximate and exact clustering coefficient calculation algorithm.
topology_simulation.py (used in network_topology.ipynb) and heatmaps/*.py hold the functions used for the main experiments, hypothesis 2 and 3. The heatmaps/*.py files generate the voronoi plots from 2D Halton sequences of points. These files also use the .pkl files like opinion_change_threshold_erdos.pkl and memory_vs_fraction_temp_1.5_v4.pkl to store results and to refine and add more points to increase resolution if desired. topology_simulation.py is plotting, for given parameter sets, simulation trajectories and animating them.
bifurcation/bifurcation.py has code to generate the bifurcation temperature sweep, while bifurcation/bifurcation.ipynb is a convenience notebook to play around with plotting parameters after the data has been collected.
use_network_example.py is what the name says, it imports the ising_efficient.py library and uses the simulator to give a minimal runnable example.
voronoi.py has code to plot the voronoi diagrams. Partially it is code from stackoverflow that we have cited in the file as well.
diameter.ipynb can compute the diameter of a network, where we also group by belief beforehand.
project_report.ipynb was our intermediate results-gathering place.
gif_generation.ipynb, well, generates GIFs.
To replicate the findings of this study, execute the scripts in the following order.
- Run: python bifurcation/bifurcation.py
- Analyze: Use bifurcation/bifurcation.ipynb to visualize the steady-state magnetization
See how different topologies (Erdős-Rényi, Small-World, Scale-Free) respond to propaganda events (Hypothesis 2). There is a topology string that should be changed to one of three literals to get the three different graphs.
- Run: python heatmaps/*.py
- Run: python topology_simulation.py and use the gif_generation.ipynb notebook. This produces figures saved in the results folder.
- Run: Execute the memory-specific Voronoi scripts in the heatmaps/ directory.
- Run: python plot_clustering.py - approximate clustering coefficients over time to see how components merge or fragment during exposure.