Abstract

The All-Ones Problem comes from the theory of -automata, which is related to graph dynamical systems as well as the Odd Set Problem in linear decoding. In this paper, we further study and compute the solutions to the “All-Colors Problem,” a generalization of “All-Ones Problem,” on some interesting classes of graphs which can be divided into two subproblems: Strong-All-Colors Problem and Weak-All-Colors Problem, respectively. We also introduce a new kind of All-Colors Problem, -Random Weak-All-Colors Problem, which is relevant to both combinatorial number theory and cellular automata theory.

1. Introduction

A graph dynamical system (GDS) is a dynamical system constructed over a graph whose vertices can have different states, such that all these states together at a given time constitute a state of the system which can evolve according to an updating scheme [1, 2]. The states of the vertices are commonly modeled by the Boolean values 0 and 1, while the updating scheme consists of as many local functions as vertices and a series of rules that indicate the order in which the local functions act. GDS can be divided into two categories: parallel (PDS) [3, 4] and sequential (SDS) [5, 6] when all the local functions act synchronously or follow an order to act, respectively. In the specific literature, other related topics appeared previously, such as Boolean networks (BN) [7] and cellular automata (CA) [8], which are, in fact, particular cases of GDS. In this paper we will consider “All-Colors Problem,” which is concerned with graph cellular automata as one kind of dynamical systems on networks.

A graph is a pair where . These structures allow for self loops. In the theory of automata, we will insist that is local finite; i.e., every vertex in is adjacent to only finite many vertices. In this paper, we only consider as a finite simple graph. It is convenient to identify with the adjacency matrix of constructed as a matrix in . Here is the two-element field and there is a in the row and column of if and only if there is a directed edge from vertex to vertex in .

A vertex is a predecessor of if there exists an edge in . The collection of all predecessors of will be denoted byNote that may or may not include depending on whether has a self-loop in or not. We will refer to as the neighborhood of in . A configuration of is a functionThe collection of all configurations of will be denoted by . Define the transition rule by is called the -automaton on .

Configurations are conveniently identified with subsets of ; i.e., is identified with . Observe that algebraically is a vector space over , ; addition here amounts to take symmetric differences. We will call this space the configuration space. Furthermore, is a linear map from the configuration space to itself (such rules are called additive in [9]). If one thinks of configuration as a column vector over , it is obvious from the definition that where is the adjacency matrix of .

A -automaton is symmetric if and only if the adjacency matrix of is symmetric; thus symmetric -automata arise from undirected graphs. In the following sections, we will consider only symmetric -automata on undirected graphs.

Let be an undirected graph without self-loops and a subset of . Define to be the graph obtained from by adding self-loops at all vertices in . -automata of the form or are called Lindenmayer automata on .

To lighten notation we will usually omit the subscript and write , and , and so forth. Also we will write for and for . We will write for the empty set and for as members of , so and for all in .

The term All-Ones Problem was introduced by Sutner; see [10]. It has applications in linear cellular automata; see [11] and the references therein. The problem is cited as follows: suppose each of the vertices of an undirect graph with vertices is equipped with an indicator light and a button. If the button of a vertex is pressed, the light of that vertex will change from off to on and vice versa; the same happens to the lights of all the edge-adjacent vertices. Initially all lights are off. Now, consider the following questions: is it possible to press a sequence of buttons in such a way that in the end all lights are on? This is referred as the All-Ones Problem. If there is such a way, how to find a such way? Here and in what follows, we consider connected simple undirected graphs only. When disconnected graphs must be concerned, we can deal with them component by component. For all terminology and notations on graphs, we refer to [12]. An equivalent version of the All-Ones Problem was proposed by Peled in [13], where it was called the Lamp Lighting Problem. We cite it as follows.

Light bulbs are controlled by switches . Switch changes the on/off status of light and possibly the status of some other lights. Assume that if changes the status of light , then changes the status of light . Initially all the lights are off. Prove that it is possible to operate the switches in such a way that all the lights are on.

