# Cell state change dynamics in cellular automata

## Authors

- First Online:

- Received:
- Accepted:

DOI: 10.1007/s12293-012-0093-z

- Cite this article as:
- Iclănzan, D., Gog, A. & Chira, C. Memetic Comp. (2013) 5: 131. doi:10.1007/s12293-012-0093-z

## Abstract

Cellular automata are discrete dynamical systems having the ability to generate highly complex behaviour starting from a simple initial configuration and set of update rules. The discovery of rules exhibiting a high degree of global self-organization is of major importance in the study and understanding of complex systems. This task is not easily achieved since coordinated global information processing must rise from the interactions of simple components with local information and communication. In this paper, a fast supporting heuristic of linear complexity is proposed to encourage the development of rules characterized by increased dynamics with regard to cell state changes. This heuristic is integrated in an evolutionary approach to the density classification task. Computational experiments emphasize the ability of the proposed approach to facilitate an efficient exploration of the search space leading to the discovery of complex rules situated beyond the simple block-expanding rules.

### Keywords

Cellular automataDensity classificationEvolutionary algorithms## 1 Introduction

Cellular automata (CAs) represent important tools in the study of complex interactions, emergent behaviour and computational complexity of a system. CAs can be viewed as decentralized structures of simple and locally interacting elements that evolve following a set of rules [22, 23]. These local interactions often give rise to a global coordinated behaviour. Examples of systems where such an emergence occurs include economic systems, insect colonies, the immune system and the brain. CAs provide an idealized environment for studying how simulated evolution can develop systems characterized by “emergent computation” where a global, coordinated behaviour results from the local interaction of simple components [15]. However, programming CA is not an easy task, particularly when the desired computation requires global coordination. This is due to the challenges associated with finding rules able to generate a desired global behaviour based on elements with local information and communication.

One of the most widely studied CA problems is the density classification task (DCT) [14]. This is a prototypical distributed computational task aiming to find the density most present in the initial cellular state. Computational methods engaged for DCT include evolutionary algorithms [6, 15, 16, 18, 19], genetic programming [1], coevolutionary learning [8, 10] and gene expression programming [4]. These methods have been able to generate CA rules with better performance than any known human-written rule for DCT. The particle strategies discovered by genetic algorithms and reported in [2, 15, 16, 20] are able to facilitate global synchronization opening the prospect of using evolutionary models to automatically evolve computation for more complex systems. The potential of evolutionary models to efficiently approach the problem of detecting CA rules facilitating a certain global behaviour is indeed confirmed by various current research results [3, 6, 13, 16, 18]. To the best of our knowledge, the best reported DCT rule was evolved by a two-tier evolutionary algorithm with a performance of \(0.89\) [18]. The success of the method can be attributed to the smart prefiltering of the search space by employing various efficient heuristics.

In this paper, we focus on detecting the formation and propagation of “signals” at runtime. This behaviour can potentially lead to particle based computing and subsequently to the discovery of high performance rules. An automatic signal detection method is proposed to find promising emergent space-time patterns that can guide an evolutionary search process toward more complex, better performing rules. Numerical experiments and results presented for the DCT emphasize the capability of the proposed approach to push the search beyond the simple block-expanding rules and efficiently detect high-performing complex CA rules for DCT. The method and experiments presented in the current paper extend and further analyse the ideas and results reported in [7].

The paper is organised as follows: DCT is defined and related work is reviewed, some important remarks on detecting complex space-time signatures are analysed, the proposed approach to enhance the computational mechanics of CAs is presented, and computational experiments are discussed. Conclusions and some directions for future work are drawn at the end of the paper.

## 2 The density classification task

The one-dimensional CA capable of performing computational tasks has been extensively studied in the literature [8, 13, 16–18]. A lattice of \(N\) two-state cells is used for representing the CA. The state of each cell changes according to a function that takes into account the current states in the neighbourhood. The neighbourhood of a cell is given by the cell itself and its \(r\) neighbours on both sides of the cell, where \(r\) represents the radius of the CA. The initial configuration (IC) of cell states (0s and 1s) for the lattice evolves in discrete time steps updating cells simultaneously according to the CA rule.

