This repository is a simulation of the Biased Preferential Attachment Model as proposed in the paper Homophily and the Glass Ceiling Effect in Social Networks
The Biased Preferential Attachment Model is an extension of the Preferential Attachment Model which consists of a bi-populated majority-minority network augmented with homophily.
- Bi-populated: Two kinds of nodes exist in the network
- Majority-Minority partition: The two kinds of nodes have a difference in numbers.
- Homophily: Nodes with similar colour (or any quality in general) have higher tendency to connect.
- Install
manim
through the instructions in the docs. (A virtual environment is suggested.) - Clone this repository and navigate into this folder through the terminal.
- Change the parameters for the simulation in the first few lines of
main.py
- n - The number of nodes you want to simulate
- r - Probability of a each new node being red.
- rho - Probabilty of forming an edge with a node of different colour (rho = 1 represents no homophily, rho=0 represents full homophily)
- Run the following commands which will run the simlation and start the output video simulation.
For high quality video output(this will take time, but the output will not be pixelated):
manim -pqh main.py SimulateNetwork
For low quality, quick rendering of output (may lead to some pixelation):
manim -pql main.py SimulateNetwork
- The simmulation video will be saved in the
media
folder for further use.
* Pronounced as jif :P