The rule of the All-Ones Problem is -rule on graphs, which means that a button lights not only its neighbors but also its own light . If a button lights only its neighbors but not its own light, this rule on graphs is called -rule. There were many publications on the All-Ones Problem; see Sutner [14, 15], Barua et al. [16], and the references therein. Using linear algebra, Sutner [17] proved that it is always possible to light every lamp in any graphs by rule. Lossers [18] gave another beautiful proof also by using linear algebra. A graph-theoretic proof was given by Erikisson et al. [19]. More results and related references can be referred to [2025].

In graph-theoretic terminology, a solution to the All-Ones Problem with -rule can be stated as follows: given a graph , where and denote the vertex-set and the edge-set of , respectively, a subset of is a solution if and only if for every vertex of the number of vertices in adjacent to or equal to is odd. Such a subset is called an odd parity cover in [17]. So, the All-Ones Problem can be formulated as follows: given a graph , does a subset of exist such that, for any vertex , the number of vertices in adjacent to is odd, while for any vertex , the number of vertices in adjacent to is even?

Sutner [10] proposed the question whether there is a graph-theoretic method to find a solution for the All-Ones Problem for trees. Galvin [26] solved this question.

The “All-Ones Problem” can be considered to find the preimages of configuration 1 under parallel map defined by local rule . In this paper, we further study the “All-Colors Problem,” a natural generalization of “All-Ones Problem,” which can be divided into two subproblems: Strong-All-Colors Problem and Weak-All-Colors Problem, respectively.

This paper is organized as follows. In Section 2, we introduce the preliminary and definitions of the “All-Colors Problem” under -rule. The “All-Colors Problem” can be divided into two subproblems: Strong-All-Colors Problem and Weak-All-Colors Problem which are studied in Sections 3 and 4, respectively. In the end of Section 4, we also introduce a new kind of All-Color Problem, -Random Weak-All-Colors Problem, which is relevant to both combinatorial number theory and cellular automata theory.

2. Preliminary of All-Colors Problem

Here we introduce a natural generalization for the All-Ones Problem—All-Colors Problem. When we discuss the All-Colors Problem, we need a positive integer and a graph each of whose vertices has a color value between and . There are two kinds of All-Colors Problem: Strong-All-Colors Problem and Weak-All-Colors Problem. We give their accurate definitions as follows.

Definition 1 (strong-all-colors problem under -rule on ). If a vertex is pressed one time, then the color values of the vertex and its neighbors are added by under the meaning of modular . If the initial status is that the color value of every vertex is , then how to press some vertices (maybe many times) to make the color value of every vertex equal to under the meaning of modular .

Definition 2 (weak-all-colors problem under -rule on ). If a vertex is pressed one time, then the color values of the vertex and its neighbors are added by under the meaning of modular . If the initial status is that the color value of every vertex is , then how to press some vertices (maybe many times) to make the color value of every vertex not equal to under the meaning of modular .

A solution to the Strong-All-Colors Problem on a graph under -rule is a configuration such that, for any , where is denoted as the set of vertices of which are adjacent to . Correspondingly, a solution to the Weak-All-Colors Problem on a graph under -rule is a configuration such that, for any ,

It is worth noting that we only need to study the Strong-All-Colors Problem and the Weak-All-Colors Problem in the case that is a power of a prime. Indeed, let be the prime factorization of . Suppose that there exists a solution to the Strong-All-Colors Problem under on for any . That is, for any ,By the Chinese Remainder Theorem, there exists such thatfor any and . It follows thatfor any . By the Chinese Remainder Theorem again, one hasThat is, is a solution to the Strong-All-Colors Problem on . The discussion of the Weak-All-Colors Problem is similar.

Note that we can also define the corresponding Strong-All-Colors Problem under -rule on and Weak-All-Colors Problem under -rule on ; however, they are more difficult to study.