DCT aims to find a binary one-dimensional CA able to classify the density of 1s (denoted by \(\rho _0\)) in the IC. If \(\rho _0 > 0.5\) (1 is dominant in the IC) then the CA must reach a fixed-point configuration of 1s otherwise it must reach a fixed-point configuration of 0s within a certain number of time steps. It has been shown that there is no rule that can correctly classify all possible ICs [12]. The length of a CA is usually an odd number to avoid the undecidable case when \(\rho _0 = 0.5\) (the majority should be always defined). Most studies consider the case \(N=149\) and \(r=3\), the latter leading to a neighbourhood size of 7 cells [1, 13, 15, 18]. The performance of a rule measures the classification accuracy of a CA based on the fraction of correct classifications over \(10^4\) ICs selected from an unbiased distribution (\(\rho _0\) is centered around \(0.5\)). The computationally less expensive fitness evaluation takes into account 100 ICs, with uniformly distributed densities. We will call this fitness function F100 in the current paper. All the performances reported in this section refer to this DCT version, also engaged in the current paper.

DCT is a challenging problem extensively studied due to its simple description and potential to generate a variety of complex behaviours. Gacs, Kurdyumov and Levin [5] proposed the well known GKL rule which approximately computes whether \(\rho _0 > 0.5\). The GKL rule has a good performance (around \(0.81\)) when tested for random 149-bits lattices but gives significant classification errors when the density of 1s in the IC is close to \(0.5\) [15]. Nevertheless, the GKL rule represents the starting point for studying DCT and inspired Packard [19] to make the first attempts to use genetic algorithms for finding CA rules.

Koza [11] used Genetic Programming (GP) to evolve a state-transition rule that enables a cellular automaton to produce certain desired emergent behavior. Continuing Koza’s approach, Andre et al. [1] obtained a rule for DCT with a performance of \(0.823\). This rule has been found by applying a standard GP model with automatically defined functions. The algorithm is also using the island model for parallelization, the initial subpopulations being created locally at each processing node and generations being run asynchronously. Gene Expression Programming (GEP) is a computational paradigm (sharing many similarities with GP) proposed in [4] and applied to DCT. Ferreira [4] showed that GEP outperforms GP for several benchmark problems including DCT. The main difference between the two approaches is that GP is using expression trees as individuals, while GEP is using linear chromosomes that are then translated into expression trees. Compared to GP, Fereira obtains indeed a slightly better performance of \(0.8255\).

The potential of genetic algorithms for computational emergence in the DCT has been extensively investigated [2, 15, 16, 20]. Individuals are encoded as bit strings listing the rule table output bits in lexicographic order of neighbourhood patterns. The evolutionary search process is guided by the F100 function. The three main strategies discovered are default, block-expanding (a refinement of the default strategy) and particle. The performance of default strategies is around \(0.5\). Block-expanding strategies explore the presence of a large block of 0s/1s (correlated with overall high/low density) by expanding it to cover the whole string. The performance value for these strategies is typically between \(0.55\) and \(0.72\) [20]. A more sophisticated rule where global coordination is more visible refers to the particle strategy with a performance value of \(0.72\) or higher [2, 15]. Typically, the evolutionary search process discovers many default strategies followed by block-expanding strategies and few particle rules on some runs [15, 20]. The best particle rule found by Mitchell et al. [15] has a performance of \(0.769\). A similar result in terms of rule performance is reported in [6] using a Circular Evolutionary Algorithm (CEA) with asynchronous search. CEA is able to produce high-quality strategies in a significantly larger number of runs compared to other evolutionary approaches to DCT.

Coevolutionary learning [8, 10] has been shown to be able to produce really good results for DCT (the best rule has a performance of \(0.86\)). The idea is that a population of learners coevolves with a population of problems to facilitate continuous progress. The fitness definition implements a competitive relationship between rules and the density of IC: a rule is better if it correctly classifies more ICs, while the ICs are better if they manage to lead to the failure of the rules. However, coevolutionary models can lead to non-successful search usually associated with the occurrence of the Red Queen effect. This means that individuals tend to specialize with respect to the current training problems as they are evaluated in a changing environment.

