Keywords

1 Introduction

Let us imagine a medium composed of a great number of cells arranged regularly on a grid. Each cell is linked with its immediate neighbours and the only thing it can do is to change its own state according to the state of its neighbours. Can we compute with such a medium? And what happens if the updates occur at random times? And what if the cells are subject to noise?

In order to study this robustness mechanisms on a mathematical basis, we will here focus on two simple computational problems. The first problem is the density classification problem, which is the problem of finding the majority state in a distributed fashion. In the original setting, the computational protocol is required to be local and parallel, and use no extra memory other than the evolving configuration itself. The protocol is also required to be scalable, which means it must perform the task on configurations of arbitrary size. In other words, we look for a cellular automaton rule that performs the task. In this paper, we also consider variants of this problem in which the process is allowed to be asynchronous, non-deterministic or random.

This problem has attracted a considerable amount of attention these last years. It is trivial in most settings but it is not easy to solve in the case of cellular automata. The difficulty comes from the necessity to reach a consensus on the state of the cells: the system should converge to a situation with all 1s or all 0s, depending on whether the initial state contains more 0s or more 1s, respectively.

Inspired by the work of Gàcs, Kurdiumov and Levin, in 1988, Packard formulated this problem as a challenge to study genetic algorithms [11]. This triggered a wide competition to find rules with an increasing quality of classification. In 1995, Land and Belew proved that no perfect solution exists for one-dimensional deterministic systems [9]. Recently, this fact was re-demonstrated with a simpler argument and the proof was extended to probabilistic rules and to any dimension [2]. It was even shown that for any candidate solution there are configurations with a density close to 0 and 1 that are misclassified [8].

Since then, different variants of the problem have been proposed and it has been shown by various authors that relaxing one of the conditions of the problem is often sufficient to find perfect solutions [3]. In particular, Fukś proposed to combine two rules sequentially to obtain a perfect solution, see Ref. [7] and references therein. Probabilistic cellular automata could provide another interesting framework: it was discovered that although no perfect rule exists, it is possible to find a family of one-dimensional nearest-neighbour rules for which the probability of making an error of classification can be made as small as wanted [5]. The perfect solution can thus be approximated – but not reached ! – at the cost of an increase in the average time to reach a consensus.

The construction proposed for building this family of rules consists of mixing stochastically two well-known rules: the traffic rule, which introduces space between particles, and the majority rule, which has a “homogenising” effect. In this text, we ask whether there also exist a “close-to-perfect” solution for two-dimensional cellular automata. At first sight, one does not see why the problem should be significantly different for two-dimensional systems. However, there is no such thing as a “traffic” rule in two dimensions (2D). If we decompose a 2D grid in layers and apply a classical traffic rule on each layer, then different consensuses might be attained and there is no obvious means on how one can obtain the “right” global consensus from a collection of local consensuses.

We call the problem that is solved by the traffic rule in one dimension the particle spacing problem. We tackle this problem in two dimensions. We then (partially) solve the density classification problem by combining our particle spacing model with a local majority rule.

The outline of the article is as follows. After presenting the basic definitions and properties of our models in Sect. 2, we show the advantage of using interacting particle systems to tackle the problem (Sect. 3). We then present a concrete solution and analyse its behaviour with numerical simulations in Sect. 4.

2 Basics

2.1 Setting

In dimension \(d\ge 1\), we set the cellular space to be a grid with periodic boundary conditions, defined by \({\mathcal {L}}= (\mathbb {Z}/n_1\mathbb {Z}) \times \cdots \times (\mathbb {Z}/n_d\mathbb {Z})\), for some \(n_1,\ldots ,n_d\ge 1\). The number of cells of \({\mathcal {L}}\) is \(N_{{\mathcal {L}}}=n_1\cdots n_d\). We say that the grid is even-sized if \(n_1,\ldots , n_d\) are all even.

Each cell of this space can hold a binary state, so that the set of states is denoted by \(Q = \{ {{\mathtt {0}}}, {{\mathtt {1}}}\}\).

The set of configurations is denoted by \(\mathcal {E}=\{{{\mathtt {0}}},{{\mathtt {1}}}\}^{{\mathcal {L}}}\).

For a configuration \(x\in \mathcal {E}\), and a state \(q\in Q\), we define the density of state q by: \(d_q(x)={1\over N_{{\mathcal {L}}}}\mathop {\mathrm {Card}}\nolimits \{i\in {\mathcal {L}}\, ; \, x_i=q\}.\)

For a given configuration \(x\in \mathcal {E}\), we say that cell i is isolated if none of its adjacent cells is in state \(x_i\).

For \(q\in Q\), we say that a configuration \(x\in \mathcal {E}\) is a q-archipelago if all the cells in state q are isolated, i.e., if x does not contain two adjacent cells in state q. We denote by \(\mathcal {A}_q\) the set of q-archipelagos. In particular, if \(x\in \mathcal {A}_q\), then \(d_q(x)\le 1/2\).

