Home▸Probability & Statistics▸Percolation Theory (2D) — Site & Bond Lattice, Union-Find

Percolation Theory (2D) — Site & Bond Lattice, Union-Find

A live square-lattice percolation lab: a weighted union-find over independently random sites or bonds finds the spanning cluster the instant it forms, so you can watch the phase transition happen as you drag p through the critical threshold p_c.

Probability & Statistics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-percolation ↗ Open standalone

This 2D companion runs the same site/bond percolation theory as the 3D version through a plain, readable canvas view: a weighted union-find with path compression tracks connectivity across the lattice, two invisible "virtual" nodes wired to the top and bottom rows let the page detect the exact moment a spanning cluster forms, and because every site or bond is assigned a fixed random number once (not re-rolled on every drag), sliding the occupation probability p reveals more of the same underlying randomness rather than a new random pattern each time — so you can watch the giant component grow continuously as p crosses the critical threshold p_c, rather than jumping between unrelated snapshots.

⚙ Under the hood

2D percolation lab on a real square lattice: a weighted union-find over independently random sites or bonds finds the spanning cluster live as you drag the occupation probability p through the critical threshold p_c ≈ 0.593 (site) or exactly 0.5 (bond).

percolation theorysite percolationbond percolationphase transitioncritical thresholdunion-find

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)