Rainbow Connectivity Using a Rank Genetic Algorithm: Moore Cages with Girth Six

Copyright © 2019 J. Cervantes-Ojeda et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. A rainbow t-coloring of a t-connected graphG is an edge coloring such that for any two distinct verticesu and V ofG there are at least t internally vertex-disjoint rainbow (u, V)-paths. In this work, we apply a Rank Genetic Algorithm to search for rainbow t-colorings of the family of Moore cages with girth six (t; 6)-cages.We found that an upper bound in the number of colors needed to produce a rainbow 4-coloring of a (4; 6)-cage is 7, improving the one currently known, which is 13.The computation of the minimumnumber of colors of a rainbow coloring is known to be NP-Hard and the Rank Genetic Algorithm showed good behavior finding rainbow t-colorings with a small number of colors.


Introduction and Definitions
Evolutionary algorithms have been applied to a wide variety of engineering problems [1], and they have also been applied to mathematics problems. For instance, Jong and Spears [2] showed that Genetic Algorithms (GA) can be used to solve NP-Complete problems, [3] applied a GA to a geometry problem, and [4] solved nonlinear algebraic equations by using a GA. Here we have successfully applied a Rank Genetic Algorithm (Rank GA) [5] to the graph theory problem of finding the rainbow connection number of a graph ( ( )). Chakraborty et al. [6] proved that, for a given graph , deciding whether ( ) = 2 is NP-Complete and that it is also NP-Complete to decide whether a given edge-colored (with an unbounded number of colors) graph is rainbow connected. Therefore, our motivation is to try using the Rank GA heuristic on this problem. To our best knowledge, this problem has not been approached in this way nor using any other heuristic algorithms.
In a genetic algorithm we have an initial population of individuals; in our case, each individual represents a particular edge-colored graph. Each individual of the population is evaluated according to a fitness function; this function measures the ability of the individual for reaching a predetermined objective. Once individuals are evaluated, the next generation is obtained by applying genetic operators to the population inspired by the evolution in nature, such as crossover between individuals, selection of the fittest individuals, and mutations. This procedure is repeated until the genetic algorithm finds an individual that achieves the required objective or until a maximum number of generations are reached. A genetic algorithm can solve mathematical problems that are intractable by exhaustive search, as is the case of the problem described here.
A graph is -connected if and only if there are at least internally disjoint ( , V)-paths connecting every two distinct vertices and V of [7]. A rainbow path is a path such that all the edges of have different colors (a path of is a sequence of distinct vertices (V 1 , V 2 , . . . , V ) such that {V , V +1 } is an edge for ∈ {1, 2, . . . , − 1}). An edge coloring of a graph is called a rainbow -coloring if for every pair of distinct vertices and V there are at least internally disjoint rainbow ( , V)-paths. The rainbow -connectivity ( ) (defined by Chartrand et al. [8]) of a graph is the minimum integer such that there exists an edge coloring using colors which is a rainbow -coloring. The rainbow 1-connectivity is known as the rainbow connection number and was introduced by Chartrand et al. [9].
The rainbow -connectivity of a graph has applications in the Cybernetic Security (see Ericksen [10]). For any fixed 2 Journal of Applied Mathematics is NP-Complete [6,11]. For more references on rainbow connectivity and rainbowconnectivity we refer the reader to the survey by Li [12] et al. and the book of Li and Sun [13].
A graph is -regular if every vertex of has degree . The girth of is the length of a shortest cycle of . Given two integers ≥ 2 and ≥ 3 a ( ; )-cage is a -regular graph with girth and the minimum possible number of vertices. Let ( ; ) denote the order of a ( ; )-cage. For references on cages see the dynamic survey of Exoo and Jajcay [14]. By counting the vertices emerging from a vertex or from an edge the lower bound 0 ( ; ), known as the Moore bound, is obtained. That is, ( ; ) ≥ 0 ( ; ), where When ( ; ) = 0 ( ; ) the ( ; )-cage is called a Moore ( ; )-cage; for references on Moore cages see [15]. The Moore cages have been characterized [16][17][18]. The existence of ( ; 6)-Moore cages is related to the existence of finite geometries. For instance, the (3; 6)-cage is the incidence graph of Fano's plane. Concerning connectivity of ( ; 6)-cages it has been proved that they are -connected [19].
The structure of this paper is as follows. In Section 2 we explain how the Rank GA was applied to the rainbow coloring problem. Results are presented in Section 3 and finally the conclusions are drawn in Section 4.

Finding Rainbow Colorings in a Moore Cage with a Genetic Algorithm
Finding a particular rainbow -coloring of a graph using colors (that is a coloring with internally disjoint rainbow paths between any pair of vertices) implies that ( ) ≤ . We use an adapted version of the Rank GA [5] to find rainbow colorings in a Moore cage. To do so, each individual in the population contains a list of the assigned colors of each edge in the graph and is initialized randomly. In the Rank GA, the individuals of the population are ranked from best to worst in terms of their fitness before the genetic operators (selection, recombination and mutation) are applied. The application of these genetic operators depends on the rank of each individual in the population. The top ranked individuals tend to vary less than the bottom ranked ones. This is to make the latter try to escape from local optima of the fitness function. Also, top ranked individuals tend to be cloned more than others who tend to disappear. The adapted RankGA pseudocode that was used is given in Algorithm 1 and its parameters are shown in Table 1.

