Two Graphs: Resolving the Periodic Reversibility of One-dimensional Finite Cellular Automata
Abstract
Finite cellular automata (FCA) are widely used in simulating nonlinear complex systems, and their reversibility is closely related to information loss during the evolution. However, only a relatively small portion of their reversibility problems has been solved. In this paper, we perform calculations on two graphs and discover that the reversibility of any one-dimensional FCA exhibits periodicity as the number of cells increases. We also successfully provide a method to compute the reversibility sequence that encompasses the reversibility of one-dimensional FCA with any number of cells. Additionally, the calculations in this paper are applicable to FCA with various types of boundaries. This means that we will have an efficient method to determine the reversibility of almost all one-dimensional FCA, with a complexity independent of cell number.
keywords:
finite cellular automata , graph , circuit , reversibility sequence , periodChen Wang et al. \jidprocs \jnltitlelogo \CopyrightLine2023Published by Elsevier Ltd.
1 Introduction
Cellular Automaton (CA) is a discrete model, consisting of a rule and a grid of one or more dimensions. Each grid position has a state, and these states are updated in parallel at discrete time steps based on a fixed local rule. The concept of CA was formally introduced by John von Neumann in 1951 to simulate the self-replication of cells in biological development [20]. CA has a wide range of applications in simulation, encryption, pseudorandom number generation, and more [11, 12, 21].
Reversibility in CA is one of the most important issues in the field. A reversible CA means that given its state at a certain time step, its state in the previous time step can be accurately determined. In other words, its evolution is reversible. Reversible CA can be used to simulate certain physical processes, such as time-reversal symmetry in quantum mechanics [6]. In information processing, the ability to trace and recover previous states is useful, and a reversible CA offers this possibility [24]. Reversibility can also be used in the design of encryption algorithms where the decryption process requires the recovery of the original state [17]. The earliest study of reversibility was the concept of the “Garden-of-Eden” configuration, first proposed by John Myhill in the 1960s and further studied by Moore [18, 19]. A “Garden-of-Eden” configuration is a special configuration that has no predecessor, implying a CA exhibiting the “Garden-of-Eden” is not surjective. Amoroso and Patt in the 1970s discovered decision algorithms for injective and surjective CA and organized the relationship between injectivity and surjectivity [1, 2], marking a milestone breakthrough. Bruckner proved that injective and surjective CA must be “balanced” [5]. Sutner, based on the de Bruijn graph, provided another decision algorithm for injectivity and surjectivity and proved its complexity is quadratic time [23]. In 1994, Kari proved that the reversibility of two-dimensional and higher-dimensional CA is undecidable, making it difficult to discuss the reversibility of high-dimensional CA [13, 14]. In recent years, Wolnik et al. have solved the reversibility problem of number-conserving CA using a very elegant method [9, 25, 26]. However, the reversibility of one-dimensional CA has not been fully resolved.
Finite cellular automata (FCA) introduce boundaries to the earliest models of CA. After Kari, many researchers shifted the study of reversibility to linear FCA, using tools like matrices and polynomials. Del Rey made extensive attempts in this area: he analyzed the periodic relationship between the reversibility of a series of specific linear CA and the increase in the number of cells. This approach is feasible when there are few types of linear FCA [7, 16]. However, as the number of types increases and the analysis becomes complicated due to the enlargement of neighborhoods and the number of states, it becomes difficult to carry out. Building on this, Wang extended the computation to the general case of linear FCA, finding the periods of reversibility for any linear FCA through DFA and shift registers [8, 27]. This is already a significant breakthrough.
However, the complexity and functionality of linear FCA is much lower compared to nonlinear FCA. There are only elementary linear FCA, while there are a total of general ones. Therefore, only a very small part of the problem has been solved. Of course, there are several algorithms for determining the reversibility of general FCA, but these algorithms have their limitations: not only are they overly complex and unable to determine the period, but they are also only applicable to 3-neighborhood-size FCA and are suitable for only one type of boundary, either null boundary or periodic boundary [4, 15].
In this paper, we perform calculations on two new kinds of graphs to discover that the reversibility of any nonlinear FCA shows periodicity as cell number grows. We successfully provide a method to calculate a sequence (reversibility sequence), which contains the reversibility of FCA with all numbers of cells. This means we will have an efficient way to determine the reversibility of any FCA completely. The complexity of this algorithm is independent of , a significant leap compared to Maiti’s algorithm [15]. This algorithm is both applicable to null boundaries and periodic boundaries. Our paper demonstrates that, even for complex one-dimensional nonlinear FCA, the computation of their reversibility is efficient.
This paper consists of four sections. The second section introduces the FCA and related concepts. The core content of the algorithm is in the third section. The fourth section summarizes the work of the entire paper.
2 Preliminaries
In this section, we give the formal definitions used in the article. We first define the finite cellular automata (FCA) and relevant problems. Then we define different boundaries of one-dimensional FCA.
2.1 Finite cellular automata
Finite cellular automaton (FCA) is the most basic and important concept in this paper. It is usually defined by a quintuple: FCA =
-
1.
is the dimension of the cellular space. Each point is called a cell. In this paper, the dimension . The number of cells in is denoted as in this paper.
-
2.
is a finite set of states representing a cell’s state in CA. At any time, the state of each cell is an element in this set. We use to count the number of elements in this set.
-
3.
represents neighbor vectors, where , and when . Thus, the neighbors of the cell are the cells . The neighborhood size of this CA is denoted as in this paper. We use to express a function containing neighbor on the left and neighbor on the right. For example, the rule of an elementary FCA can be expressed as .
-
4.
: is the local rule (or simply the rule). The rule maps the current state of a cell and all its neighbors to this cell’s next state.
-
5.
is the type of boundary which includes the null boundary () and the periodic boundary (). The algorithm in this paper is also applicable to the reflective boundary, but it will not be further elaborated upon.
A configuration is a mapping : which assigns each cell a state. Function : is used to represent the global transformation of .
The Wolfram number is a shorthand for the rule. For instance, for a the rule is shown as follows:
(1) |
Then, we can use the Wolfram number 11110000 to abbreviate this rule. This FCA can be represented as a quintuple . The length of the Wolfram number is .
2.2 Boundaries of one-dimensional FCA
There are several different boundaries of one-dimensional FCA. The most important ones studied at present are the null (fixed) boundary and the periodic boundary. Now, we will introduce these boundaries respectively.
Now we suppose the rule of an FCA is , Then the leftmost cell has no left neighbor, and the rightmost cell has no right neighbor. In this case, the leftmost and rightmost cells in the next transformation will lose their corresponding value. To avoid this, we need to fill their neighbors outside the boundary with certain values. These two boundaries correspond to different values of their neighbors.
The null boundary is also called the zero boundary, which always fills “” in the cell outside the configuration. The example of a null boundary is shown in Fig. 1.

