# A Novel RPL Algorithm Based on Chaotic Genetic Algorithm
## 3 RPL-Cga
### Proposing Composition Metric and Objective Function  
As shown in Equation (6), the abovementioned five representative routing metrics can be united to create a composition metric (CM) in an additive way. \(a_{1}\), \(a_{2}\), \(a_{3}\), \(a_{4}\), \(a_{5}\) are weighting factors to adjust the impact of each routing metric. \(n\) indicates the number of candidate parents. \[F(i)_{CM}=\sum\limits_{j=1}^{5}a_{j}g_{j}(i),\ (i=1,2,\cdots,n) \tag{6}\] \[s.t.\left\{ \begin{array}{l}\sum\limits_{j=1}^{5}a_{j}=1\\ 0\leq a_{j}\leq 1\end{array} \right.\]  
The newly-proposed composition metric also meets monotonicity and isotonicity. The proof is as follows:  
First, suppose there exists three paths \(P_{1}=P(v_{s},v_{d})\)=\((v_{s},v_{s+1},v_{s+2},\cdots,v_{d})\), \(P_{2}=P(v^{\prime},v^{\prime}_{s},v^{\prime}_{d})\)=\((v^{\prime}_{s},\)\(v^{\prime}_{s+1},v^{\prime}_{s+2},\cdots,v^{\prime}_{d})\), \(P_{3}\)=\(P(v^{\prime\prime},v^{\prime\prime}_{s},v^{\prime\prime}_{d})\)=\((v^{\prime\prime},v^{\prime\prime}_{s+1},v^{\prime\prime}_{s+2},\cdots,v^{ \prime\prime}_{d})\). Then, the composition metric values of these three paths are as follows:  
\[F(P_{1})_{CM}=F((v_{s},v_{s+1})_{CM}\oplus(v_{s+1},v_{s+2})_{CM}\oplus\cdots \oplus(v_{d-1},v_{d}))_{CM}=F(v_{s})_{CM}+F(v_{s+1})_{CM}+\cdots+F(v_{d})_{CM}\geq 0\]  
\(F(P_{2})_{CM}=F((v^{\prime},v^{\prime}_{s+1})_{CM}\oplus(v^{\prime}_{s+1},v^{ \prime}_{s+2})_{CM}\oplus\cdots\oplus(v^{\prime}_{d-1},v^{\prime}_{d}))_{CM}=F( v^{\prime}_{s})_{CM}+F(v^{\prime\prime}_{s+1})_{CM}+\cdots+F(v^{\prime})_{CM}\geq 0\)  
\(F(P_{1})_{CM}=F((v^{\prime\prime},v^{\prime\prime}_{s+1})_{CM}\oplus(v^{ \prime\prime}_{s+1},v^{\prime\prime}_{s+2})_{CM}\oplus\cdots\oplus(v^{\prime \prime}_{d-1},v^{\prime\prime}_{d}))_{CM}=F(v^{\prime\prime}_{s})_{CM}+F(v^{ \prime\prime}_{s+1})_{CM}+\cdots+F(v^{\prime\prime}_{d})_{CM}\geq 0\)  
(1) Monotonicity  
The composition metric value of every path or link is always greater than or equal to 0; therefore, regardless of being prefixed or suffixed by another link or path such as \(P_{3}\), \(F(P_{1})_{CM}\leq F(P_{1})_{CM}+F(P_{3})_{CM}\) can easily be proven, so the newly-proposed composition metric meets monotonicity. (2) Isotonicity  
The composition metric value of every path or link is always greater than or equal to 0. If \(F(P_{1})_{CM}\leq F(P_{2})_{CM}\), then, regardless of being prefixed or suffixed by another link or path such as \(P_{3}\), \(F(P_{1})_{CM}+F(P_{3})_{CM}\leq F(P_{2})_{CM}+F(P_{3})_{CM}\) can easily be proven, so the newly-proposed composition metric meets isotonicity. Therefore, the newly-proposed composition metric meets monotonicity and isotonicity. As shown in Equation (7), the newly-proposed RPL-CGA objective function can be defined as the minimum function of the proposed composition metric. \[ \begin{split}& OF_{RPL-CGA}=\text{min}F(i)_{CM}=\text{min}\ (\sum\limits_{j=1}^{5}a_{j}g_{j}(i)),\ (i=1,2,\cdots,n)\\ & s.t.\left\{\begin{array}{l}\sum\limits_{j=1}^{5}a_{j}=1\\ 0\leq a_{j}\leq 1\end{array}\right.\\ \end{split}  \tag{7}\]  
Meanwhile, it can be seen that each weighting factor determines the importance of the corresponding routing metric in the composition metric, which, in turn, affects the choice of preferred parents. Therefore, the optimization of routing metrics weighting factors becomes a crucial issue. However, the existing improvements of RPL in an additive manner determine the weighting factors of routing metrics according to experts' personal experiences. It is too subjective and inefficient, and cannot alter weighting factors in a timely manner according to the changes of the network to satisfy the QoS requirements well. To address these problems, RPL-CGA uses a chaotic genetic algorithm [23; 24] to optimize the weighting factors of routing metrics in the composition metric to evaluate candidate parents comprehensively when selecting preferred parents.