We also introduce \(\mathcal {A}=\mathcal {A}_{{{\mathtt {0}}}}\cup \mathcal {A}_{{{\mathtt {1}}}}\), the set of all archipelagos.

Fig. 1.
figure 1

Transformation of a random initial condition. Under some conditions (see Sect. 4 p. 10), the system will most probably converge to \( {{\mathtt {1}}}^{\mathcal {L}}\), which is a correct classification since the initial density is greater than 1/2.

2.2 Presentation of the Problem

Recall that in this paper, we study two computational problems. The density classification task is the task of transforming a given configuration \(x\in Q^{\mathcal {L}}\) into one of the two uniform configurations \({{\mathtt {1}}}^{\mathcal {L}}\) or \({{\mathtt {0}}}^{\mathcal {L}}\) depending on which of \({{\mathtt {1}}}\) or \({{\mathtt {0}}}\) has strict majority in x (see Fig. 1). More specifically, given an input \(x\in Q^{\mathcal {L}}\), a computational process performing the density classification task must return \({{\mathtt {1}}}^{\mathcal {L}}\) if \(d_{{{\mathtt {1}}}}(x)>1/2\) and \({{\mathtt {0}}}^{\mathcal {L}}\) if \(d_{{{\mathtt {0}}}}(x)>1/2\). (Generally, the case \(d_{{{\mathtt {1}}}}(x)=d_{{{\mathtt {0}}}}(x)\) is avoided.)

Our approach to solve the density classification problem is via another problem which we call the particle spacing problem. The particle spacing problem is the computational problem of rearranging the “particles” (say, symbols \({{\mathtt {1}}}\)) on a configuration \(x\in Q^{\mathcal {L}}\) so as to obtain an archipelago configuration (see Fig. 2). Again we require the computational process to be local and scalable, but we also require it to be conservative: at every step of the process, the number of particles (symbols \({{\mathtt {1}}}\)) must be preserved.

There are two possible variants for the latter problem. In the strict spacing problem, we require that the sets \(\mathcal {A}_{{{\mathtt {1}}}}\) and \(\mathcal {A}_{{{\mathtt {0}}}}\) are absorbing, in the sense that as soon as the process enters \(\mathcal {A}_q\) (for either \(q={{\mathtt {1}}}\) or \(q={{\mathtt {0}}}\)), it cannot leave it. In the loose variant of the problem, we require the process to eventually remain in \(\mathcal {A}_q\). Note that the latter is equivalent to the condition that the computation reaches an absorbing subset of \(\mathcal {A}_{{{\mathtt {1}}}}\) or \(\mathcal {A}_{{{\mathtt {0}}}}\).

For both problems, our purpose is to build a solution with a cellular system; this means that we have a set of interacting components, which can have a deterministic or stochastic behaviour, and interact only locally. We will here consider cellular automata (deterministic or stochastic) and interacting particle systems.

2.3 Known Results with Cellular Automata

We now present the principal known results concerning solutions of the density classification problem and of the particle spacing problem, using cellular automata.

Fig. 2.
figure 2

Transformation of a random initial configuration into an archipelago.

A cellular automaton \( {F} : {\mathcal {E}} \rightarrow {\mathcal {E}} \) is defined by a neighbourhood \({\mathcal N}= (v_1, \dots , v_k) \in {\mathcal {L}}^k\), and by a local rule \( {f} : {Q^k} \rightarrow {Q} \), which defines the global rule F, mapping a configuration x to the configuration F(x) defined by:

$$ \forall c \in {\mathcal {L}}, F(x)_c= f\big ( x_{c+v_1}, \dots , x_{c + v_k} \big ) . $$

Proposition 1

For any \(d\ge 1\), there is no deterministic cellular automaton solving the density classification problem. For \( d= 1\), this means that there is no local rule f such that for any \(n\ge 1\), and any \(x\in \{{{\mathtt {0}}}, {{\mathtt {1}}}\}^{\mathbb {Z}/n\mathbb {Z}}\),

$$\begin{aligned} d_q(x)>1/2 \implies \exists T\ge 0, \forall t\ge T, F^t(x)=q^{\mathbb {Z}/n\mathbb {Z}}. \end{aligned}$$

The first proof was given by Land and Belew in 1995 for dimension \(d=1\) [9]. A simplified proof was proposed in 2013 for any dimension \(d\ge 1\) [2]. These results apply to deterministic cellular automata. One can ask whether stochastic transition rules could help to solve the problem. Using the same argument as for deterministic cellular automata, one can prove that there are no probabilistic cellular automata solving perfectly the density classification problem [2].

However, for \(d=1\), Fatès has provided a family of probabilistic cellular automata solving the density classification problem with an arbitrary precision [5]. This means that the probability of making a bad classification can be reduced to as low as necessary, at the cost of an increase of the average time of convergence to the uniform configuration.