In the following sections, we will discuss the All-Colors Problem under -rule in detail. We need to use two definitions equivalent to Definitions 1 and 2 for convenience. Suppose is a simple undirected graph; each vertex of has a color value on which can change with time. These changes abide by the following rules (-rule): If, for , is the initial color value of at time , then, at time , the color value of has changed to , where is the set of vertices which are adjacent to .

The Strong-All-Colors Problem under -rule can be redefined as follows: to find the initial color values of all the vertices of at time such that any vertex of has a color value equal to at time under -rule.

The Weak-All-Colors Problem can be redefined as follows: to find the initial color values of all the vertices of at time such that no vertex of has a color value equal to at time under -rule.

For the sake of simplicity, the Strong-All-Colors Problem is denoted as SACP from now on. Correspondingly, the Weak-All-Colors Problem is denoted as WACP.

3. Strong-All-Colors Problem under -Rule on

First of all, for a general graph, the SACP with -rule on may have no solution. For example, there is no solution to the SACP under -rule on for a circle when and . Particularly, by observing the following tree with vertices, in Figure 1, we will discover surprisingly that there is no solution to the SACP under -rule on for any .

Then a question arises naturally: How to determine whether a graph has a solution to the SACP with -rule on ?

It is easy to find an algebraic method to solve this problem. Suppose is a graph with vertices. The following theorem can be obtained easily and we omit the proof.

Theorem 3. There exists a solution to the SACP with -rule on for a graph if and only if the following system of linear equations has a solution on .where is the adjacent matrix of , is the identity matrix, is an vector of variables, and is an vector each element of which is .

Example 4. Consider the tree at the beginning of this section. Its adjacent matrix isIt is easy to verify thatis equivalent toLet us operate the 6 equations as follows.so we getIt is obvious that equation (15) holds if and only if . So has no solution to the SACP under -rule on for , which we have just declared.

The system of linear equations over could be solved. Let , , and . We need to solve the equation . If , as above, is a principle idea ring, there exist invertible matrices such that , wherewhere and is the Smith normal form of . We can compute and if . Then is equivalent to . We set and we can solve since is a diagonal matrix. Hence, we obtain .

Although this algebraic method is quite succinct, it is interesting to study the SACP under rule on over some classes of graphs.

In the following, we consider the SACP under -rule on for trees. Note that we do all the operations “+” and “−” on the ring . Consider the special case when the tree is a “caterpillar.” A tree is called a caterpillar if and only if the remainder of is a path after removing all the leaves of . Figure 2 shows such a caterpillar.

We can find the solution to the SACP under -rule on for a caterpillar according to the following process.

Suppose is a caterpillar with the following shape of Figure 2. First we assume that the initial color value of vertex is , which will be determined in the end. It is easy to see that the initial color values of the leaves of vertex must be in order to make the color values of vertices , changing to by the meaning of modular under -rule. Then the initial color value of would be to make the color value of equal to under -rule. Repeat this step until we have determined the initial color value of , denoted by , which is a linear function of . From this procedure we can see that there is only one equation to be satisfied; i.e.,where is the initial color value of vertex .

So we have the following.

Theorem 5. A caterpillar has a solution to the SACP under -rule on if and only if the equation (17) has a solution on .

We give two examples with solutions to the SACP under -rule on in Figure 3. All the negative integers that appeared in the following figures are under the meaning of modular .

As an application of Theorem 5, we have the following.

Corollary 6. If is a path with vertices, then has a solution to the SACP under -rule on for any .

Proof. Let , a sequence of integers on , represent the initial color values of vertices of . It is easy to check thatis a solution to the SACP under -rule on for any .

Corollary 7. If is a tree with the shape as shown in Figure 4, then(1)when , has a solution as in Figure 5(2)when , has a solution if and only if has a solution on , which is equivalent to . Here is the initial color value of vertices (3)when , has a solution if and only if has a solution on , which is equivalent to . The meaning of is the same to above

