Voter Model & Consensus Dynamics

The voter model is a minimal model of opinion dynamics and neutral genetic drift: each cell copies a random neighbor's opinion with no selection or preference. Despite its simplicity it captures how topology shapes the spread of traits on a network — and how random takeover (fixation) is guaranteed in some geometries but not others. At each generation every cell copies a randomly chosen neighbor. Tab ① shows a 1D spacetime diagram; Tab ② shows a 2D grid. Both support ancestry tracing: click any cell to follow its opinion lineage backward in time. Tab ③ uses two random walkers in 2D vs. 3D to demonstrate why consensus (fixation by drift) is guaranteed in low dimensions but not on an infinite 3D lattice — the key is Pólya's theorem on when two independent random walks must eventually meet.
© 2026 Theodore P. Pavlic  ·  MIT License

1D Voter Model — 200-cell ring — time flows downward
speed 1 gen/frame
generation 0
leader
opinions active
domain edges
What You're Seeing
Each row is one generation of a 200-cell ring with 6 opinions. Time flows downward; colored stripes are domains of like opinion.

Domain edges — boundaries between unlike neighbors — each perform an independent random walk. When two edges meet, they annihilate, reducing the number of domains. Consensus is reached when the last edge annihilates.

This diagram uses the same spacetime format as ECA diagrams. The boundary random walks are directly visible.
Ancestry Trace (Contact Tracing / Dual Process)
Click any cell to trace that column's current opinion ancestry backward in time (model pauses automatically). Each click adds a trace in a new color.
Scaling & Recurrence
Starting from random IC with ~N/2 domain edges, consensus takes O(N) generations (O(N²) micro-steps) on a 1D ring.

On the infinite 1D line, two random walkers are trivially recurrent — they cannot indefinitely avoid each other on a line.

The ancestry traces are visualizations of the dual coalescing Markov chain. Their common ancestor is the point where two lineages coalesce.
Reverse-Time Opinion Ancestry: Consensus Occurs When All Present-Day Lineages Converge to One Ancestor
Each colored line is one cell's opinion lineage traced backward in time (left = present, right = initial time 0). When two lines reach the same position they coalesce — one path continues, one stops, shown as a V-shape with a green oval. When all lineages coalesce, the MRCA (most recent common ancestor) is the common ancestor of every present-day cell. By symmetry, each of the N cells is equally likely to be that ancestor — giving each cell exactly 1/N probability of fixation, the standard neutral drift result.
Voter Model — 2D Torus (24 × 24) · one step = full asynchronous generation
speed 1 gen/frame
generation 0
leader
opinions active
domain edges
What You're Seeing
Each cell copies a random neighbor's opinion — unconditionally. With 6 opinions, domains coarsen by pure drift; opinions go extinct one by one until one absorbs the lattice.

Contact tracing runs time in reverse: who did this cell copy from? This backward chain is the dual coalescing random walk. Two cells whose backward walks reach the same site share a common ancestor and carry the same opinion thereafter — so consensus ↔ all lineages coalesce to one.

By Pólya's theorem, random walks on 2 are recurrent — any two lineages must eventually meet → consensus guaranteed.
Ancestry Trace (Contact Tracing / Dual Process)
Click any cell to trace its opinion ancestry (model pauses). Each click adds a trace in a new color. Note: history depth ~80 generations.
Scaling & Recurrence
Consensus takes O(N log N) generations on a 2D torus — longer than 1D because domain boundaries can take longer detours before annihilating.

The ancestry traces are visualizations of the dual coalescing Markov chain. Their common ancestor is the point where two lineages coalesce. Trace depth is limited to ~80 generations of stored history.
Reverse-Time Opinion Ancestry: Consensus Occurs When All Present-Day Lineages Converge to One Ancestor
Each colored line is one cell's opinion lineage traced backward in time (left = present, right = initial time 0). When two lines reach the same position they coalesce — one path continues, one stops. The ancestry traces on the grid above are single-lineage excerpts of this process. By symmetry each of the N cells is equally likely to be the MRCA (most recent common ancestor), giving each cell exactly 1/N probability of fixation — the standard neutral drift result.
speed each trial = 2000 steps · walkers start at opposite corners
2D Torus — 20 × 20
trial step 0/2000
trials 0
met
3D Torus — 20 × 20 × 20
trial step 0/2000
trials 0
met
What You're Seeing
Each trial places two opinion lineages — walkers A (amber) and B (blue) — at opposite corners of their respective lattices. At each step both walk independently to a random neighbor. A meeting (same cell at the same time, flashing green) means the two lineages would coalesce: they share a common ancestor, and both cells would carry the same opinion from that point forward.

Consensus requires every pair of lineages to coalesce. On a 2D lattice, any two random walkers must eventually meet (Pólya recurrence). On an infinite 3D lattice they can wander indefinitely without meeting (transience) — so some pairs of lineages never coalesce, and consensus is not guaranteed.

The histogram tallies what fraction of trials end in a meeting within 2000 steps. Crank the speed slider to accumulate trials quickly.
% Trials Meeting Within 2000 Steps
Pólya's Theorem
Pólya (1921): Random walks on d are recurrent for d ≤ 2 (meet w.p. 1) but transient for d ≥ 3 (positive escape probability).

Consensus time on a finite torus:
1D: O(N²)
2D: O(N log N)
3D: O(N)

3D converges faster on a finite lattice. But as N → ∞, 3D walkers wander indefinitely → the infinite-lattice 3D voter model does not reach consensus.

Note: even a 20×20×20 finite torus shows lower meeting rates than 2D; the gap grows with lattice size.
Connection to Consensus & Coalescing Lineages
In the voter model, tracing a cell's opinion ancestry backward in time produces a random walk through the lattice. Any two cells whose backward-time walks reach the same lattice site share a common ancestor — and carry the same opinion from that moment forward. Consensus requires all N lineages to coalesce to one ancestor, meaning every pair of lineages must eventually share a site.

This reduces "does the voter model reach consensus?" to "do any two independent random walks on this lattice eventually meet?" — exactly what Pólya's theorem answers. Walkers A and B above are two such lineages. In 2D they always meet (recurrence), so consensus is guaranteed. On the infinite 3D lattice, walkers have a nonzero probability of never meeting (transience), blocking consensus. The histogram accumulates this evidence trial by trial.
Reverse-Time Opinion Ancestry: Consensus Occurs When All Present-Day Lineages Converge to One Ancestor
Each colored line is one cell's opinion lineage traced backward in time (left = present, right = initial time 0). When two lines reach the same position they coalesce — only one path continues. The walkers A and B represent any two lineages; Pólya's theorem determines whether they always meet. By symmetry each of the N cells has probability 1/N of being the MRCA (most recent common ancestor) — the neutral drift fixation result.