Periodic boundary regards the configuration as a circle, which fills the cells left-outside the configuration according to the rightmost cells. The example of the periodic boundary is also shown in Fig. 2.

2.3 Reversibility problem
Definition 2.1.
The surjectivity of a can be expressed as, for any configuration , there exists a configuration , we have . This means that every configuration can find its predecessor, indicating that there is no “Garden-of-Eden” configuration.
Definition 2.2.
The injectivity of a can be expressed similarly: for any two configurations , if , then there must be . That means all configurations have one and only one predecessor.
Proposition 1.
For a FCA, surjective and injective are equivalent and are also referred to as bijective or reversible.
Proof.
For a FCA, since the number of cells is fixed, the two sets before and after the mapping by the global mapping function have an equal number of elements. Therefore, the surjectivity is equivalent to injectivity, which is a bijectivity, also known as reversibility. ∎
Definition 2.3.
If all -cell-configurations (the number is ) of a has one and only one predecessor, then this FCA is -cell-reversible.
Definition 2.4.
If for any , the FCA is always -cell-reversible, then this FCA is strictly reversible. Conversely, if it is never -cell-reversible, then it is strictly irreversible.
Definition 2.5.
The reversibility sequence is an infinite sequence of 0s and 1s, where the th number from the left is 0 indicates that the FCA is irreversible when it has cells, and 1 indicates its reversibility. Due to the presence of periodicity, we underline a complete period in the sequence. For example, if an FCA’s reversibility sequence is 010001, then this FCA is reversible only when the number of cells is in and . Its reversibility period is 3.
Our goal is to quickly determine whether any given FCA is strictly reversible or strictly irreversible. If it is neither, we should obtain its reversibility sequence directly by calculating the period. Specifically, for various widely used boundary conditions, the algorithm should be fully compatible (without significant differences).
2.4 Amoroso’s algorithm
Amoroso’s algorithm is used to determine the surjectivity of infinite CA. It can be described in brief step by step.
- Step 1
-
For a CA with neighborhood size and state set , get its local rule .
- Step 2
-
If , add into the root node.
- Step 3
-
For each node in layer , construct its children . For each tuple in and all , if , then is added to . If a node is the same as a node that has appeared before, its children will not be constructed. If there are not any m-tuples in a node, then the CA has a Garden-of-Eden which decides the CA is not surjective.
- Step 4
-
If the three steps above are completed and the CA is not decided as non-surjective, then the CA is surjective.
3 Main result
The main process of the algorithm is divided into three steps: The first step is to construct the reversibility graph. The second step is to find all circuits in the reversibility graph and construct the circuit graph. The third step is to list the expressions of all irreversible vertices and ultimately provide the reversibility period and sequence.
3.1 Reversibility graph
Definition 3.1.
For FCA = , its reversibility graph is defined as follows:
-
1.
.
-
2.
.
-
3.
.
-
4.
For , there is an edge labeled from to iff and , , there are and
Definition 3.2.
For FCA = , its reversibility graph is defined as follows:
-
1.
.
-
2.
.
-
3.
For , there is an edge labeled from to iff , , and , , there are , and
Definition 3.3.
The negative vertex set .
Theorem 1.
FCA = is strictly reversible iff in .
Proof.
is very similar to the tree constructed by Amoroso’s algorithm introduced in Subsection 2.4. The difference lies in the removal of duplicate vertices from the tree and the addition of and to accommodate the boundary conditions of FCA, thus the proofs are also similar.
If there are no negative vertices in , for any configuration , there exists a corresponding path starting from , and among the vertices the path traverses, there must be a valid configuration that satisfies . Since any configurations can find predecessors through the vertices on the path, this FCA is strictly reversible. Conversely, if there is at least one negative vertex in , the corresponding configurations have no predecessors and are Garden-of-Eden configurations, meaning that the FCA is not strictly reversible. ∎
Proposition 2.
can be constructed within .
Proof.

