## 4 Proposed ECC-GA-PASR Approach
### Genetic Algorithm (GA)-Based Optimized RSU Distribution
#### 4.1.2 Optimal RSU Distribution  
In an emergency situation, parameter-based RSU distribution helps to distribute the information to other SVs in a safe and secure manner. The best road segments are chosen using GA, and in those individual road segment, the requirements of the number of RSUs needed to ensure the multiple requirement criteria have to be concentrated. The parameters such as Rank of Service (RoS), end-to-end distance of the road segment as well as the recorded number of accidents are considered [36]. The optimal number of RSU distribution (RSUOD) based on RoS is calculated below. \[P_{1}=RSU_{OD}=\sum\
olimits_{r=1}^{n}RoS_{r}\;*\;\mu_{r}\;*\;B_{r} \tag{2}\]  
In Equation (2), \(n\) represents the road segments, \(r\) represents the current road segment, \(\mu_{r}\) represents the distance and accidents count in the road segment, \(B_{r}\) represents the binary value (0, 1) of \(r\)th road segment. Hence, there is a possibility to select or reject the road segment if \(B_{r}=1\), the corresponding \(r\)th road segment is taken, and if \(B_{r}=0\), the corresponding \(r\)th road segment is not taken. The Rank of Service (\(RoS\)) is defined as the circumstance of the road segments, which includes momentum, density, traffic load, convenience, and security. According to these parameters, the \(RoS\) is identified. We consider four rank stages with labels A-D; here, A refers to the top-ranking operation form; likewise, D is the worst. \(RoS\) calculation for all the ranks is tabulated in Table 4, which is explained in terms of network traffic and momentum. \(RoS\) is the core parameter that is used to understand the overall circumstance of the road segment. It is primarily considered for the decision making in the process of \(RSU\) distribution. Based on the labels, the necessity of \(RSU\) is decided. Only a minimum number of \(RSU\) is required in free-flow traffic and momentum where the traffic increases; then, automatically, the momentum is reduced in that circumstance maximum number of \(RSU\) is required. The mathematical expression for the calculation of \(ROS\) is given below. \[RoS=\frac{M}{1+x(\frac{c}{p})y} \tag{3}\]  
In Equation (3), \(M,\;c,\;and\;p\) indicate free flow momentum, capacity, and power of the road segment, and \(x\) and \(y\) are the values of the constants here \(x=0.25\) and \(y=5\). The second parameter which is considered for RSU distribution is optimal path election, which is conducted using GA. According to the calculation of the fitness function, the optimal path is found. The mathematical expression for the calculation fitness function is given below. \[P_{2}=Fit_{Function}=XC_{p}+\frac{Y}{L_{n}} \tag{4}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Type** & **A** & **B** & **C** & **D** \\ \hline Momentum & 0.0 to 0.3 & 0.3 to 0.6 & 0.06 to 0.09 & 0.09 to \textless{}1.0 \\ Traffic & 900 & 1350 & 2000 & 2300 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Rank of Service calculation based on Labels. In Equation (4), \(C_{p}\) indicates the present connect probability, \(L_{n}\) indicates the latency of the present individual, and the terms \(X\) and \(Y\) are the weighted parameters with 0 and 1 correspondingly. The third parameter that is considered for RSU distribution is the cost of the installation, which is mainly based on the road segments. This is calculated according to the length, position, and other road activities of the road segment. According to the need, the RSU count in that particular location is decided. The mathematical expression for the calculation cost of installation is given below. \[P_{3}=I_{cost}=\sum_{r=1}^{n}N_{r}\;*\;I_{r} \tag{5}\]  
In Equation (5), \(n\) represents the road segments, \(r\) represents the current road segment, \(N_{r}\) represents the number of RSU in the current road segment \(r\), \(I_{r}\) and represents the installation cost of the current road segment \(r\). By considering all these parameters, the final RSU distribution is conducted by calculating the minimizing function.