Now we show a reduction technique. First we introduce a new concept.

Definition 8. Suppose is a graph. If there are distinct vertices , , of satisfying (1) is a leaf(2) is exactly adjacent to and then is called a -connected path and denoted by simply.

Example 9. For example, Figure 6 shows a tree which has a -connected path marked by an ellipse.

Theorem 10 (deleting a 3-connected path). Suppose that is a graph with vertices . If contains a -connected path , then has a solution to the SACP under -rule on if and only if has a solution to the SACP under -rule on , where is a tree or a forest.

Proof. Suppose has a solution to the SACP under -rule on . Assume the initial color value of vertex is . We have because it requires and to ensure the color value of and to be changed to under -rule. Then we can say that is a solution to the SACP under -rule on for .
For the converse, suppose is a solution to the SACP under -rule on for . Let denote the set of vertices that are adjacent to in . It is easy to check is a solution to the SACP under -rule on for , where This completes the Proof.

It is worth noting that we can use this reduction technique repeatedly. For example, the tree in Example 9 can be reduced continuously. The reduction process and its inverse, which can help us to get the solution to the SACP, are shown in Figure 7.

In fact, there are some other complex structures which can be reduced. But they are commonly relevant to . For example, when , the structures shown in Figure 8 can be removed from a tree, just like the -connected path.

Next, we study another special kind of trees—radioactive trees. A tree is called a radioactive tree if and only if there is only at most one vertex of which has a degree bigger than . In fact, a radioactive tree can be viewed as several paths adhering to a common vertex.

Theorem 11. If is a radioactive tree, then has a solution to the SACP under -rule on for any .

Proof. Assume that has the shape shown in Figure 9.
By Theorem 10 we can delete -connected path continuously. Without loss of generality we may assume that at last has changed to that has paths from the root. It is enough to prove that has a solution to the SACP. Suppose for and for in . If , then , for is a solution. If , then , for , and for , and is a solution to the SACP. The schematic diagram for the latter case is shown in Figure 10.

Actually, we can also prove Theorem 11 with the help of our reduction technique introduced before. The detail of the proof is omitted here.

4. Weak-All-Colors Problem

In this section, we will study the WACP under -rule on , . It is worth noting when , the WACP becomes the All-Ones Problem which we have discussed before. So the WACP is another generalized form of All-Ones Problem. The WACP has corresponding linear algebraic representation. If is a graph with vertices and is the adjacent matrix of , then the WACP is equivalent to the next algebraic question:

Find the values of variables on such that no component of the result vector of is equal to .

It is known that any graph has a solution to the All-Ones Problem under -rule. We conjecture that it also holds for the WACP.

Conjecture 12. For any graph , there is a solution to the WACP under -rule on .

We should point out that the original proof to the existence of a solution to the All-Ones Problem for any graph cannot do any effects on the WACP on when . So it seems that we need to find another approach to solve this conjecture.

In this section, we emphasize the trees by using the technique of increasing a leaf. By Theorem 14, we show that Conjecture 12 is valid for trees. By Theorem 15, it also holds for cycles. Using the increasing technique and Theorem 15, we prove that Conjecture 12 is valid for unicyclic graphs, which is Corollary 16. Furthermore, by Theorem 17, it is interesting that we can find a solution, which contains only 0 and 1, to the WACP under -rule on for trees. Correspondingly another Conjecture 18 is proposed.

Lemma 13 (increasing a leaf). If is a graph and is a vertex of whose degree is , i.e., is a leaf, then has a solution to the WACP under -rule on if does too.

Proof. Assume has a solution to the WACP under -rule on . Suppose is only adjacent to in . Then letBecause , so we could find a in . It is easy to check that is a solution to the WACP under -rule on .
The proof is completed.

From Lemma 13, we can obtain Theorem 14 easily.