3.2 Circuit graph and reversibility period
In the previous section, we introduce the construction of the reversibility graph and use it to determine if an FCA is strictly reversible. For FCA with a specific number of cells, remains available, but the concept of “depth” needs to be introduced.
Definition 3.4.
The depth of in is ().

Theorem 2.
If , then the FCA is irreversible when it has cells.
Proof.
There is always a path from to . The configuration corresponding to this path cannot find predecessors, indicating the existence of a “Garden of Eden” configuration. For example, in Fig. 3 left, the configuration with one cell, 0, is a “Garden-of-Eden” configuration. ∎
Theorem 3.
If , and is included in elementary circuits of length . then the FCA is irreversible when it has cells .
Proof.
Starting from , there are different paths that return to , and continuing the search, there are different paths again, essentially forming a linear combination of . ∎
The aforementioned theorems are still not sufficient. We can find that in Fig. 3 left, 000(01)*10 is also a “Garden-of-Eden” configuration, yet we have not included it in our calculations. To address this issue, we define a new type of graph called the ”circuit graph.”
Definition 3.5.
For FCA = , its circuit graph is defined as follows:
-
1.
is an undirected graph.
-
2.
, where is the set of elementary circuit in .
-
3.
For , there is iff and include at least one same vertex.
-
4.
For , , there is iff is included in .
-
5.
The of is its depth in and of is its length in .
Theorem 4.
If , and they are connected to in , then the FCA is irreversible when it has cells where and the subgraph consisting of where and their related edges is a connected graph.
Example 1.
The proof of this theorem is similar to that of the previous theorems, so we use an example in place of a formal proof here. Fig. 5 provides corresponding to in Fig. 3 right. For convenience of representation, we assign an order number to each vertex in the top left corner.

