# Multi-Path Data Distribution Mechanism Based on RPL for Energy Consumption and Time Delay
## 3 Adaptive Multipath Traffic Loading Based on RPL, AMTL-RPL
### Multi-Path Traffic Distributions  
According to RPL, nodes will separate traffic on every path available to guarantee that the lifetime of each bottleneck node is balanced. To maximize the network lifetime, we considered using a plain linear program to assign weights to each parent node to obtain the optimal solution. However, this is apparently not suitable for sensor nodes that are limited in both storage and calculation resources.  
This paper proposes a quick algorithm based on the metric mentioned above. Firstly, we convert metric ED to an objective function (ED = f(\(a_{x1,c1}\), \(a_{x2,c2}\),... )) about \(a_{x,c}\), depending on correlative mathematical knowledge, where \(c_{i}\) belongs to the bottleneck node set, and \(x_{i}\) belongs to the descendants of \(c_{i}\). The function is of the two order continuous differentiable function, which can be solved by linear programming. Then, we combine [PERSON]'s as well as the steepest descent method to propose one modified algorithm. This method was able to find one of the best group weights to send traffic by an iteration test. At the same time, it can realize convergence as soon as possible and has quite good stability and requires little calculation. Algorithm 2 provides its formal description: the nodes decide whether it receives a proper answer (Line1), if not, it is judged as to whether or not an accurate search can be performed (Line 2). If it can, the direction would be \(-\frac{\
abla f(x_{k})}{\
abla^{2}f(x_{k})}\) (Line 3). If it can not, it uses a negative gradient search direction \(-\
abla f(x_{k})\) (Line 5). Then, the step length is adjusted (Line 7), acting on iteration (Line 8), until we get the optimum solution.  
```
Input: Object function \(f(a_{x,b_{1}},a_{b,c_{2}},\cdots)\) Output:\(\langle a_{b,c_{1}},a_{b,c_{2}},\cdots\rangle\) for energy balance Initialization\(\delta>0\), \(a_{b,c}\) = random [0, 1] and \(\sum_{c\in bmk(b)}a_{b,c}=1\), \(x_{0}=\langle a_{b,c_{1}},a_{b,c_{2}},\cdots\rangle\), \(k=0\)
1. \(\textbf{for}||\
abla f(x_{k})||>\delta\)
2. if\(\frac{\
abla f(x_{k})^{\top}\cdot\
abla f(x_{k})}{\
abla^{2}f(x_{k})}>0\)then
3. \(d_{k}=-\frac{\
abla f(x_{k})}{\
abla^{2}f(x_{k})}\)
4. else
5. \(d_{k}=-\
abla f(x_{k})\)
6. end
7. \(\lambda_{k}=-\frac{-\
abla f(x_{k})^{\top}d_{k}}{4^{\top}\cdot\
abla^{2}f(x_{k })\cdot 4^{\top}}\);
8. \(x_{k+1}=x_{k}+\lambda_{k}\cdot d_{k}\)
9. \(k=k+1\);
10. end
11. Return\(x_{k}\)
```  
**Algorithm 2** Energy balance based on a multi-path  
The advantage of the algorithm is that the iterative step-size adjustment uses the precision searching method to minimize the quadratic function. The convergence rate is linear and can be guaranteed every time. When the maximum eigenvalue and the minimum eigenvalue of the Hessian matrix are close to each other, the descending velocity is the fastest. Particularly, when they are equal to each other, we obtain the optimum solution through only one iteration. Furthermore, the number of bottleneck nodes changes with the network. When the number of bottlenecks increases, the energy consumption of \(x\) increases. At this time, we can use the quasi-Newton's method to reduce the amount of calculation for the Hessian matrix, namely,  
\[\
abla^{2}f(x_{k+1})=\
abla^{2}f(x_{k})+\frac{s_{k}(s_{k})^{\top}}{(s_{k})^{ \top}y_{k}}\bigg{[}1+\frac{(y_{k})^{\top}\cdot\
abla^{2}f(x_{k})\cdot y_{k}}{ (s_{k})^{\top}y_{k}}\bigg{]}-\frac{1}{(s_{k})^{\top}y_{k}}\Big{[}s_{k}(y_{k})^{ \top}+(s_{k})^{\top}y_{k}\Big{]}\cdot\
abla^{2}f(x_{k}) \tag{11}\]  
where \(s_{k}=x_{k+1}-x_{k}\), \(y_{k}=\
abla f(x_{k+1})-\
abla f(x_{k})\).