Oliveira et al. [3] present a multiobjective evolutionary approach to DCT based on the nondominated sorting genetic algorithm (NSGA). In order to overcome the enormous rule space, the authors integrate a parameter-based heuristic into the search process. This way, the heuristic value itself becomes one of the search process objectives. The other objective is finding a rule that correctly classifies the IC. The algorithm is implemented in a distributed cooperative computational environment and is able to discover new rules with a slightly better performance of \(0.8616\).

Wolz and Oliveira [21] propose a two-tier evolutionary framework able to detect rules with a performance of \(0.889\) clearly superior to the previously best known discovered using coevolutionary algorithms [8]. The approach integrates a basic evolutionary algorithm in a parallel multi-population search algorithm. To the best of our knowledge, the DCT rules presented in [21] are the ones with best performance discovered to date [18]. An important constraint included in the latter two approaches [3, 21] presented above refers to the number of state transitions of a rule following black-white, left-right (BWLR) transformations. Experiments have shown that this BWLR symmetry should be maximal to achieve high-performant DCT rules [18]. Oliveira et al. [18] have shown that the bits related to the complementary-plus-reflection transformation (BWLR-symmetry) are totally symmetrical in the best rules published in [3].

## 3 Detecting complex space-time signatures

Existing research concerning CA computation emphasizes that well performing CA rules exhibit complex spatio-temporal behaviour, where coherent configurations emerge and interact. The question that naturally arises is how to characterize and group rules according to the emergent space-time patterns and their attractor basin topology. In this context, *basin of attraction* refers to the set of CA configurations that evolve to the same particular attractor for the vast majority of the rules of interest.

The two forces depicted in Fig. 2 encourage the exploration of different regions of the rule search space. The first force (*Force 1*) corresponds to F100 and provides a coarse approximation for the performance of a rule. The classical F100 fitness drives evolutionary search away from chaotic modes of operation but in the same time it leads only to simple ordered regimes of operations with a very high probability. Indeed, the first generations of an evolutionary algorithm search are usually dominated by default strategies, which are gradually replaced by block-expanding strategies, and finally (only in about 2 % of runs) particle strategies [15, 20]. One reason for such a low particle strategy discovery rate might be that F100 is not a powerful enough predictor for performance. This fitness function is a coarse approximation of the ability of a rule to perform certain task. The second force (*Force 2*) introduced in Fig. 2 promotes dynamics by rewarding rules that exhibit on average increased cell state change rates. This corresponds to the novel fitness component proposed in this paper and is intended to encourage the search to move away from ordered regimes of operation in order to obtain emergent rules with a higher probability. The interplay between the two forces (one guiding the search towards chaotic regimes and the other leading to ordered regimes) has the potential to lead to the discovery of particle rules situated between the ordered and chaotic modes of operation.

Particles are the main mechanisms for carrying information over long space-time distances. An expanding black block indicates that the local density is definitively leaning towards a majority of 1s, a white block is a vote for a majority of 0s, while a propagating checkerboard like pattern indicates that a decision can not be made locally but must be postponed to a higher level. In this way, particles can act as signals. Higher level decisions can be made by performing logical operations on the information of particles that collide-interact. Thus, it is important to develop methods that can produce CA exhibiting particle-based computing. In contrast to previous approaches [3] that prune the search space apriori using various heuristics, in this work we focus on techniques that are able to efficiently detect and favor the formation of signals and particle interactions at runtime.

## 4 Proposed signal detection method for CA rule discovery

A new signal-based heuristic to detect particle emergent CA rules is proposed and engaged in an evolutionary search algorithm for DCT. The search is guided by a fitness function looking for rules exhibiting increased dynamics besides the known F100 measuring the performance of discovered rules in classifying 100 ICs.

Particle rules exhibit an increased dynamics with regard to the rate of change for a cell state. In order to propagate in time, signals must maintain locally a roughly equal density of 1s and 0s. Therefore, the cells participating in signal transmission will often change their state between 0 and 1. In contrast, the cells in a CA following a block-expanding strategy quickly converge to a mostly constant state and rarely change their state during evolution.

