The sandpile model is a
cellular automaton originally defined on a N\times M rectangular grid (
checkerboard) \Gamma\subset\mathbb{Z}^2 of the
standard square lattice \mathbb{Z}^2. To each vertex (
site,
field) (x,y)\in\Gamma of the grid, we associate a value (
grains of sand,
slope,
particles) z_0(x,y)\in\{0,1,2,3\}, with z_0\in\{0,1,2,3\}^\Gamma referred to as the (initial) configuration of the sandpile. The dynamics of the automaton at iteration i\in\mathbb{N} are then defined as follows: • Choose a random vertex (x_i,y_i)\in\Gamma according to some probability distribution (usually uniform). • Add one grain of sand to this vertex while letting the grain numbers for all other vertices unchanged, i.e. setz_i(x_i,y_i)=z_{i-1}(x_i,y_i)+1 andz_i(x,y)=z_{i-1}(x,y) for all (x,y)\neq(x_i,y_i). • If all vertices are
stable, i.e. z_i(x,y) for all (x,y)\in\Gamma, also the configuration z_i is said to be stable. In this case, continue with the next iteration. • If at least one vertex is
unstable, i.e. z_i(x_u,y_u)\geq 4 for some (x_u,y_u)\in\Gamma, the whole configuration z_i is said to be unstable. In this case, choose any unstable vertex (x_u,y_u)\in\Gamma at random.
Topple this vertex by reducing its grain number by four and by increasing the grain numbers of each of its (at maximum four) direct neighbors by one, i.e. setz_i(x_u,y_u) \rightarrow z_i(x_u,y_u) - 4,, andz_i( x_u \pm 1, y_u \pm 1) \rightarrow z_i( x_u \pm 1, y_u\pm 1) + 1 if ( x_u \pm 1, y_u\pm 1)\in\Gamma.If a vertex at the boundary of the domain topples, this results in a net loss of grains (two grains at the corner of the grid, one grain otherwise). • Due to the redistribution of grains, the toppling of one vertex can render other vertices unstable. Thus, repeat the toppling procedure until all vertices of z_i eventually become stable and continue with the next iteration. The toppling of several vertices during one iteration is referred to as an
avalanche. Every avalanche is guaranteed to eventually stop, i.e. after a finite number of topplings some stable configuration is reached such that the automaton is well defined. Moreover, although there will often be many possible choices for the order in which to topple vertices, the final stable configuration does not depend on the chosen order; this is one sense in which the sandpile is
abelian. Similarly, the number of times each vertex topples during each iteration is also independent of the choice of toppling order. ==Definition (undirected finite multigraphs)==