The family of rules is defined with a real parameter \(\epsilon >0\). The local rule consists at each time step, for each cell independently, in applying the traffic rule with probability \(1-\epsilon \) and the majority rule with probability \(\epsilon \). The traffic rule (rule 184 with Wolfram’s notations) is a conservative rule, which moves the \({{\mathtt {1}}}\)s to the right whenever possible. It has a spacing effect. The majority rule allows the convergence to the uniform fix point, once particles have been spaced.

In order to extend this result to higher dimensions, one would like to design a rule having the same behaviour as the traffic rule, that is, to be able to compose a rule that solves the spacing problem with a majority rule. Unfortunately, this is not possible in the classical framework of cellular automata.

Proposition 2

  1. 1.

    In dimension 1, the traffic cellular automaton \(F_{184}\) solves the spacing problem. Precisely, it satisfies: for all \(n\ge 1\) and all \(x\in \{{{\mathtt {0}}}, {{\mathtt {1}}}\}^{\mathbb {Z}/n\mathbb {Z}}\),

    $$\begin{aligned} d_q(x)\le 1/2 \implies \forall t\ge n/2, \; F_{184}^t(x)\in \mathcal {A}_{q}. \end{aligned}$$

    Furthermore, \(\forall q\in \{{{\mathtt {0}}}, {{\mathtt {1}}}\}, F_{184}(\mathcal {A}_q)\subset \mathcal {A}_q\), so \(F_{184}\) is a solution to the strict spacing problem.

  2. 2.

    In dimension \(d\ge 2\), there are no cellular automata that solve the spacing problem.

Proof

The fact that the traffic cellular automaton spaces configurations is a “folk” result.

Let now F be a d-dimensional deterministic cellular automaton. If \( x \in \mathcal {E}\) is a configuration with a symmetry of translation, then the symmetry is conserved by the evolution of the automaton. Formally, if there exists \( \delta \in \mathbb {Z}^d\) such that \(\forall c \in {\mathcal {L}}, \, x_c= x_{c+\delta }\), then \(\forall t \in \mathbb {N}, \, \forall c \in {\mathcal {L}}, \, F^t(x)_c = F^t(x)_{c+\delta }\). As a consequence, deterministic cellular automata can not solve the particle spacing problem in dimension \(d\ge 2\). To see why, simply consider a configuration with all \({{\mathtt {0}}}\)s, except one line which is made of cells with all \({{\mathtt {1}}}\)s: if the rule is conservative, this line can not disappear.     \(\square \)

By its very nature, a “truly” probabilistic rule can not solve the particle spacing problem. Indeed, as soon as there exists a configuration for which one cell has a non-deterministic outcome, we cannot ensure that the number of particles will be preserved. We leave open the question as to whether there exists a probabilistic rule which would solve the density classification problem with an arbitrary precision, in dimension 2 or more.

3 Particle Systems Solutions to the Spacing Problem

We have seen that deterministic cellular automata are in some sense too rigid to allow us to solve the spacing problem on grids, because they do not allow to break translation symmetries. On the other hand, probabilistic cellular automata can break these symmetries, but they do not allow an exact conservation of the number of particles.

We now propose to combine the strength of both models with interacting particle systems: we update cells by pairs, which allows conservation of particles, and the pairs are chosen randomly, which allows us to break symmetries. The effect of the local rule is to exchange the cell’s states or to leave them unchanged, depending on the states of the neighbouring cells of the pair.

Let us formalize the definition of the interacting particle systems (IPS) we consider. From now on, we will consider two-dimensional grids. Note that most results can be adapted to higher-dimensional lattices.

3.1 Our Model of IPS

Let \({\mathcal N}_{\mathrm {i}}\) and \({\mathcal N}_{\mathrm {p}}\) be two finite tuples of \(\mathbb {Z}^2\), corresponding to the interaction neighbourhood and the perception neighbourhood.

We define the set of interacting pairs by

$$\begin{aligned} \mathcal I=\{(c,c+\delta )\, ; \; c\in {\mathcal {L}}, \; \delta \in {\mathcal N}_{\mathrm {i}}\}. \end{aligned}$$