Theorem 14. Let be a tree and . Then has a solution to the WACP under -rule on satisfying .

Proof. We use the technique of increasing a leaf. Firstly let be a one-vertex tree, and let , which is a solution to the WACP under -rule on satisfying . Secondly we can add another vertex , which is adjacent to , and the edge into . Let denote the new tree. It is easy to see that there is a solution to the WACP under -rule on satisfying . Repeat these steps by adding an appropriate vertex each time, until at last we get a solution to the WACP under -rule on for satisfying , which is just that we want. We conclude the proof.

Since it is not hard to construct a solution, we can obtain the following theorem straightforwardly.

Theorem 15. There is a solution to the WACP under -rule on for any cycle.

In fact we can extend the result to “unicyclic graphs." Recall that a graph is called unicyclic if it contains a unique cycle. In other words, we can regard a unicyclic graph as a cycle attached with each vertex a rooted tree.

Corollary 16. If is a unicyclic graph, then there is a solution to the WACP under -rule on for .

Proof. From Theorem 15, a cycle has a solution to the WACP under -rule on . Using the increasing technique repeatedly, we can prove that this statement holds.

Next, we prove that there is a special solution to the WACP on for any tree such that all the color values of vertices are and .

Theorem 17. If is a tree, then there is a solution to the WACP under -rule on such that or for any .

Proof. Suppose is a rooted tree with root . We need to introduce three new concepts.
The small WACP is to find an initial color value array on such that (1)(2)(3) or Then the initial color value array will be called a solution to the small WACP.
Correspondingly, the positive WACP is to find an initial color value array on such that (1) or (2)(3) or Then the initial color value array will be called a solution to the positive WACP.
The even WACP is to find an initial color value array on such that (1) or (2)(3) or Then the initial color value array will be called a solution to the even WACP.
In fact a solution to the positive WACP is also a solution we required in this proposition. So it is sufficient for us to prove that there is a solution to the positive WACP for any rooted tree.
Suppose is a rooted tree with root . If there is a solution to the small WACP such that , we say that is a permissible color value of root to the small WACP. Accordingly, if there is a solution to the small WACP such that , then is a permissible color value of root to the small WACP. We name the set of all permissible color values of root as the permission set of root to the small WACP and denote it by .
Similarly, we can define the permission set of root to the positive WACP, denoted by , and the permission set of root to the even WACP, denoted by . Then for the rooted tree with root , will be called the type of root and corresponding rooted tree . For example, the type of a rooted tree shown in Figure 11 is , or denoted by for simplicity.
Next we need to define “Add Into Operation.” Suppose and are two rooted trees with roots and , respectively. We will get a new rooted tree with root by adding into with as a child of . This operation is called an Add Into Operation on to . If the result tree is , then we denote the operation as . It is not difficult to show that each rooted tree can be derived by doing an Add Into Operation on one smaller rooted tree to another smaller rooted tree.
Furthermore, if the color value array on is a solution to the small WACP for and on is a solution to the small WACP for , then the color value array will be a solution to the small WACP for , i.e., a new tree with root , so we write as . Then we denote it as the equation Similarly, we can get other equations like this. Altogether there are 15 equations as follows. From the above equations, we can calculate the type of the rooted tree obtained from the Add Into Operation on a rooted tree to another rooted tree , as long as we have known the types of and . For example, if the root of has the type and the root of has the type , then the type of the new result rooted tree derived by doing an Add Into Operation on to will be . The validity lies in the following equations. Then we want to list all possible types of rooted trees. In fact, there are only distinct types of rooted trees. Each type and one of its representative rooted trees are shown in Figure 12.
In order to show that there are only distinct types, we need to show that the following assertion is correct.
Assertion. If each of the two rooted trees , with roots and , respectively, belongs to one of the types, then the rooted tree derived by doing an Add Into Operation on to belongs to one of the types.
We have mentioned before how to calculate the type of the result rooted tree obtained by doing the Add Into Operation on a rooted tree to another if their types are known. Since all rooted trees can be derived by doing an Add Into Operation on a smaller rooted tree to another smaller one, we can observe that all the types of rooted trees are contained in the set of distinct types above. The proof of the Assertion exists in Table 1. Since the original table is too wide, we divide it into two tables as in Tables 1(a) and 1(b).
We have showed that any rooted tree belongs to one of the types and, in each of the types, the permission set to the positive WACP is not empty. So any rooted tree would have a solution to the positive WACP, which finishes the proof.

