# Classification of Two Dimensional Cellular Automata Rules for Symmetric Pattern Generation

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Angle-Based Address for Cells in a Lattice

**Definition**

**1 (Polar angle (**$\Phi $

**) of a cell).**

**Definition**

**2 (Input angle (**$\mathbf{\theta}$

**)).**

#### 2.2. An n-Star Graph Cellular Automata Model for Two Dimensional CA

**Definition**

**3 (Graph).**

**Definition**

**4 (n-star graph).**

**Definition**

**5 (2D-CA).**

- i.
- $L$ is a two dimensional regular lattice.
- ii.
- $S$ is the set of nonempty binary states.
- iii.
- ${N}_{b}$describes the finite set of neighborhood of each cell${C}_{ij}$,${N}_{b}$=$\left\{{C}_{ij}\right\}U\{N$} and$\left\{{C}_{ij}\right\}{\displaystyle \cap}\left\{N\right\}=\Phi $where${C}_{ij}$is the cell to be updated in a two dimensional lattice,$i$indicates the distance of the cell$C$from the cell to be updated, and$j$indicates the polar angle of the cell$C$with the cell to be updated, so${C}_{ij}$is$C\left(0,0\right)$and$N$is the set of the neighborhood of the cell${C}_{ij}$, which excludes cell${C}_{ij}$from the set${N}_{b}$.
- iv.
- $f$is the transition function, defines the local rule to be applied to each cell,$f:$${S}_{t+1}$(${C}_{ij}$) =${S}_{t}$(${C}_{ij}$),${S}_{t}$(${n}_{1}$),${S}_{t}$(${n}_{2}$), …,${S}_{t}$(${n}_{8}$), where${S}_{t+1}$(${C}_{ij}$) indicates the successor state of the cell${C}_{ij}$at$t+1$time step,${S}_{t}$(${C}_{ij}$) indicates the current state of the cell${C}_{ij}$at$t$time step and${S}_{t}$(${n}_{1}$), …,${S}_{t}$(${n}_{8}$), indicates the current state of each cell in the neighbourhood of${C}_{ij}$.

**Definition**

**6 (n-Star graph cellular automata model (nSG-CA)).**