The global rule is a function \( {\varPhi } : {\mathcal {E}\times \mathcal I} \rightarrow {\mathcal {E}} \). It takes in argument a configuration and a pair of cells to update, and maps it to the configuration that represents the next state of the system. The image \(y=\varPhi (x,(c,c'))\) is defined by:

$$\begin{aligned} (y_c,y_{c'})=\phi \big ((x_{c+k},k\in {\mathcal N}_{\mathrm {p}}),(x_{c'+k},k\in {\mathcal N}_{\mathrm {p}})\big ) \text{ and } \text{ for } d\notin \{c,c'\}, y_d=x_d, \end{aligned}$$

where \( {\phi } : {\{{{\mathtt {0}}}, {{\mathtt {1}}}\}^{{\mathcal N}_{\mathrm {p}}}\times \{{{\mathtt {0}}}, {{\mathtt {1}}}\}^{{\mathcal N}_{\mathrm {p}}}} \rightarrow {\{{{\mathtt {0}}}, {{\mathtt {1}}}\}^2} \) is the local rule that gives the new states of the pair of cells as a function of the states of their perception neighbourhood.

This rule is conservative if the image y always satisfies \((y_c,y_{c'})=(x_c,x_{c'})\) or \((y_c,y_{c'})=(x_{c'},x_c)\).

Let \((u_t)_{t\in \mathbb {N}} \in \mathcal I^\mathbb {N}\) be a sequence of interacting pairs (in the following, the \(u_t\) are chosen uniformly at random independently in \(\mathcal I\)). Starting from an initial condition \(x \in \mathcal {E}\), the system will evolve according to the sequence of states (or orbit) \( (x^t)_{t\ge 0}\) defined by \( x ^ 0 = x\) and \( x^{t+1}=\varPhi (x^t, u_t) \text{ for } \text{ any } t\ge 0\).

Given an IPS rule \(\varPhi \), we say that a set \(A\subset \mathcal {E}\) is an absorbing set if: \(\forall x\in A, \forall u\in \mathcal I, \varPhi (x,u)\in A.\) We say that A is reachable from any configuration if:

$$\begin{aligned} \forall x^0\in A, \; \exists T\ge 0, \; \exists (u_t)_{1\le t\le T} \in \mathcal I^T, \; x^T\in A. \end{aligned}$$

We say that A is a sink if it is an absorbing set, which is reachable from any configuration.

In terms of IPS, we say that \(\varPhi \) is a solution to the strict spacing problem if it is a conservative IPS such that the set \(\mathcal {A}\) of archipelagos is a sink.

3.2 No Solution to the Strict Spacing Problem

In order to solve the spacing problem, an idea is to design a rule, such that its evolution would result in decreasing the energy of the configuration, that is, the number of adjacent cells in same state. This idea will be used to propose an approximate solution in Sect. 3.4. However, the next proposition proves that this idea does not allow us to solve the strict spacing problem. This is due to the existence of configurations that are not archipelagos but for which each cell can “believe” that it is part of an archipelago (by looking at the cells located within a finite range), see Fig. 3.

Proposition 3

There is no IPS solution to the strict spacing problem.

The proof is omitted due to the space limitation. It can be read in the preprint version of this paper [6].

3.3 An IPS that Synchronises Checkerboards

We have seen that there is no IPS solution ensuring that once we have reached any archipelago configuration, we will remain in the set of archipelago configurations. At first sight, this could seem that there exist no solution to the spacing problem at all. However, to our surprise, we could notice that the loose problem is solvable. In fact, the loose problem is more demanding on the set of configurations that we do not leave. In other words, there might exist a subset \(\mathcal {A}'\) of archipelagos such that once the configuration reaches \(\mathcal {A}'\), it remains in it.

It can be observed that in Fig. 3, the problem comes from the fact that there are two checkerboards of different phases. If we were able to synchronize these two checkerboards, we would reach one of the two perfect checkerboards (since both \({{\mathtt {0}}}\) and \({{\mathtt {1}}}\) have density 1/2).

For \(q\in \{{{\mathtt {0}}}, {{\mathtt {1}}}\}\), we denote:

$$\begin{aligned} C_{\mathrm {e}}^{q}=\{x\in \mathcal {E}\,;\; x_{i,j}=q \implies i+j \,\, \text {is even}\},\\ C_{\mathrm {o}}^{q}=\{x\in \mathcal {E}\,;\; x_{i,j}=q \implies i+j \,\, \text {is odd}\}. \end{aligned}$$

These sets correspond to “sub-checkerboards” in the sense that in \(C_{\mathrm {e}}^{q}\) (resp. \(C_{\mathrm {o}}^{q}\)), state q is the minority state and only appears on even (resp. odd) cells. We also introduce \(C=C_{\mathrm {e}}^{{{\mathtt {0}}}}\cup C_{\mathrm {e}}^{{{\mathtt {1}}}}\cup C_{\mathrm {o}}^{{{\mathtt {0}}}}\cup C_{\mathrm {o}}^{{{\mathtt {1}}}}\). It is a subset of \(\mathcal {A}\).

Proposition 4

There is an IPS solution to the loose spacing problem for an even-sized grid. Indeed, the rule \(\varPhi _{\mathrm {C}}\) defined below is a conservative IPS having the property that the set C is a sink.

The proof is omitted due to the space limitation. It can be read in the preprint version of this paper [6]. We will here present the rule that solves the problem.

To define \(\varPhi _{\mathrm {C}}\) with a local description, we introduce its interaction neighbourhood \({\mathcal N}_{\mathrm {i}}=\{-1,0,1\}^2\setminus \{(0,0)\}\), that is, we allow interactions between a cell and its eight nearest-neighbours. The perception neighbourhood corresponds to von Neumann neighbourhood, that is, \({\mathcal N}_{\mathrm {p}}=\{(0,0),(0,1)(-1,0),(0,-1),(1,0)\}\).

Let \(\mathcal I_4\) be the set of pairs of adjacent cells and \(\mathcal D_4\) be the set of diagonal pairs. The interaction set is \(\mathcal I=\mathcal I_4\cup \mathcal D_4\). The rule will act differently on diagonal pairs on the one hand, and horizontal and vertical pairs on the other hand.

For \((i,j)\in \mathcal I\), let \( {\tau _{(i,j)}} : {\mathcal {E}} \rightarrow {\mathcal {E}} \) be the function that exchanges the states \(x_i\) and \(x_j\) in configuration x. Precisely, \(\tau (x,{(i,j)})\) is defined with:

$$\begin{aligned} \tau (x,{(i,j)})_k = {\left\{ \begin{array}{ll} x_{j} &{} \text{ if } k=i\\ x_{i} &{} \text{ if } k=j\\ x_k &{} \text{ if } k \notin \{i,j\}.\\ \end{array}\right. } \end{aligned}$$

For a pair \((i,j)\in \mathcal I_4\), we define

$$\begin{aligned} \varPhi _{\mathrm {C}}(x,{(i,j)})= {\left\{ \begin{array}{ll} \tau (x,{(i,j)}) \text{ if } \text{ both } \text{ cells } i \text{ and } j \text{ are } \text{ not } \text{ isolated, }\\ x \text{ otherwise. }\\ \end{array}\right. } \end{aligned}$$

For a pair \((i,j)\in \mathcal D_4\), we define \(\varPhi _{\mathrm {C}}(x,{(i,j)})=\tau (x,{(i,j)}).\)

Note that if \(x_i=x_j\), both cases above result in leaving x unchanged.

In practice, numerical simulations show that in order to improve the speed of convergence to the archipelago, it is more appropriate to do the exchanges with different probability rates, depending on the state of the neighbourhood of the pair. However, these parameter do not affect the reachability properties, this is why we will here work with the simplest version of the model.

Fig. 3.
figure 3

Example of a configuration that locally looks like an archipelago.

3.4 Glauber Dynamics

We will now present a family of stochastic IPS having the property to solve the spacing problem “with an arbitrary precision”, by converging to a distribution on configurations (with same density as the initial configuration) for which the “energy” can be controlled. Let us thus precise this notion of energy.

The energy E(x) of a configuration x is the number of (horizontal or vertical) pairs \({{\mathtt {1}}}{{\mathtt {1}}}\) plus the number of (horizontal or vertical) pairs \({{\mathtt {0}}}{{\mathtt {0}}}\) in the configuration. Precisely, for \(x\in \mathcal {E}\), \(E(x)=\sum _{(i,j)\in \mathcal I_4} \mathbbm {1}[x_i=x_j],\) where we recall that \(\mathcal I_4\) is the set of pairs of adjacent cells.

Let \(\mathcal {E}_k\) be the set of configurations of \(\mathcal {E}\) which contain k cells in state \({{\mathtt {1}}}\).

Lemma 1

If the grid is even-sized, then the configurations of \(\mathcal {E}_k\) of minimal energy are exactly the configurations of \(\mathcal {E}_k\cap \mathcal {A}=\mathcal {E}_k\cap \mathcal {A}_q\), where q is the minority state.

The proof is omitted due to the space limitation. It can be read in the preprint version of this paper [6].

For \((i,j)\in \mathcal I_4\), let us also define the local energy \(E_{(i,j)}(x)\) of configuration x at edge (ij) by:

$$\begin{aligned} E_{(i,j)}(x)=\sum _{(k,\ell )\in {\mathcal V}_4(i,j)}\mathbbm {1}[x_k=x_{\ell }], \end{aligned}$$

where \({\mathcal V}_4(i,j)\) denotes the six edges of \(\mathcal I_4\setminus \{(i,j)\}\) sharing a vertex with (ij).

Let \(\beta \in \mathbb R\) be some fixed parameter. We propose the stochastic IPS dynamics defined as follows.

  1. 1.

    Choose uniformly at random a pair \(u=(i,j)\in \mathcal I_4\) of horizontal or vertical consecutive cells.

  2. 2.

    Then, exchange the states of cells i and j with probability p(xu) defined by

    $$\begin{aligned} p(x,u)={\exp (\beta E_{u}(x)) \over \exp (\beta E_{u}(x))+\exp (\beta (6-E_{u}(x)))}={1\over 1+\exp (\beta (6-2E_{u}(x)))}. \end{aligned}$$

The number of cells in state \({{\mathtt {1}}}\) is conserved by this dynamics, so that for any \(k\in \{0,N_{{\mathcal {L}}}\}\), it defines a discrete time Markov chain on \(\mathcal {E}_k\). The sequence of edges that will be chosen at each time step is given by a sequence of i.i.d. random variables \((u_t)_{t\in \mathbb {N}} \in \mathcal I_4^\mathbb {N}\), where \( u_t \) is uniformly distributed on \(\mathcal I_4\). Starting from an initial condition \(x \in \mathcal {E}_k\), the system evolves according to the sequence of states \((x^t)_{t\in \mathbb {N}}\) defined by \( x ^ 0 = x \) and

$$\begin{aligned} x^{t+1}={\left\{ \begin{array}{ll} \tau (x^t,u_t) &{} \text{ with } \text{ probability } p(x,u_t),\\ x^t &{} \text{ with } \text{ probability } 1-p(x,u_t). \end{array}\right. } \end{aligned}$$

This Markov chain is clearly irreducible and aperiodic. We denote its transition kernel by P. In particular, if \(x\not =y\) and \(y=\tau (x,u)\) for some \(u\in \mathcal I_4\), then we have: \(P(x,y)={1\over \mathop {\mathrm {Card}}\nolimits \mathcal I_4} \, p(x,u).\)

Proposition 5

The Markov chain defined above is reversible, and its stationary distribution on \(\mathcal {E}_k\) is given by \( \mu _{\beta }(x)={1\over Z_{\beta }} \exp (-\beta E(x))\) for all \( x \in \mathcal {E}_k\), where \(Z_{\beta }=\sum _{x\in \mathcal {E}_k}\exp (-\beta E(x)).\)

Proof

Let us check that the detailed balance \(\mu _{\beta }(x)P(x,y)=\mu _{\beta }(y)P(y,x)\) holds for any two configurations x and y. It is enough to prove that if \(x\not =y\) and \(y=\tau (x,u)\) for some \(u\in \mathcal I_4\), then \(\exp (-\beta E(x))p(x,u)=\exp (-\beta E(y))p(y,u)\). But in that case, \(E_u(y)=6-E_u(x)\) and \(E(y)-E_u(y)=E(x)-E_u(x)\), so that the equality is satisfied.     \(\square \)

Proposition 6

If the grid is even-sized, then when \(\beta \rightarrow \infty \), the distributions \(\mu _{\beta }\) converge to the uniform measure on configurations of minimal energy, that is to the uniform measure on \(\mathcal {E}_k\cap \mathcal {A}\).

Proof

It follows from the definition of \(\mu _{\beta }\), and Lemma 1 above.     \(\square \)

To sum up, the Glauber dynamics gives a simple way to approach our goal of spacing out particles. Compared to our checkerboard synchronisation rule \(\varPhi _{\mathrm {C}}\), it has the advantage of being simple and to use only horizontal and vertical interactions between cells. The distribution at the equilibrium can be determined analytically: it has same weight on all archipelagos with same number of particles, and the weight of non-archipelagos decreases exponentially as a function of \(\beta \). But, as for \( \varPhi _C\), there is still the need to know what are the time scales for observing the convergence to the equilibrium: a rule that would converge with a speed that is exponentially slow with the grid size would be useless in practice.

4 The Density Classification Problem on Finite Lattices

As a first step, we propose to study here only how to use a modified version of \( \varPhi _{\mathrm {C}}\) to solve the density classification problem, leaving the Glauber dynamics for future work. We build our solution to the density classification problem by combining \( \varPhi _{\mathrm {C}}\) with the majority rule.

For the checkerboard synchronisation dynamics, we introduce the following parametric variant of \(\varPhi _{\mathrm {C}}\), in order to increase the speed of convergence. For a configuration \(x\in \mathcal {E}\) and a pair \((i,j)\in \mathcal I_4\), the new rule \( {\tilde{\varPhi }}_{\mathrm {C}}\) is defined as follows: (a) if both i and j have exactly one adjacent cell in the same state, the exchange (which is then always allowed in \(\varPhi _{\mathrm {C}}\)) is now applied with a probability \(\lambda \); (b) in all other cases, we apply \(\varPhi _{\mathrm {C}}\); (c) for a pair \((i,j)\in \mathcal D_4\), the exchange (which is always allowed in \(\varPhi _{\mathrm {C}}\)), is now done only with a probability \(\chi \). For \(\lambda =\chi =1\), we recover \(\varPhi _{\mathrm {C}}\).

We now combine \({\tilde{\varPhi }}_{\mathrm {C}}\) with a majority rule, to obtain a rule \(\varPhi _{\mathrm {D}}\) defined as follows: for a configuration \(x\in \mathcal {E}\) and a pair \((i,j)=u\in \mathcal I\),

$$\begin{aligned} \varPhi _{\mathrm {D}}(x,u)= {\left\{ \begin{array}{ll} {\tilde{\varPhi }}_{\mathrm {C}}(x,u) \text{ with } \text{ probability } 1-\epsilon ,\\ {\text{ Maj }}(x,i) \text{ with } \text{ probability } \epsilon /2,\\ {\text{ Maj }}(x,j) \text{ with } \text{ probability } \epsilon /2, \end{array}\right. } \end{aligned}$$

where \( {\text{ Maj }} : {\mathcal {E}\times {\mathcal {L}}} \rightarrow {\mathcal {E}} \) is the function such that \(y=\text{ Maj }(x,i)\) is defined by \(y_c=x_c\) if \(c\ne i\) and \(y_i\) is the majority state in the Moore neighbourhood of c (the 8 nearest neighbours of c). We can now state our main proposition.

Proposition 7

For an even-sized grid \({\mathcal {L}}= (\mathbb {Z}/a\mathbb {Z})\times (\mathbb {Z}/b\mathbb {Z})\) with \(a,b \in 2\mathbb {Z}\), for any configuration \(x \in {\mathcal {L}}\), and any non-zero value of \(\lambda \) and \(\chi \), the probability that \( \varPhi _{\mathrm {D}}\) provides a good classification of x tends to 1 as \( \epsilon \) tends to 0.

Proof

(Sketch). The proof is the same as the one given for a one-dimensional system [5]. For the sake of simplicity we can set \( \lambda = 1\) and \(\chi = 1\), that is, make \( {\tilde{\varPhi }}_{\mathrm {C}}\) and \( \varPhi _{\mathrm {C}}\) equal. First, remark that despite the stochastic nature of our systems, archipelagos are well classified with probability one. In particular, if q is the minority state of x, then the sets of sub-checkerboards \( C_{\mathrm {e}}^{q} \) and \( C_{\mathrm {o}}^{q} \) are stable by the application of both \( {\tilde{\varPhi }}_{\mathrm {C}}\) and the majority rule. Moreover, the majority rule either leaves x unchanged or diminishes by 1 the number of q’s in x. In other words, the system can only converge to the right fixed point \( {{\mathtt {0}}}^{\mathcal {L}}\) or \( {{\mathtt {1}}}^{\mathcal {L}}\).

The second property to remark is that as \( \epsilon \) gets smaller, the probability of not applying the majority rule during the first k time steps tends to 1 for every value of k. In other words, for a configuration x with minority symbol q, we can make the probability to reach a sub-checkerboard in \(C_{\mathrm {e}}^{q} \cup C_{\mathrm {o}}^{q}\) before applying the majority rule as high as needed.     \(\square \)

In order to evaluate the quality of the rule in practice, let us now briefly explore how the two rules \({\tilde{\varPhi }}_{\mathrm {C}}\) and \(\varPhi _{\mathrm {D}}\) behave with respect to their various settings.

Fig. 4.
figure 4

Time to convergence to an archipelago for different values of L. Left: \(\lambda \) varies with \(\chi =0.1\). Right: \(\chi \) varies with \(\lambda =0.25\)

For the particle spacing problem, our rule is defined with three parameters: the grid width L and the two probabilities of exchange \(\lambda \) and \(\chi \).

Let us first examine how to set \(\lambda \) and \(\chi \). For each setting of the system, we repeated 1000 experiments consisting of initializing the system with an independent Bernoulli of parameter 1/2 for each cell and measuring the time needed to attain an archipelago configuration. Note that for the sake of making fair comparisons, we show here the rescaled time, that is, a time step is taken as \(L^2\) random updates of the global rule. We also take L to be even as for odd-sized grids there are initial conditions for which the particle spacing problem has no solution. In the previous studies, typical values of L were taken around 20, see e.g. Ref. [3, 4] and references therein.

Figure 4-left shows how the average time to convergence varies as a function of \(\lambda \) for the specific value \(\chi =0.1\). It can be observed that for \(\lambda \) smaller than 0.4 the time is relatively small, while for higher values of \(\lambda \), the time increases drastically.

To examine the effect of \(\chi \), we arbitrarily fixed the value of \(\lambda \) to 0.25 and measured the average convergence time to an archipelago. Figure 4-right shows how the average time to convergence varies as a function of \(\chi \). Here again, it can be observed that for \(\chi \) smaller than 0.3 the time is relatively small, while for higher values of \(\chi \), the time increases drastically.

Interestingly, these two experiments show that in order to avoid the existence of non-archipelago fixed-point configurations, the two parameters have to be set strictly greater than zero, but can not be set too high. It is an open question to determine if there exists a phase transition with respect to the convergence to an archipelago. This would imply that, for infinite systems, if \(\lambda \) and \(\chi \) are set above a given threshold, with a high probability, the system does not converge to an archipelago.

Our third experiment is to observe the density classification itself. For each random sample, we took random initial conditions with a uniform probability to be \({{\mathtt {0}}}\) or \({{\mathtt {1}}}\) for each cell independently. For even-sized grids, in case of equality between the number of \({{\mathtt {0}}}\)s and \({{\mathtt {1}}}\)s, we dismissed this initial condition and re-sampled another one with the same random distribution. We define the quality as the ratio of successful classifications, that is, the convergence to right fixed point \({{\mathtt {0}}}^{\mathcal {L}}\) or \({{\mathtt {1}}}^{\mathcal {L}}\) depending on whether the initial condition has a density smaller than or greater than 1/2.

Fig. 5.
figure 5

Quality of classification as a function of the grid width L. (Even and odd values are shown on separate curves.) Settings are: \(\lambda =0.25\), \(\chi = 0.1\), \(\epsilon = 0.001\).

Figure 5 shows the evolution of the quality as a function of the grid width L, for the particular setting \(\lambda =0.25\), \(\chi = 0.1\), \(\epsilon = 0.001\). (Surprisingly, we empirically remarked that the quality for \( \chi = 0.2\) is slightly lower.) These results show that this rule has a quality that is comparable to the best two-dimensional classification rules known so far [3, 4]. Without surprise, for even-sized grids, the quality decreases as L gets larger, as it becomes more difficult to discriminate between the configurations that have approximately the same number of \( {{\mathtt {0}}}\)s and \({{\mathtt {1}}}\)s. The curve for odd-sized grids is more surprising. Indeed, it shows an increase of the quality with L, at least in the range of sizes that were examined. We believe that this phenomenon results from the impossibility to space out the particles for some configurations of odd-sized grid. The system is in some sense “forced” to converge to a non-perfect configuration, in which the majority rule may introduce errors and make the system shift towards the wrong fixed point. However, as the size further increases this effect is less important and it is probable that for a given \(\epsilon \), the difference between even-sized and odd-sized grids disappears.

5 Some Questions

The density classification problem and the particle spacing problem can both be extended to infinite lattices. The set of configurations is then \(\mathcal {E}=\{{{\mathtt {0}}}, {{\mathtt {1}}}\}^{\mathbb {Z}^d}\). For the density classification problem, a possible extension to infinite lattices consists in designing a cellular automaton on \(\mathcal {E}\) such that if the initial configuration is drawn independently for each cell according to a Bernoulli law of parameter p, then if \(p<1/2\), the density of \({{\mathtt {1}}}\)s converges to 0, while if \(p>1/2\), the density of \({{\mathtt {0}}}\)s converges to 0.

This problem has already been studied by Marcovici and her collaborators [2]. In particular, it was shown that there is a simple example of deterministic cellular automaton that classifies the density on \(\mathbb {Z}^2\): Toom’s rule, which is the majority rule on the neighbourhood \({\mathcal N}=\{(0,0),(0,1),(1,0)\}\). However, in dimension 1, it is an open problem whether there exists a (deterministic or probabilistic) rule that classifies the density. Taati has partially answered this question by giving an argument that holds for densities close to zero or to one [12].

Similarly, for the particle spacing problem, an extension to infinite lattices consists in asking to design a conservative cellular automaton on \(\mathcal {E}\) such that if the initial configuration is drawn independently for each cell according to a Bernoulli law of parameter p, then if \(p<1/2\), the density of non-isolated \({{\mathtt {1}}}\)s converges to 0, while if \(p>1/2\), the density of non-isolated \({{\mathtt {0}}}\)s converges to 0. It is known that the traffic cellular automaton \(F_{184}\) is a solution to that problem on \(\mathbb {Z}\), but the problem remains open in dimension \(d\ge 2\) [1].

The IPS models we have introduced in Sect. 3 are also interesting when studying them on \(\mathbb {Z}^2\) instead of finite lattices. In that case, to define properly the model, we need to consider continuous-time updates: each interacting pair of \(\mathcal I\) possess a clock that rings at times that are exponentially distributed (independently for the different pairs), and the local rule is applied when the clock rings. It is an open problem to know if there is a proper setting of the checkerboard synchronisation dynamics having the property to space particles on \(\mathbb {Z}^2\). Another interesting model is the Glauber dynamics for \(\beta =\infty \). In that case, we allow exchanges between cells only if it makes the energy decrease (the exchange is made with probability 1/2 if the exchange does not change the value of the energy). On finite grids, this IPS has many fixed points that are not archipelagos, but starting from a configuration on \(\mathbb {Z}^2\) drawn according to a Bernoulli measure, the behaviour could be different.

As far as the performance of the models is concerned, we can ask what are the best settings to obtain a good trade-off between the quality of classification and the time needed to converge to a fixed point.

We also ask if we can transform our IPS into probabilistic cellular automata for solving the two-dimensional density classification problem. This can be done by using more states or by sharing the randomness of the cells (see Ref. [10] and references therein), but it is an open problem whether there is a solution within the usual framework of binary probabilistic cellular automata.