Erdos-Renyi and Watts-Strogatz models.
The project I did for my Information Retrieval course. This project is solely for sharing my implementation, not for further development.
Example implementation of the Erdos-Renyi and Watts-Strogatz graph network models using networkx in Python.
- Language : Python 2.7
- Libraries : NetworkX, Numpy, Matplotlib, Math
- Erdos-Renyi model : run
src/ERModel.py
- Watts-Strogatz model : run
src/WSModel.py
- You can modify the parameters for each model in their respective source files (e.g.
a = watts_strogatz_model(500, 4, 0.001)
insrc/WSModel.py
) to see how the results vary. - For the Erdos-Renyi model the large number of
max_nodes
(8000-10000) results in a very long computation time. Formax_nodes = 3000
anddelta = 20
, the computation time was more than 15 minutes. - For a full description, formulas and plots check my report in the
docs
folder.