# A Power Planning Algorithm Based on RPL for AMI Wireless Sensor Networks
## 4 DODAG-Oriented Power Planning Algorithm
Instead, it computes the hypothetical rank that node \(n\) would have only considering the parent \(i\). The main procedure of the power planning strategy is defined in BuilDODAG (Algorithm 1). The procedure is executed until all nodes are connected to the DODAG (\(\mathbf{U}=\varnothing\)). The principle of the power planning algorithm consists of connecting the nodes to the DODAG in successive layers, which move radially away from the root at each round. The nodes in a layer closer to the root (inner layer) act as potential parents for nodes of the adjacent layer further from the root (outer layer). However, the order in which nodes are connected to DODAG is not only dependent on the Euclidean distance with respect to the root. The nodes of an inner layer may be poorly distributed around root, concentrated in a single region, and may not provide connectivity for the nodes of the adjacent outer layer. As a consequence, nodes further from the root, but closer to the nodes already connected, would be connected first. This effect is not desirable because the rank of the nodes would not represent its distance with respect to the root, resulting in a bad DODAG. To minimize the possibility of occurrence of this effect, an initial set of nodes, connected directly to the root must be selected to provide connectivity in all directions around the root. This initial set of nodes is computed by the InitDODAG procedure (Algorithm 2). This procedure selects at most \(n\) nodes that can connect directly to the sink (the set \(\mathbf{A}\)), following a geometric approach that selects nodes in all directions around the root. As explained later in this section, the value of \(n\) is dependent on the geometric distribution of the nodes and is determined by an optimization procedure. After initialization, the algorithm tries to connect one node at a time, by adjusting the power of the node and of its parents, if necessary. The node nearest to the root still not connected to the DODAG is evaluated first. If a suitable set of parents in \(\mathbf{C}\) cannot be found, the node may jump to the next round. The jump procedure increases the possibility to select parents for the node because the \begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Meaning** \\ \hline _root_ & DODAG root \\
**C** & set of nodes connected to the DODAG \\
**U** & set of nodes not connected to the DODAG \\
**W** & discrete powers that can be assigned to the radio \\ \(w_{i}\) & current power of node \(i\) \\ \(k\) & scalar that controls the desired number of parents \\ \(r_{i}\) & current rank of node \(i\) \\ \(etx_{n,i}\) & ETX of the link between \(n\) and \(i\) \\ \(m\) & ETX multiplier \\ \(d_{\tilde{w}}^{Q}\) & maximum link length with power \(w\) and \(ETX\leq Q\) \\ \(h\) & minimum hop rank increase \\ \(\alpha\) & maximum allowable number of jumps \\
**J** & set of nodes that jumped in the iteration \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Symbols definition. number of nodes in **C** may be higher. The maximum number of jumps that a node may perform is controlled by \(\alpha\).