Random Graphs & Networks

Erdos-Renyi, small-world, and scale-free networks

Random Graphs and Networks

Flip a coin for every possible edge, rewire a ring, or let the rich get richer. Each simple rule grows a network with its own character.

Erdos-Renyi Random Graphs

Move the vertex and probability sliders and generate new graphs. Watch the graph snap to connected near the threshold p = ln(n)/n.

0
Vertices
0
Edges
13.5
Expected
No
Connected
Connectivity threshold: p ≈ ln(n)/n = 0.230
✓ Above threshold - graph is likely connected
Go deeper:Erdos-Renyi Random Graphs

Random graphs are fundamental models for understanding complex networks in the real world. From social networks to the internet, random graph theory helps us understand how networks form and what properties emerge from simple generative rules.

The Erdos-Renyi model G(n,p) creates a random graph on n vertices where each possible edge exists independently with probability p. There is a sharp phase transition at p = ln(n)/n where the graph almost surely becomes connected — below this threshold it is almost surely disconnected.

Small-World Networks

Slide the rewiring probability up from 0 and watch average path length fall much faster than clustering.

Regular (β=0)Small-WorldRandom (β=1)
Original edges
Rewired edges
Small-World
0.000
Clustering
-
Avg Path
0
Rewired
0
Total Edges
Small-World Properties
High clustering (like regular) + Short paths (like random) = Six degrees of separation!
Go deeper:Small-World Networks

The Watts-Strogatz model demonstrates how adding a few random shortcut edges to a regular lattice dramatically reduces average path length while maintaining high clustering. This explains the “six degrees of separation” phenomenon. Even a small rewiring probability creates short paths across the network while preserving local structure — the defining property of small-world networks found in social, neural, and power systems.

Scale-Free Networks

Press Play or Step to add vertices one at a time. Watch new vertices favor the hubs, so the biggest ones keep growing.

Hub vertices
Regular vertices
New vertex
0
Vertices
0
Edges
0
Max Degree
0
Steps
Degree Distribution
Degree (number of connections)
Go deeper:Scale-Free Networks

The Barabasi-Albert model demonstrates preferential attachment: new vertices connect to existing vertices with probability proportional to their degree. This “rich get richer” mechanism produces hub vertices and power-law degree distributions. Preferential attachment creates a power-law degree distribution P(k) ~ k^(-gamma), making the network robust to random failures but vulnerable to targeted attacks on hub vertices.

Network Properties Comparison

Press Generate All Networks and compare clustering, average path length, and degree range across the four models.

Go deeper:Network Properties Comparison

Different network models have characteristic clustering coefficients, average path lengths, and degree distributions. Watts-Strogatz achieves the small-world sweet spot with both high clustering (like regular lattices) and short paths (like random graphs), while Barabasi-Albert stands out for its wide degree range.

Key Takeaways

  • Erdos-Renyi graphs snap to connected near p = ln(n)/n.
  • A few random shortcuts turn a lattice into a small world.
  • Preferential attachment grows hubs and power-law degrees.
  • Clustering, path length, and degree spread tell the models apart.

Spot a mistake or have an idea?

Search