This project re-implements four classical network generation algorithms in Julia from scratch, based on their original specifications. This provides a well-documented and reproducible implementations of these models, separate to the ones found in the Graphs.jl package.
Generates random graphs by connecting each pair of nodes with a fixed probability p. A foundational model in random graph theory.
Erdős, P. and Rényi, A. (1960). On the evolution of random graphs. Publications of the Mathematical Institute of the Hungarian Academy of Sciences, 5, 17–60.
Generates small-world networks characterised by high clustering coefficient and short average path lengths, by rewiring edges of a regular lattice with probability p.
Watts, D.J. and Strogatz, S.H. (1998). Collective dynamics of 'small-world' networks. Nature, 393, 440–442.
Generates scale-free networks through preferential attachment, where new nodes are more likely to connect to already well-connected nodes, producing degree distributions following a power law.
Barabási, A.L. and Albert, R. (1999). Emergence of scaling in random networks. Science, 286(5439), 509–512.
Generates random graphs with a specified degree sequence, connecting pairs of edges. The sum of degrees (from the degree sequence) must be even or otherwise it is not realisable.
Molloy, M. and Reed, B. (1995). A critical point for random graphs with a given degree sequence. Random Structures and Algorithms, 6, 161–179.
├── LICENSE ├── README.md ├── network_generators.jl # Implementation of all four classical network generation algorithms └── network_properties.jl # Function to compute and analyse structural network properties
These are: all four network centrality measures (degree, closeness, betweenness and eigenvector) and corresponding measure of inequality (Gini coefficient), clustering coefficient (local and global/transitivity, average path length/mean geodesic and network diameter.
Julia 1.x or above. Install required packages by running:
using Pkg
Pkg.add(["Graphs", "Random", "Statistics", "Inequality", "DataFrames", "CSV"])include("network_generators.jl")
include("network_properties.jl")
# Example: Generate an Erdős–Rényi random graph
# with 100 nodes and connection probability 0.05
g = ER_model(100, 0.05)
# Example: Generate a Watts–Strogatz small-world network
# with 100 nodes, 4 nearest neighbours, rewiring probability 0.1
g = WS_model(100, 4, 0.1)These implementations were developed as part of a broader research project looking at realistic synthetic social network generation for agent-based simulation models during my research associate position at Durham University (2023–2026) in collaboration with Dr. Jen Badham.
- Social Circles — we assess the suitability of this distance-based network generator originally created by Hamil and Gilbert (2009) as a generalisable network generator.
Find out more about my work in my Portfolio