## 3 Materials and Methods
### MOCell-Based QoS Optimal Path  
In this work, we consider the implementation of cellular GA for path selection considering the QoS of flows, particularly MOCell. The main feature of this algorithm is the distribution of its population in small neighborhoods, where each individual (possible solution to the problem) can be recombined only in the surrounding cells (neighborhood cells). Neighborhoods can be grouped with 4, 8, and 16 neighbors, with eight neighbors being the default configuration in the MOCell algorithm [37]. The population is represented on a two-dimensional toroidal grid so that everyone has the same number of neighbors. The main idea is to explore the search space further since overlapping neighborhoods cause a slow spread of solutions in the population. At the same time, genetic operators exploit each neighborhood (see Figure 3). MOCell maintains a file that stores the non-dominated solutions found in each iteration; the grouping distance of NSGA-II [38] is used to compute them. MOCell differs from other genetic algorithms by maintaining a diverse solution set and a feedback mechanism of non-dominant solutions to replace individuals in the population after each generation. The genetic algorithms [39] start from a set (population) of potential solutions (individuals). The best solutions are selected according to a fitness function through a selection process to assign the parents of each neighborhood and carry out the crossover and mutation processes in order to find better solutions to the problem (Algorithm 2 introduces the MOCell pseudocode). Figure 3: MOCell algorithm. One of the simplest methods for generating routing paths is random search. This involves using arrays of random integers to symbolize different paths. The population is generated by randomly assigning different priority IDs for each device, considering the size of the topology, as well as validating the path with the decoding process mentioned above. All individuals are distributed in a toroidal grid. For the generation of an encoded path, a chain is created containing the total number of randomly ordered network devices. The positions of the numbers represent the genes (priority IDs) that make up a chromosome (pathway). The first gene represents the source path, and to determine the path of a chromosome is necessary to decode the sequence using the adjacency matrix of the topology. For example, in the coding process of a routing path between H1 and R1 of the network topology, as shown in Figure 4, the following procedure is defined:  
Coding:  
* Generated a chain with 10 elements corresponding to network nodes. * Filled the string with random numbers from 1 to 10. * Created a chromosome: 5 8 2 1 4 10 6 7 3 9. Decoding:  
Table 3 shows the network adjacency matrix used to perform this procedure. The genes' value is defined from highest to lowest to determine the order of the path, as shown below:  
(1) The path is initialized on H1 towards R4, as it is the only adjacent node. (2) R4 has two adjacent nodes: R2 with an ID = 8 and R5 with an ID = 4. The selected node has the highest ID--in this case, R2. Figure 4: Example topology. Metrics: delay (ms), packet loss rate (%), and bandwidth (Mbps). (3) In R2, R1 is chosen because it has the highest value ID. (4) The decoding process is completed; the path reaches the proposed destination node (R1). (5) Path: H1, R4, R2, R1. In genetic algorithms, to improve the characteristics of solutions (chromosomes), crossover operators are used in each generation. In the MOCell algorithm, a single-point crossover (_SPX_) between two parents without the point from the origin and destination was used to conserve the path [40]. For this method, a cut-off point between both parents is selected, and an element of the solution vector is selected randomly to assign it as a cut-off point. The genes of both parents are exchanged between the parents' genes, providing two new descendants with information about parental genetics.