Live v1.0.0

Watts–Strogatz
Small World Model

An interactive network simulation showing how a tiny amount of random rewiring turns an ordered lattice into a small world.

Problem

Real social networks are neither perfectly ordered (ring lattices) nor fully random. The "six degrees of separation" phenomenon suggests that any two people are connected by a surprisingly short chain — yet our local social clusters remain highly interconnected. Standard graph models couldn't explain both properties at once.

Approach

Built an interactive Watts–Strogatz simulator with a live HTML5 Canvas graph. Users control network size (N), mean degree (k), and rewiring probability (p) via sliders. As p increases from 0 to 1, the graph transitions from a ring lattice through a small-world regime and into a near-random graph. Two key metrics — average path length (L) and clustering coefficient (C) — update live, alongside a precomputed phase-transition chart showing how L and C co-evolve across the full range of p.

Key Insight

At just p ≈ 0.01–0.05, average path length drops dramatically while clustering barely changes. This is the small-world sweet spot: still highly clustered (like a lattice) but with short average distances (like a random graph). The simulation makes the phase transition visceral — you can drag the slider and watch L collapse while C holds firm.