Along with density \(\rho _0\) close to \(0.5\), signals are also characterized by repetition of patterns of 1s and 0s which are bilateral symmetric (mirror-like symmetry). This symmetry enables the propagation of the signal by recursively transforming pattern of 1s in pattern of 0s and vice versa.

The input of Eq. 2 is a space-time diagram denoted by \(ST\), which is obtained by running a CA upon an IC state until convergence or a maximum time step \(T_{max}\). In practice, for the DCT, \(ST\) is a binary matrix with \(n\) columns – number of cells in the CA and \(T\) rows – the actual time step values. When quantifying the changing dynamics of a CA, it is recommended to start the computation after a prefixed number of time steps, in order to eliminate the first, almost always noisy states from the space-time diagram. This offset is expressed by the parameter \(s\) which has the non-optimized, arbitrary chosen value \(s=20\) in the experiments conducted in this paper. If there are less time steps \(T\) then the prefixed generation threshold \(s\), the value of \(C(ST)\) is not computed and is assigned the default value of 0.

In order to obtain particle exhibiting CAs with higher frequency, the fitness function should encourage both good classification capability and an increased dynamics with regard to the average cell state change rate of the cells. The first objective is rewarded by the classical F100 measure while the second one by the proposed \(C(ST)\) measure (Eq. 2). Consequently, the augmented fitness is envisioned as a weighted sum of these two components.

The presence of an increased cell state change rate is critical in the later phases of the evolutionary search in order to push it away from simple block-expanding rules. When rewarding the dynamics of a rule, we also wish to avoid the formation of local-optima with a large basin of attraction for CAs having an original mediocre fitness value (close to 0.5) but exhibiting a high cell state change rate. For these cases, the driving force of the reward should not suppress the classification capability signal provided by F100. Taking into account these observations, we fine tune the interplay between the two objectives in the following way: (i) a reward for cell state change dynamics is accounted only for CAs with a classification capability (according to F100) greater than a parameter \(\alpha \) (this parameter approximates the transition threshold from default strategies to block-expanding ones) and (ii) the reward increases linearly with the original fitness value in order to avoid the cases where a high bonus for dynamics would suppress the signal given by F100.

If the increased dynamics arises from random behaviour and not useful signals, the classification performance of a rule will still be weak according to the proposed \(F100_m\). Thus, the bonus rewards only good enough individuals in proportion with their quality.

## 5 Computational experiments and results

Computational experiments are performed for DCT in CAs with number of cells \(N=149\) and radius \(r=3\). The objective of these experiments is twofold: (i) to evaluate the proposed \(C(ST)\) measure for known DCT rules, and (ii) to detect DCT rules using an evolutionary algorithm based on the proposed modified \(F100_m\) fitness function.

Various high performance rules for the DCT (in hexadecimal coding)

Rule (Hex) | Reference | Perf. | \(C(ST)\) |
---|---|---|---|

050005FF050005FF05FF05FF05FF05FF | Gacs et al. [5] | 0.816 | 0.6241 |

00550055005500555F55FF5F5F55FF5F | Andre et al. [1] | 0.823 | 0.5385 |

156043701700D25F15630F7714F3D77F | Juille and Pollack [8] | 0.851 | 0.4846 |

050C350F05007717058CF5FFC5F375D7 | Juille and Pollack [9] | 0.85 | 0.6706 |

0203330F01DF7B17028CFF0FC11F79D7 | 0.889 | 0.4196 |

The evolved rules in hexadecimal coding, their performance and measured cell state change dynamics

Code | Rule (Hex) | Perf. | \(C(ST)\) |
---|---|---|---|

01 | 127E5D0D09D37B357DD079FF7FF77B37 | 0.6277 | 0.6503 |

02 | 001100150F1133373F116137FB3DF777 | 0.7738 | 0.7249 |

03 | 05413D4102510C1112119D1FDD5B2F97 | 0.6611 | 0.9686 |

