Cyclic Cellular Automaton

One local rule turns random noise into spirals, labyrinths, and crystalline domains.

Animation of the Cyclic Cellular Automaton model running in Stigmery

Introduction

A cyclic cellular automaton fills a grid with cells that each hold a state on a colour wheel. The same one-line comparison rule, applied everywhere at once, makes random noise spontaneously organise into rotating spirals and other large-scale order. Changing just the number of states and the threshold flips it between completely different regimes.

Background

The cyclic rule was introduced and analysed by mathematician David Griffeath and collaborators in the late 1980s and early 1990s, as part of a broader study of excitable and interacting-particle cellular automata. It became a textbook demonstration of how purely local interactions produce global, self-organising structure - no cell ever "knows" about the spirals it helps build.

Fisch, R., Gravner, J., & Griffeath, D. (1991). Threshold-range scaling of excitable cellular automata. Statistics and Computing, 1(1), 23-39.

How it works

  1. Read the cell’s current state s and compute the next state in the cycle, (s + 1) mod N.
  2. Count how many of the 8 surrounding neighbours are already in that next state.
  3. If that count is at least the threshold, advance the cell to s + 1; otherwise leave it unchanged.
  4. All cells update simultaneously from the previous step’s states, via a double buffer, so no cell sees a half-updated grid.

Parameters

num_states
Length of the colour cycle. A few states (around 3) favour clean spirals; many states tip the grid into never-settling turbulence.
threshold
How many next-state neighbours a cell needs before it advances. Higher thresholds slow the dynamics down or freeze them into static domains.

Open this model in the editor →

Related models