We can quickly list the irreversible number for the FCA based on the above theorems.
(2) |
From , we know that is a sufficient condition for . Many similar conditions are all easy to discern, so we will not list them all here. The union of all these irreversible number forms the reversibility sequence of the FCA. Ultimately, we can determine that the reversibility sequence for this FCA is: 0.
Definition 3.6.
For a connected component of , the sub-period is , where the function is to find the maximum common divisor of the lengths of all circuits in set.
Theorem 5.
The reversibility period of FCA is , where is the set of sub-periods and function is to get the minimum common multiple of a set, then .
Proof.
The proof of this theorem stems from the Frobenius Coin Problem [3, 22]. This problem can be briefly described as determining the largest amount of money that cannot be made with given denominations of coins. The problem has been widely explored in number theory and combinatorial mathematics. In this paper, we utilize it to calculate the reversibility period. ∎
Corollary 1.
If , in and , then the FCA is irreversible when the number of cells satisfies
(3) |
Corollary 2.
If , in and , then the number of cells satisfies
(4) |
Proof.
These two corollaries can help us make reversibility determinations more quickly and directly, sometimes even eliminating the need to construct . In Example 1, we can determine that the FCA is irreversible when the number of cells is greater than or equal to 2, simply by finding there is a negative vertex in with a self-circuit.
Through the aforementioned analysis, we have resolved the most significant issues. Only two minor problems remain to be addressed: one is finding all the circuits in , and the other is the construction of .
Proposition 3.
[10] We can find all elementary circuits of a directed graph in time bounded by , where there are vertices, edges and circuits in the graph.
We can find all the circuits of in , where the FCA has states and has vertices and circuits.
Proposition 4.
We can construct in time bounded by , where there are vertices and circuits in .
Proof.
In , there are points, so there are at most edges. When determining whether two points are adjacent, we need to check whether at most vertices appear simultaneously in these two circuits. Therefore, the complexity is . Algorithm 2 shows the detailed pseudocode of . ∎
Thus, the reversibility problem of one-dimensional FCA has been efficiently resolved. Actually, determining whether an FCA with cells is reversible is not straightforward. However, we approach this problem from a novel perspective: we list all the irreversible scenarios, and what remains are naturally reversible, as a substitute for individually determining the reversibility for every cell count. This approach significantly simplifies the complexity of analyzing the entire problem. Next, let’s fully recapitulate our algorithm.
We list several reversibility sequences for a series of rules in Table 1. Some of the rules in this chapter are linear and can be compared with existing results for linear FCA to verify the correctness of our algorithm. The underlined portions represent a period. is the number of states; is the neighborhood size; is the boundary and is the rule.
, , | reversibility sequence | |
---|---|---|
10101010 | 00000000000 | |
10101001 | 10000000000 | |
2 , 3 , “n” | 10100110 | 10000000000 |
10100101 | 0101010101 | |
10010110 | 101101101 | |
11100001 | 00000000000 | |
11010010 | 1010101010 | |
11000011 | 00000000000 | |
2 , 3 , “p” | 10101001 | 00000000000 |
10100110 | 1010101010 | |
10010110 | 110110110 | |
0010101111010100 | 10110100000 | |
2 , 4 , “n” | 0011001100111100 | 10000000000 |
0011101011000011 | 10100000000 | |
1001011001101001 | 10011001 | |
022211222000011200010212111 | 10000000000 | |
3 , 3 , “n” | 110002222110011222010022011 | 10000000000 |
012012012120120120201201201 | 0101010101 | |
012120201120201012201012120 | 11011101 |
During the experimental process, we found that a large number of nonlinear FCA have a period of 1, meaning that starting from a certain length, configurations of greater lengths are all non-reversible. However, there is still a small portion of nonlinear FCA whose reversibility exhibits periodicity (e.g. the rule 11010010).
4 Conclusion
Our algorithm allows for the computation of the reversibility of configurations of any length for any FCA, with the complexity of . Moreover, the characteristic of finding periods makes this algorithm particularly suitable for computing configurations of greater lengths. However, there are still some issues that remain. First, is there still room for optimization in this algorithm, to further reduce unnecessary computations? Second, during our experiments, we found that there are very few non-linear CA with a period larger than 1; is there a sufficient and necessary condition to identify these CA?
Acknowledgments
This study is financed by Tianjin Science and Technology Bureau, finance code:21JCYBJC00210.
Declaration of generative AI
Generative AI is only used for translation and language polishing in this paper.
References
- Amoroso et al. [1975] Amoroso, S., Cooper, G., Patt, Y., 1975. Some clarifications of the concept of a garden-of-eden configuration. Journal of Computer and System Sciences 10, 77–82.
- Amoroso and Patt [1972] Amoroso, S., Patt, Y.N., 1972. Decision procedures for surjectivity and injectivity of parallel maps for tessellation structures. Journal of Computer and System Sciences 6, 448–464.
- Bardomero and Beck [2020] Bardomero, L., Beck, M., 2020. Frobenius coin-exchange generating functions. The American Mathematical Monthly 127, 308–315.
- Bhattacharjee and Das [2015] Bhattacharjee, K., Das, S., 2015. Reversibility of d-state finite cellular automata. arXiv preprint arXiv:1502.01187 .
- Bruckner [1979] Bruckner, L.K., 1979. On the garden-of-eden problem for one-dimensional cellular automata. Acta Cybern. 4, 259–262. URL: http://dblp.uni-trier.de/db/journals/actaC/actaC4.html#Bruckner80.
- Brun and Mlodinow [2020] Brun, T.A., Mlodinow, L., 2020. Quantum cellular automata and quantum field theory in two spatial dimensions. Physical Review A 102, 062222.
- Del Rey and Sánchez [2009] Del Rey, A.M., Sánchez, G.R., 2009. Reversibility of a symmetric linear cellular automata. International Journal of Modern Physics C 20, 1081–1086.
- Du et al. [2022] Du, X., Wang, C., Wang, T., Gao, Z., 2022. Efficient methods with polynomial complexity to determine the reversibility of general 1d linear cellular automata over zp. Information Sciences 594, 163–176. URL: https://www.sciencedirect.com/science/article/pii/S0020025522000743, doi:https://doi.org/10.1016/j.ins.2022.01.045.
- Dzedzej et al. [2020] Dzedzej, A., Wolnik, B., Nenca, A., Baetens, J.M., De Baets, B., 2020. Efficient enumeration of three-state two-dimensional number-conserving cellular automata. Information and Computation 274, 104534. URL: https://www.sciencedirect.com/science/article/pii/S0890540120300225, doi:https://doi.org/10.1016/j.ic.2020.104534. aUTOMATA 2017.
- Johnson [1975] Johnson, D.B., 1975. Finding all the elementary circuits of a directed graph. SIAM Journal on Computing 4, 77–84.
- Jun [2009] Jun, J., 2009. Image encryption method based on elementary cellular automata, in: IEEE Southeastcon 2009, IEEE. pp. 345–349.
- Kang et al. [2008] Kang, B.H., Lee, D.H., Hong, C.P., 2008. Pseudorandom number generation using cellular automata, in: Novel algorithms and techniques in telecommunications, automation and industrial electronics. Springer, pp. 401–404.
- Kari [1990] Kari, J., 1990. Reversibility of 2d cellular automata is undecidable. Physica D: Nonlinear Phenomena 45, 379–385.
- Kari [1994] Kari, J., 1994. Reversibility and surjectivity problems of cellular automata. Journal of Computer and System Sciences 48, 149–182.
- Maiti et al. [2010] Maiti, N.S., Ghosh, S., Munshi, S., Pal Chaudhuri, P., 2010. Linear time algorithm for identifying the invertibility of null-boundary three neighborhood cellular automata. Complex Systems 19, 89.
- Martı´n del Rey and Rodrı´guez Sánchez [2011] Martı´n del Rey, A., Rodrı´guez Sánchez, G., 2011. Reversibility of linear cellular automata. Applied Mathematics and Computation 217, 8360–8366. URL: https://www.sciencedirect.com/science/article/pii/S0096300311003997, doi:https://doi.org/10.1016/j.amc.2011.03.033.
- Mohamed [2014] Mohamed, F.K., 2014. A parallel block-based encryption schema for digital images using reversible cellular automata. Engineering Science and Technology, an International Journal 17, 85–94.
- Moore [1962] Moore, E.F., 1962. Machine models of self-reproduction, pp. 17–33.
- Myhill [1963] Myhill, J.R., 1963. The converse of moore’s garden-of-eden theorem, pp. 685–686.
- von Neumann and Burks [1966] von Neumann, J., Burks, A.W., 1966. Theory of self reproducing automata.
- Rosin et al. [2014] Rosin, P., Adamatzky, A., Sun, X., 2014. Cellular automata in image processing and geometry. Springer.
- Shallit [2008] Shallit, J., 2008. The frobenius problem and its generalizations, in: International Conference on Developments in Language Theory, Springer. pp. 72–83.
- Sutner [1991] Sutner, K., 1991. De bruijn graphs and linear cellular automata. Complex Syst. 5, 19–30.
- Toffoli and Margolus [1990] Toffoli, T., Margolus, N.H., 1990. Invertible cellular automata: a review. Physica D: Nonlinear Phenomena 45, 229–253.
- Wolnik and De Baets [2020] Wolnik, B., De Baets, B., 2020. Ternary reversible number-conserving cellular automata are trivial. Information Sciences 513, 180–189. URL: https://www.sciencedirect.com/science/article/pii/S0020025519310369, doi:https://doi.org/10.1016/j.ins.2019.10.068.
- Wolnik et al. [2022] Wolnik, B., Dziemiańczuk, M., Dzedzej, A., De Baets, B., 2022. Reversibility of number-conserving 1d cellular automata: Unlocking insights into the dynamics for larger state sets. Physica D: Nonlinear Phenomena 429, 133075. URL: https://www.sciencedirect.com/science/article/pii/S0167278921002323, doi:https://doi.org/10.1016/j.physd.2021.133075.
- Yang et al. [2015] Yang, B., Wang, C., Xiang, A., 2015. Reversibility of general 1d linear cellular automata over the binary field z2 under null boundary conditions. Information Sciences 324, 23–31.