From Theorem 17, we will think whether there is a solution to the WACP when , which is the following conjecture.

Conjecture 18. Let be a tree. Then has a solution to the WACP under -rule on such that or , .

In the following, we will put forward a special WACP under -rule on complete graphs.

Let be a complete graph with vertices . Each vertex has an initial color value on at time . Suppose, at time , the color value of each vertex , denoted by , is equal to the sum of the color values of random vertices under the meaning of modular , i.e.,If there is no possibility for to have the color value equal to , i.e.,then we call 0-avoidable. If all vertices are -avoidable, then we say that the initial color value array is good. If has distinct elements under the meaning of modular , we call k-good. The problem to find a -good initial color value array is called the -Random WACP under -rule on  . Note that we always assume that and when we discuss on the -Random WACP on .

We need to point out that if is big enough, the -Random WACP may have no solution for any . For example, it is easy to verify that when , , has no -good initial color value array for any ; i.e., the -Random WACP has no solution. In fact, for any integers such that or , , the setmust have a -element subset such that the sum of its elements is equal to under the meaning of modular .

In the following we will try to find when the -Random WACP has a solution and how to construct a solution by the help of combinatorial number theory. We need to represent the -Random WACP by using the terminology in combinatorial number theory as follows:

Whether there exists , a sequence of elements of of length such that the number of distinct ’s is equal to , and the sum of any elements of is not equal to under the meaning of modular .

It is necessary to introduce Bialostocki Number from combinatorial number theory. Suppose , are positive integers. Denote by the least integer for which the following holds: If is a sequence of elements of of length such that the number of distinct ’s is equal to , then there are indices belonging to such that . It is easy to see that there is a solution to the -Random WACP for if and only if .

How to calculate is still an open problem in combinatorial number theory. Until now only part of Bialostocki Numbers have been derived. In [27], Gallardo, Grekos, and Pihko proved the following.(1)If is odd, then ; if is even, then .(2)If and , then .

In [28], Wang proved the following.(1)If is odd and , then(2)If is even and , then

Now return to the -Random WACP. We have the following results.

Theorem 19. Suppose and are two given positive integers and . (1)When and is odd, there is no solution to the -Random WACP on for .(2)When and is even, there is a solution to the -Random WACP on for if and only if , and the initial color value array is one solution.(3)When , there is a solution to the -Random WACP on for if and only if .(4)When is odd and , there is a solution to the -Random WACP on for if and only if , and the initial color value arraysatisfying , , , is one solution.(5)When is even and , there is a solution to the -Random WACP on for if and only if , and the initial color value arraysatisfying , , , is one solution.

The proof and corresponding solutions constructed can be referred to [27, 28].

5. Conclusion

The All-Ones Problem comes from the theory of -automata, which is related to the graph dynamical system. In this paper, we introduce and study the generalization form of the All-Ones Problem, named “All-Colors Problem.” The “All-Colors Problem” can be divided into Strong-All-Colors Problem and Weak-All-Colors Problem, respectively. We analyze and compute the solutions to these two problems on some interesting classes of graphs. At last we also introduce a new kind of Weak-All-Color Problem, -Random Weak-All-Colors Problem, which is relevant to both combinatorial number theory and -automata.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported by NSFC (Nos. 11871280 and 11471003) and Qing Lan Project.