# A Novel RPL Algorithm Based on Chaotic Genetic Algorithm
## 3 RPL-Cga
### Cga  
A genetic algorithm is a kind of heuristic algorithm. It simulates the evolution process of biological populations in nature, and mainly includes genetic, crossover, and mutation operations. It can directly operate on the object, has better global optimization ability, can automatically obtain and guide the optimized search space, adaptively adjust the search direction, and does not need to determine the relevant search rules. It can be widely used in function optimization, image processing, machine learning, etc. However, the genetic algorithm has some problems such as premature convergence and local optimum.  
Chaos appears to be irregular and similar to random, but it has a delicate internal structure. A chaos optimization algorithm has the characteristics of avoiding local optimization, randomness, and ergodicity in search processes. The definition of chaos is as follows:  
**Definition 1**.: _The continuous self-mapping f on [a, b] is chaotic, if the following conditions are satisfied:_  
1. The period of the periodic point of f has no upper bound.
2. Existing uncountable subset \(S\subset[a,\ b]\), there is no periodic point in S, and the following conditions are met: 1. \(\forall x,y\in S,\)\(\lim\limits_{n\rightarrow\infty}\inf[f^{n}(x)-f^{n}(y)|=0;\)2. \(\forall x,y\in S,\)\(x\
eq y,\)\(\lim\limits_{n\rightarrow\infty}\sup\lvert f^{n}(x)-f^{n}(y)\rvert>0;\)3. \(\forall x\in S,y\) is any periodic point of \(f,\)\(\lim\limits_{n\rightarrow\infty}\sup\lvert f^{n}(x)-f^{n}(y)\rvert>0.\)  
Based on the characteristics of chaotic optimization and genetic algorithm, a chaotic genetic algorithm (CGA) is proposed in this paper. The basic idea is to introduce the chaotic mechanism into genetic algorithm, and to combine the genetic algorithm and chaotic optimization algorithm to complement each other. The overall process of CGA is basically consistent with the genetic algorithm, such as the generation of the initial population, fitness calculation, selection, crossover, mutation, replication, etc. Moreover, CGA improves the selection of control parameters and the initial value of initial population, and reduces the randomness of the genetic algorithm. Meanwhile, convergence and local optimization of the genetic algorithm can be effectively improved through chaotic selection, crossover, mutation, etc. In other words, CGA can enlarge the search sample space due to the ergodicity of chaotic algorithm, can find the global optimal solution due to the global search of genetic algorithm, and can avoid local optimization due to the initial sensitivity of chaotic optimization algorithm. Meanwhile, the population size has little effect on searching for the global optimal solution. Therefore, CGA is one of the best candidates to solve optimization problems. So RPL-CGA is proposed in this paper to search for the optimal solution of routing metrics' weighting factors in composition metric to comprehensively evaluate candidate parents (neighbors) when selecting preferred parents. In this way, the best weighting factors allocation scheme can be obtained. Then among many candidate parents (neighbors), the optimal preferred parent (the next hop) can be selected and achieve significant improvement on network performance of LLNs in the aspect of average end-to-end delay, average success rate, etc.