- i.
- L is a regular symmetric lattice where cells are arranged in such a way that, each cell ${C}_{ij}$ is surrounded by an even number of cells in unit distance.
- ii.
- $S$ is the set of binary states.
- iii.
- ${N}_{b}$describes the finite set of neighborhood of each cell${C}_{ij}$in an nSG-CA,${N}_{b}$=${C}_{ij}U$$N$and${C}_{ij}{\displaystyle \cap}$$N=\Phi $, the cardinality,$\left|{N}_{b}\right|$ at every cell position must be odd.
- iv.
- $N$is the set of neighborhood cells of each cell${C}_{ij}$, excluding the cell${C}_{ij}.$
- v.
- $f$ is the transition function termed as a rule in nSG-CA which is characterized by the neighborhood as in the definition of 2D-CA.
- vi.
- $V$is the set of vertices in the nSG-CA; for each cell in nSG-CA, the cells in the neighborhood${N}_{b}$is mapped into vertices V such that${C}_{ij}$is mapped into${V}_{0}$and every element in$N$is mapped into vertices of the n-star graph such that${n}_{1}\to {V}_{1}$,${n}_{2}\to {V}_{2},{n}_{3}\to {V}_{3},\dots {n}_{N}\to {V}_{N}$for all${n}_{i}\u03f5N$.
- vii.
- $E$is the set of edges in the nSG-CA, which is formed by connecting each cell in the neighbourhood with${C}_{ij}$such as$\{({V}_{0},{V}_{1}),\{({V}_{0},{V}_{2}),\dots \{({V}_{0},{V}_{N}\left)\right\}.$

## 3. Generic Rule Convention of nSG-CA Model

^{7}= 128, in a square lattice, for each cell ${C}_{ij}$ with five neighborhood has 32 rules and for each cell ${C}_{ij}$ in a rectangular lattice with nine neighborhood can generate 512 rules. A variant of hexagonal lattice, where a cell is placed at every 30$\xb0$ w.r.t the cell to be updated has |${N}_{b}$| = 13. So the total number of rules are 2

^{13}. So in order to find out a rule for a particular application, classification of cellular automata is required.

## 4. Classification of Two Dimensional Cellular Automata Rules

**Definition**

**7 (r-star graph).**

**Definition 8**

**(Isomorphic graph).**

**Definition 9**

**(Vertex bijection in a graph).**

_{2}. A vertex bijection$f:V\left({G}_{1}\right)\to V\left({G}_{2}\right)$is structure preserving if${V}_{i}$and${V}_{j}$are adjacent in${G}_{1}$⇔$f({V}_{i})$and$f({V}_{j})$are adjacent in${G}_{2}$.

**Definition**

**10 (Graph automorphism).**

#### 4.1. CA Rules Based on Symmetry

#### 4.1.1.Representation of a given rule

**-**transformation is defined as follows.

**Definition**

**11 (**$\Theta $

**-transformation).**

**Definition**

**12 (Symmetric rule).**

**Theorem**

**1.**

**Proof.**

**Definition**

**13 (Self-symmetry in a rule).**

- 1.
- $f$is a symmetric rule, where$\mathit{\Theta}=\left(0,{l}_{0}\theta ,{l}_{1}\theta ,\dots \dots ,{l}_{N-1}\theta \right)$is a bijective transform of$f$
- 2.
- ${l}_{i}\theta $$\u03f5$$\mathit{\Theta}$if and only if$180-{l}_{i}\theta \u03f5\mathit{\Theta}\forall i\u03f5\left\{0,1,\dots N-1\right\}$

**Definition**

**14 (Pairwise symmetric rules).**

#### 4.2. Algorithm to Identify the Nature of Symmetry in CA Rules

Algorithm 1. Identification of type of symmetry in a rule. | |

Input: Rule number, $f$ or Conclude that $f$Output: Returns the pairwise symmetric pair rules of f orConclude that f is self-symmetric | |

Initialization | 1 Let ${2}^{p}$ be a partition of $f$ with coefficient 1 2 Let $L$ be a horizontal line passing through the cell to be updated on $X$-Axis. 3 Initialize variables, $\u2018s\u2019$, $image$ and $d$ as 0 |

Iteration for partition checking | 4 for each ${2}^{p}$ in $f$ 5 case 1: 6 Let ${2}^{i}$ and ${2}^{j}$ be two partitions coincide with $L$ such that ${2}^{i}$ is on the left side and ${2}^{j}$ is on the right side w.r.t the cell to be updated. 7 Assign ${2}^{j}={2}^{1}$ |

Partition is in upper half | 8 If $(0<\Phi \left({2}^{p}\right)=180)$ 9 If $\left({2}^{p}equals{2}^{i}\right)$ 10 $image={2}^{j}$ 11 $elseif({2}^{p}{2}^{i})$ 12 $d=i\u2013p$ 13 $image={2}^{j+d}$ 14 $endelseIf$ 15$s=s+image$ 16 case 2: |

Partition is in the lower half | 17 $Let{2}^{j}={2}^{N+1}$ where $N=360/\theta $ 18 $If(180\Phi \left({2}^{p}\right)=360)$ 19 $If({2}^{p}>{2}^{i})$ 20 $d=p\u2013i$ 21 $image={2}^{j-d}$ 22 $endif$ 23 $s=s+image$ 24 case 3: 25 $If\left({2}^{p}equals{2}^{0}\right)$ 26 $image={2}^{0}$ 27 $s=s+image$ |

Partition checking iteration | 28 $endfor$ |

Nature of rule | 29 $if\left(sequalsf\right)$ given rule $f$ is self-symmetric 30 else 31 rules $sandf$ are pairwise symmetric |

#### 4.2.1. Description of Algorithm

#### 4.2.2. Illustration

#### 4.3. Global Symmetry (Symmetry in Pattern)

- (a)
- State set in the left side of the vertical line;
- (b)
- State set on the right side of the vertical line;
- (c)
- State set is on the vertical line.

- ${A}_{1}=\left\{\mathrm{C}\left(1,135\xb0\right),\text{}\mathrm{C}\left(1,225\xb0\right)\right\}$ is on the left side of the vertical line
- ${A}_{2}=\left\{\mathrm{C}\left(1,45\xb0\right),\text{}\mathrm{C}\left(1,\text{}315\xb0\right)\right\}$ is in the right side of the vertical line
- ${A}_{3}=\left\{C\left(0,0\right)\right\}$ is the cell on the vertical line.

## 5. Results

^{5}C

_{1}indicates dependency of one neighborhood to the cell to be updated among five neighborhoods;

^{5}C

_{2},

^{5}C

_{3},

^{5}C

_{4},

^{5}C

_{5}indicates the dependency of two, three, four, and five neighborhood cells to the cell to be updated, respectively.

^{7}C

_{1}indicates dependency of one neighborhood to the cell to be updated among seven neighborhoods cells;

^{7}C

_{2},

^{7}C

_{3},

^{7}C

_{4},

^{7}C

_{5},

^{7}C

_{6},

^{7}C

_{7}indicates the dependency of two, three, four, five, six, and seven neighborhood cells to the cell to be updated respectively. PR denote pairwise symmetric rules, which are mentioned in brackets and self-denote the self-symmetric rules in a two dimensional CA with hexagonal lattice. There are no pairwise symmetric rules in

^{7}C

_{7}category.

## 6. Discussion

**-**transform, i.e., a rule is self-symmetric w.r.t the line $=90\xb0$, if the reflection of all the vertices in the r-star graph w.r.t line $\theta =90\xb0$ is a vertex in the r-star graph if self. The self-symmetric rules generate self-symmetric patterns if the input data are symmetric. A mechanism is discussed in this paper to reflect the self-symmetry exists in a rule to the output pattern (global symmetry). Pairwise symmetric rules are also defined based on ${\Theta}^{*}$-transformation. Two pairwise symmetric rules together generate a bilateral symmetric pattern if the input is symmetric.

#### 6.1. Applications of the Proposed nSG-CA Model

#### 6.2. Comparison with Existing Models

## 7. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Wolfram, S. Statistical mechanics of cellular automata. Rev. Mod. Phys.
**1983**, 55, 601. [Google Scholar] [CrossRef] - Brockfeld, E.; Barlovic, R.; Schadschneider, A.; Schreckenberg, M. Optimizing traffic lights in a cellular automaton model for city traffic. Phys. Rev. E
**2001**, 64, 056132. [Google Scholar] [CrossRef] [PubMed] - Mozumder, C.K. Topometry Optimization of Sheet Metal Structures for Crashworthiness Design Using Hybrid Cellular Automata; University of Notre Dame: Notre Dame, IN, USA, 2010. [Google Scholar]
- Arredo, J.I.; Kasanko, M.; McCormick, N.; Lavalle, C. Modelling dynamic spatial processes: Simulation of urban future scenarios through cellular automata. Landsc. Urban Plan.
**2003**, 64, 145–160. [Google Scholar] [CrossRef] - Batty, M.; Xie, Y.; Sun, Z. Modeling urban dynamics through GIS-based cellular automata. Comput. Environ. Urban Syst.
**1999**, 23, 205–233. [Google Scholar] [CrossRef] [Green Version] - Małecki, K. Two-Way Road Cellular Automaton Model with Loading/Unloading Bays for Traffic Flow Simulation. In Proceedings of the 13th International Conference on Cellular Automata for Research and Industry, ACRI 2018, Como, Italy, 17–21 September 2018; pp. 218–229. [Google Scholar]
- Packard, N.H.; Wolfram, S. Two-dimensional cellular automata. J. Stat. Phys.
**1985**, 38, 901–946. [Google Scholar] [CrossRef] - Von Neumann, J.; Burks, A.W. Theory of Self-Reproducing Automata; University of Illinois: Urbana, IL, USA, 1996; p. 8. [Google Scholar]
- Toffoli, T.; Margolus, N. Cellular Automata Machines: A New Environment for Modeling; MIT Press: Cambridge, MA, USA, 1987. [Google Scholar]
- Khan, A.R.; Choudhury, P.P.; Dihidar, K.; Mitra, S.; Sarkar, P. VLSI architecture of a cellular automata Machine. Comput. Math. Appl.
**1997**, 33, 79–94. [Google Scholar] [CrossRef] - Kornyak, V.V. Cellular automata with symmetric local rules. In International Workshop on Computer Algebra in Scientific Computing; Springer: Berlin/Heidelberg, Germany, 2006; pp. 240–250. [Google Scholar]
- Mohammed, J.; Sahoo, S. Design and Analysis of Matrices for Two Dimensional Cellular Automata Linear rules in Hexagonal Neighborhood. Math. Atern.
**2011**, 1, 537–545. [Google Scholar] - Uguz, S.; Ugur, S.; Ferat, S. Uniform cellular automata linear rules for edge detection. In Proceedings of the 2013 IEEE International Conference on Systems, Man, and Cybernetics, Manchester, UK, 13–16 October 2013; pp. 2945–2950. [Google Scholar]
- Choudhury, P.P.; Sahoo, S.; Hasssan, S.; Basu, S.; Ghosh, S.; Kar, D. Classification of cellular automata rules based on their properties. arXiv, 2009; arXiv:0905.1769. [Google Scholar]
- Khan, A.R. Classification of 2D cellular automata uniform group rules. Eur. J. Sci. Res.
**2011**, 64, 51–57. [Google Scholar] - Kazlacheva, Z. Symmetry in Nature and Symmetry in Fashion Design. Econ. Manag. Inf. Technol. EMIT
**2013**, 1, 267. [Google Scholar] - Nakashima, M.; Reddi, A.H. The application of bone morphogenetic proteins to dental tissue engineering. Nat. Biotechnol.
**2003**, 21, 1025. [Google Scholar] [CrossRef] [PubMed] - Mardia, K.V.; Bookstein, F.L.; Moreton, I.J. Statistical assessment of bilateral symmetry of shapes. Biometrika
**2000**, 87, 285–300. [Google Scholar] [CrossRef] - Mara, D.; Owens, R. Measuring bilateral symmetry in digital images. In Proceedings of the Digital Processing Applications (TENCON ′96), Perth, Australia, 29–29 November 1996; pp. 151–156. [Google Scholar]
- Shi, P.; Zheng, X.; Ratkowsky, D.A.; Li, Y.; Wang, P.; Cheng, L. A Simple Method for Measuring the Bilateral Symmetry of Leaves. Symmetry
**2018**, 10, 118. [Google Scholar] [CrossRef] - Enciso, A. Symmetry in Cellular Automata. Electromagn. Phenom.
**2006**, 6, 17. [Google Scholar] - García-Morales, V. Symmetry analysis of cellular automata. Phys. Lett. A
**2013**, 377, 276–285. [Google Scholar] [CrossRef] - Tanaka, I. Effects of initial symmetry on the global symmetry of one-dimensional legal cellular automata. Symmetry
**2015**, 7, 1768–1779. [Google Scholar] [CrossRef] - Salazar, G.; Jesús, U. Internal symmetries of cellular automata via their polynomial representation. Chaos An Interdiscip. J. Nonlinear Sci.
**1998**, 8, 711–716. [Google Scholar] [CrossRef] - Yamasaki, K.; Nanjo, K.Z.; Chiba, S. Symmetry and entropy of one-dimensional legal cellular automata. Complex Syst.
**2012**, 20, 351. [Google Scholar] - Herstein, I.N. Topics in Algebra; John Wiley & Sons: Hoboken, NJ, USA, 2006. [Google Scholar]
- Golumbic, M.C. Algorithmic Graph Theory and Perfect Graphs; Elsevier: Amsterdam, The Netherlands, 2008; p. 57. [Google Scholar]
- Powley, E.J.; Stepney, S. Automorphisms of Transition Graphs for Elementary Cellular Automata. J. Cell. Autom.
**2009**, 4, 125–136. [Google Scholar] - Field, M.; Golubitsky, M. Symmetry in Chaos: A Search for Pattern in Mathematics, Art, and Nature; SIAM: Philadelphia, PA, USA, 2009; p. 111. [Google Scholar]
- Troje, N.F.; Bülthoff, H.H. How is bilateral symmetry of human faces used for recognition of novel views? Vis. Res.
**1998**, 38, 79–89. [Google Scholar] [CrossRef] - Zhang, L.; Razdan, A.; Farin, G.; Femiani, J.; Bae, M.; Lockwood, C. 3D face authentication and recognition based on bilateral symmetry analysis. Vis. Comput.
**2006**, 22, 43–55. [Google Scholar] [CrossRef] - Yam, C.; Nixon, M.S.; Carter, J.N. Automated person recognition by walking and running via model-based approaches. Pattern Recognit.
**2004**, 37, 1057–1070. [Google Scholar] [CrossRef] - Zhao, W. Face recognition: A literature survey. ACM Comput. Surv. (CSUR)
**2003**, 35, 399–458. [Google Scholar] [CrossRef] - Tyler, C.W. Human Symmetry Perception and Its Computational Analysis; Psychology Press: Santa Rosa, CA, USA, 2003. [Google Scholar]
- Popovici, A.; Popovici, D. Cellular automata in image processing. In Proceedings of the Fifteenth International Symposium on Mathematical Theory of Networks and Systems, Notre Dame, Indiana, 12 August 2002; Volume 1, pp. 1–6. [Google Scholar]
- Małecki, K. Graph cellular automata with relation-based neighborhoods of cells for complex systems modelling: A case of traffic simulation. Symmetry
**2017**, 9, 322. [Google Scholar] [CrossRef] - Schultz, J.; Griese, D.; Ju, J.; Shankar, P.; Summers, J.D.; Thompson, L. Design of honeycomb mesostructures for crushing energy absorption. J. Mech. Des.
**2012**, 134, 071004. [Google Scholar] [CrossRef] - Pankaj, P.A. Honeycomb safety structure: Design, analysis and applications in safe road transport. Int. J. Sci. Res.
**2018**, 7, 133–141. [Google Scholar] - Guo, L.; Tovar, A.; Penninger, C.L.; Renaud, J.E. Strain-based topology optimisation for crashworthiness using hybrid cellular automata. Int. J. Crashworth.
**2011**, 16, 239–252. [Google Scholar] [CrossRef]

**Figure 4.**n-star graph CA(nSG-CA) neighborhood model of a rectangular lattice with nine neighborhood cells.

**Figure 7.**r-star graph representation of rule 62 in rectangular lattice with nine neighborhood nSG-CA.

**Figure 13.**Self-symmetric pattern of rule 31 with five neighborhoods at 9th iteration in a rectangular lattice.

**Figure 14.**Evolution of an X-OR operation of rule 10 in a rectangular axis-5 neighborhood CA based on an initial seed in four steps.

**Table 1.**Classification of rules in a rectangular CA lattice with N = 5, where PR denotes pairwise symmetric rules and self-denotes self-symmetric rules.

^{5}C_{1} | ^{5}C_{2} | ^{5}C_{3} | ^{5}C_{4} | ^{5}C_{5} | |||||
---|---|---|---|---|---|---|---|---|---|

PR | Self | PR | Self | PR | Self | PR | Self | PR | Self |

$R\left(2,8\right)$ | $R\left(1\right)$ | $R\left(12,6\right)$ | $R\left(5\right)$ | $R\left(7,13\right)$ | $R\left(11\right)$ | $R\left(23,29\right)$ | $R(15$) | - | $R\left(31\right)$ |

$R\left(4,16\right)$ | $R(3,9$) | $R(10$) | $R\left(25,19\right)$ | $R\left(14\right)$ | $R\left(27\right)$ | - | |||

$R\left(24,18\right)$ | $R(17$) | $R\left(22,28\right)$ | $R\left(21\right)$ | $R\left(30\right)$ | - | ||||

$R\left(20\right)$ | $R\left(26\right)$ | - |

^{7}C_{1} | ^{7}C_{2} | ^{7}C_{3} | ^{7}C_{4} | ^{7}C_{5} | ^{7}C_{6} | ^{7}C_{7} | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|

PR | Self | PR | Self | PR | Self | PR | Self | PR | Self | PR | Self | Self |

(8,4) | 1 | (17,3) | 12 | (25,7) | 13 | (92,46) | 30 | (93,47) | 31 | (123,119) | 126 | 127 |

(16,2) | (9,5) | 96 | (21,11) | 97 | (60,78) | 114 | (61,79) | 109 | (125,111) | |||

(32,64) | (33,65) | 18 | (81,35) | 19 | (102,120) | 108 | (103,121) | 115 | (63,95) | |||

(24,6) | (49,67) | (86,58) | (87,59) | |||||||||

(48,66) | (37,73) | (106,116) | (107,117) | |||||||||

(20,10) | (69,41) | (54,90) | (55,91) | |||||||||

(80,34) | (28,14) | (105,101) | (62,94) | |||||||||

(72,36) | (88,38) | (71,57) | (118,122) | |||||||||

(68,40) | (56,70) | (39,89) | (124,110) | |||||||||

(84,42) | (99,113) | |||||||||||

(52,74) | (29,15) | |||||||||||

(82,50) | (27,23) | |||||||||||

(112,98) | (85,43) | |||||||||||

(74,44) | (53,75) | |||||||||||

(104,100) | (83,51) | |||||||||||

(22,26) | (77,45) |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Vellarayil Mohandas, N.; Jeganathan, L.
Classification of Two Dimensional Cellular Automata Rules for Symmetric Pattern Generation. *Symmetry* **2018**, *10*, 772.
https://doi.org/10.3390/sym10120772

**AMA Style**

Vellarayil Mohandas N, Jeganathan L.
Classification of Two Dimensional Cellular Automata Rules for Symmetric Pattern Generation. *Symmetry*. 2018; 10(12):772.
https://doi.org/10.3390/sym10120772

**Chicago/Turabian Style**

Vellarayil Mohandas, Nisha, and Lakshmanan Jeganathan.
2018. "Classification of Two Dimensional Cellular Automata Rules for Symmetric Pattern Generation" *Symmetry* 10, no. 12: 772.
https://doi.org/10.3390/sym10120772