04 | 050507C104113A150083FD0BB7510FD7 | 0.6604 | 0.9736 |

05 | 010151451851300D1417DD0FD5510F97 | 0.6493 | 0.6337 |

06 | 111077021F1D7D2F778F1F6D7FFF7F7F | 0.6615 | 0.6045 |

07 | 00010311170757371F351727FF35F777 | 0.8006 | 0.6094 |

08 | 031103410F2320053B212D13FF357757 | 0.6814 | 0.6399 |

09 | 055071007500427171BDEF61F77573DF | 0.6038 | 0.6392 |

10 | 05011541001798D12205DF6171151FD7 | 0.6567 | 0.9423 |

11 | 05000D81011369313B85DD51271F3DD7 | 0.6622 | 0.9397 |

12 | 11307B017A79590567DB759D7F9F7F7F | 0.6531 | 0.9405 |

13 | 0007211D01153F1D1439FFCF5117FF5F | 0.8081 | 0.7060 |

14 | 00031117011F7D55111DFF5F1517FF1F | 0.803 | 0.6895 |

15 | 05010D01405104112301DD0571117FD7 | 0.6442 | 0.9043 |

16 | 000331530113DF551D3DFD1F111FFF1F | 0.7882 | 0.7009 |

17 | 031071101DA257015531559D3FFBFF3F | 0.7074 | 0.7438 |

18 | 0305630102112C150015DF1795530DD7 | 0.667 | 0.7651 |

19 | 05010C4D00512C393361FD01201F17D7 | 0.6429 | 0.9799 |

20 | 00010317031F3D5D1D11FF1F1157FF5F | 0.8041 | 0.6901 |

The current formulation of the fitness function clearly encourages cell state change dynamics: the average of this measure is 0.7721 with a standard deviation of 0.1407. This value is much higher than those typically exhibited by block-expanding rules, even above the average range of dynamics measured on high performance particle rules reported in literature. Also, it should be noted that a very high value of quantified dynamics does not always positively correlates with high performances. This is explained by high dynamics associated with the propagation of checkerboard like patterns without convergence for some of the evolved rules. Nevertheless, all rules detected by the evolutionary search guided by \(F100_m\) show large transient portions in their space-time diagrams and overall the found rules exhibit an increased computational sophistication for the DCT. This clearly improves overall the performance of evolutionary algorithms in terms of detecting particle strategies for DCT. In some cases, the performance of the rules is not qualitatively improved. This happens when particle like computational mechanism is exhibited only when converging towards one class or propagated only in one direction. Indeed, cell state change dynamics is not an universal predictor for particle like computation, but along with other heuristic measures has a high potential to bias the search towards the most promising regions.

## 6 Conclusions and future work

Encouraging the development of rules with increased cell state change dynamics has the potential to guide the evolutionary search away from trivial block-expanding rules. Without relying on any prefiltering, in all our experimental runs, interesting complex rules were detected. This is in contrast with the low discovery percentage of complex rules of a basic evolutionary search. In order to detect particle based rules, a delicate balance between classification accuracy measures and cell state change dynamics must be maintained. Therefore, a multiobjective optimization framework can be suitable for the simultaneous maximization of both desiderates and would open the opportunity for easy inclusion of other supporting heuristics.

Future research focuses on developing computationally efficient pattern recognition methods and rewarding mechanisms, which coupled in a multiobjective optimization framework will hopefully facilitate the formation of transient regions exhibiting bilateral symmetry. Another direction worth exploring refers to a memetic search in the context of an evolutionary algorithm guided by the proposed modified fitness combined with a local search using the \(F100\) fitness function.

## Acknowledgments

This research is supported by Grant PN II TE 320, ”Emergence, auto-organization and evolution: New computational models in the study of complex systems”, funded by CNCS Romania. David Iclănzan acknowledges the financial support of the Sectoral Operational Program for Human Resources Development 2007–2013, co-financed by the European Social Fund, within the project POSDRU 89/1.5/S/60189 with the title ”Postdoctoral Programs for Sustainable Development in a Knowledge Based Society” and the support of Sapientia Institute for Research Programs (KPI).