# CoAR: Congestion-Aware Routing Protocol for Low Power and Lossy Networks for IoT Applications
## 4 Proposed Congestion-Aware RPL
### Congestion-Aware Objective Function (CoA-OF)
These weights estimates are of relative importance for criteria. \[w_{j}=\frac{\sigma_{j}}{\sum\limits_{n=1}^{3}\sigma_{n}} \tag{9}\]  
where, \(\sigma_{j}\) is the standard deviation of the values of \(r_{j}\) determined as in Equation (10) and the mean is determined as in Equation (11). \[\sigma_{j}=\sqrt{\frac{1}{m}\sum\limits_{i=1}^{m}\left(x_{ij}-\overline{x}_{j }\right)^{2}} \tag{10}\]  
\[\overline{x}_{j}=\frac{1}{m}\sum\limits_{i=1}^{m}x_{ij} \tag{11}\]  
For all \(j=1\), \(2\), \(3\), the weights \(w_{1}\), \(w_{2}\) and \(w_{3}\) represent the importance of \(QU\), \(ETX\) and \(RE\) respectively. **Step 3. **: Determine the positive and negative ideal solutions: the positive ideal value set \(A^{+}\) determines the best alternative whereas negative ideal value set \(A^{-}\) determines the opposite as in Equations (12) and (13), respectively. These vectors are computed by using the following two relations. \[A^{+}=\left\{v_{1}^{+},v_{2}^{+},\ldots,v_{n}^{+}\right\}=\left\{\left(\max \limits_{\forall i}v_{ij},j\in J^{\prime}\right)\left(\min\limits_  
The positive ideal solution maximizes the benefit criteria and minimizes the cost criteria whereas the negative ideal solution maximizes the cost criteria and minimizes the benefit criteria. In our proposal, routing metrics \(QU\) and \(ETX\) are cost criteria (the smaller the value, the better the option), whereas \(RE\) is the benefit criteria.  
**Step 4.**: Now, calculate the separation measures: the separation measures of each alternative (parent) from the positive ideal solution is given as in Equation (14).  
\[D_{i}^{+}=\sqrt{\sum_{j=1}^{n}\Bigl{(}v_{ij}-v_{j}^{+}\Bigr{)}^{2}},\ i=1,2,\ \ldots,\ m \tag{14}\]  
The separation of each alternative from the negative ideal solution is given as in Equation (15). \[D_{i}^{-}=\sqrt{\sum_{j=1}^{n}\Bigl{(}v_{ij}-v_{j}^{-}\Bigr{)}^{2}},\ i=1,2, \ldots,\ m \tag{15}\]
**Step 5. **: Calculation of the relative closeness to the positive ideal solution: the relative closeness of the alternative \(p_{i}\) can be expressed as in Equation (16). \[C_{i}=\frac{D_{i}^{-}}{D_{i}^{+}+D_{i}^{-}},\ i=1,2,\ldots,\ m \tag{16}\]  
where, \(C_{i}\) is the value of interval [0, 1], the closer the value is to 1 the higher the priority of the \(i^{th}\) alternative. Here, we grade the best alternatives (parents) according to the \(C_{i}\) value. The highest grade represents the best rank which is equivalent to the RPL objective function rank. Using TOPSIS to select the preferred parent in each node is considered as an appropriate method since the computation is straightforward and the complexity of this method is an \(O(m\times n)\). Here, \(m\) represents the number of neighbors of each nodes and \(n\) represents the number of metrics (\(n=3\)). In the same way, calculation complexity is linear and compatible with \(m\) and \(n\). Hence, the calculations are simple and the costs are not high. As a result, there will be no problem with resource constrained devices. It is worth mentioning that the complexity of other protocols relies on the number of metrics comprised. Finally, we compute the routing score of alternative parents as in Equation (17). \[\eta(i)=C_{i}\times\phi \tag{17}\]  
where, \(\eta(i)\) is the routing score and used to make the decision in parent selection, and \(\phi\) is a positive integer (e.g., 10 or 100). For our experiments, we have used 10. This score can lead to a better decision in the network within congestion.