Chapter 7: Mechanisms in Programs and Nature

Section 6: The Phenomenon of Continuity

Implementation [of basic aggregation model]

One way to represent a cluster is by giving a list of the coordinates at which each black cell occurs. Then starting with a single black cell at the origin, represented by {{0, 0}}, the cluster can be grown for t steps as follows:

AEvolve[t_] := Nest[AStep, {{0, 0}}, t] AStep[c_] := If[!MemberQ[c, #], Append[c, #], AStep[c]]& [f[c] + f[{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}]] f[a_] := a[[ Random[Integer, {1, Length[a]}] ]]

This implementation can easily be extended to any type of lattice and any number of dimensions. Even with various additional optimizations, it is remarkable how much slower it is to grow a cluster with a model that requires external random input than to generate similar patterns with models such as cellular automata that intrinsically generate their own randomness.

The implementation above is a so-called type B Eden model in which one first selects a cell in the cluster, then randomly selects one of its neighbors. One gets extremely similar results with a type A Eden model in which one just randomly selects a cell from all the ones adjacent to the cluster. With a grid of cells set up in advance, each step in this type of Eden model can be achieved with

AStep[a_] := ReplacePart[a, 1, #[[Random[ Integer, {1, Length[#]}]]] &[ Position[(1 - a)Sign[ ListConvolve[{{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}, a, {2, 2}]], 1]]]

This implementation can readily be extended to generalized aggregation models (see below).

From Stephen Wolfram: A New Kind of Science [citation]