The Fitness Function.
We detail below the fitness function. As this is an interdisciplinary work, we express the fitness function mathematically (below) and also in a computational way in Algorithm 2.
Let be a graph, let Ψ( ) be the set of all possible colorings of the edges ( ), and let be the set of all pairs of vertices of , that is, The fitness function to be maximized using the RankGA is given as where ∈ Ψ( ) and where (a) is the set of all sets P a of internally disjoint paths between the vertices in a and (P a , ) where ℎ : where ( ) is the set of all edges in path and where ( ) is the color that the coloring assigns to edge . The function ℎ , in (12), calculates the cardinality of a set made out of the colors ( ) assigned to the edges ∈ ( ) in path . The function ℎ , in (10), calculates the ratio of the ℎ over the length of path , being this a value in the range The pseudocode of the fitness function is given in Algorithm 2.

Finding the Set of Internally Disjoint Paths Sets between
Pairs of Vertices in a Graph. The total number of possible sets a of paths (internally disjoint or not) between the vertices in pair a is very high as grows so in order to save computing time when calculating the fitness of an individual, the function in (6) iterates only on the elements of the set (a) which is the set of path sets P a that contain internally disjoint paths between the vertices in a. Algorithm 3 describes a way to calculate and store the set of all (a). In this algorithm, the procedure ℎ takes each vertex pair a in and calls function ℎ in order to get the full set a of paths between the vertices in a with length ≤ (since longer paths cannot be rainbow colored). Then it calls another function ℎ which tests each set a containing paths ∈ a between the vertices in a to see if a is a disjoint paths set and returns the set (a) of disjoint paths sets P a .
The function ℎ is recursive and takes 3 parameters: a vertex pair a = { 1 , 2 }, a graph , and a maximum length ℎ of the paths to be found. Figure 1 illustrates how this function works. Paths that go from vertex 1 to vertex 2 are made by adding the step from 1 to ℎ of 1 to all paths that go from gℎ of 1 to 2 for each . But before doing this, vertex 1 is marked as visited in order to avoid paths that visit a vertex more than once. After computing the set of paths, vertex 1 is unmarked.
In Table 2 we show how several measures grow with parameter . First there is the number of vertices | ( )| in the ( ; 6) cage followed by the total number of vertex pairs. Then there is the number of vertex pairs with distances = 1, = 2, and = 3 between them, respectively. We can see how the total number of paths with length ≤ 7 = between vertex pairs changes with distance and with . The next measure is the important one because it shows the drastic increase with of the total number of paths sets containing paths (internally disjoint and noninternally disjoint) that can be formed with the paths between the pairs of vertices with distances = 1, = 2, and = 3 between them, respectively. All these sets need to be tested to see which of them are disjoint pats sets. Finally we show the total number of paths sets that need to be tested and the approximate time to compute this with our existing algorithms and computing power. As one can see the numbers are much bigger as increases making it practically impossible, at the moment, to do the work for = 5.

Results
The genetic algorithm was able to find several rainbow colorings of the ( ; 6)-Moore cage for = 3 and = 4 using 7 colors. Using 6 colors, the algorithm could not find any rainbow colorations for neither = 3 nor = 4. A sample rainbow coloring that was found can be seen in Figure 2.

Conclusions
The problem of finding the rainbow -connectivity ( ) of ( ; 6)-cages is intractable by exhaustive search. So it had not been possible to verify if it is possible to improve the upper bound given by (2). With the Rank GA we could see that it is unlikely that the upper bound for (3; 6)-cages is less than 7, since with 6 colors no solution was found after having let the algorithm run for a long time. We also found that for the (4; 6)-cage there is an upper bound of 7 colors since the algorithm found rainbow colorings in this case. This upper bound improves quite a lot the 13 colors given by (2) which binds the rainbow -connectivity of ( ; 6)-cages with a quadratic function. By finding out that the upper bound for the (4; 6)-cage is 7 we know that this upper bound function could be one that grows slower than a quadratic  function and may be much slower. To find the form of this function the problem should be scaled to Moore cages with ≥ 5; however, for = 5, the problem is computationally very expensive, with the algorithms and computing power that we currently use. Thus, as for future work we will consider different approaches such as taking into account the symmetries of the graph, parallelization, and improvement of algorithms.
We believe that graph theory can benefit from the use of artificial intelligence techniques in some known NP-Complete and NP-Hard problems such as the one presented in this paper and there may be many of these cases.

Data Availability
No data were used to support this study.

Conflicts of Interest
The authors declare that they do not have any conflicts of interest.