# TACRP: Traffic-Aware Clustering-Based Routing Protocol for Vehicular Ad-Hoc Networks
## 4 Traffic-Aware Clustering-Based Routing Protocol (TACRP)
### Cluster Head (CH) Selection  
Clusters are structured according to the vehicle's location, direction, speed, priority, and energy. Each cluster embraces one special quality of the CH selection. The CH intends to maintain the interest of the vehicles in the respective cluster. If the CH receives any  
Figure 2: TACRP Network Architecture.  
message, it checks the willingness of the vehicle to receive the message. If the vehicle is not willing to receive the message, then it is transmitted to the RSU. To enhance the process of CH selection, weight-based clustering is initiated, and, thereby, every vehicle measures its weight. The vehicle with maximum weight has the highest priority to become a CH. The sequential process for the selection of CH is given below. The final parameters which are elected for the process of CH selection are distance, residual energy, and threshold energy. The mathematical expression for the selection of CH according to the weights is shown below:  
\[CH_{w}=w_{1}\big{(}D_{Average}\big{)}+w_{2}(R_{Energy})+w_{3}\big{(}T_{Energy }^{(A,B)}\big{)} \tag{1}\]  
where, \(w_{1},~{}w_{2}\) and \(w_{3}\) is the weighting factor for the clustering process which satisfies the condition, \(\sum_{i=1}^{3}w_{i}=1\), \(D_{Average}\) is the distance between vehicles A to B, \(R_{Energy}\) is the residual energy of vehicle A and \(T_{Energy}^{(A,B)}\) is the threshold energy of the vehicles A and B.  
Distance Calculation: The average distance between vehicles A and B is computed based on the mathematical expression shown below [31]:  
\[D_{Average}=\frac{\sum_{n=1}^{B}\sqrt{(X_{B}-X_{A})^{2}+(Y_{B}-Y_{A})^{2}}}{N} \tag{2}\]  
where \((X_{A},Y_{A}),~{}(X_{B},Y_{B})\) represents the relative position of vehicles A and B, \(n\) represents the average vehicle in the path and \(N\) represents the neighbor count at each time instance.  
Residual Energy Calculation: The residual energy of the vehicle is measured according to the distance, which is based on the position of the vehicle and speed. The mathematical expression is shown below:  
\[R_{Energy}=\frac{\sqrt{(X_{B}-X_{A})^{2}+(Y_{B}-Y_{A})^{2}}}{V_{A}} \tag{3}\]  
where, the residual energy vehicle A is calculated and \(V_{A}\) is represented as the directional edge of the segment.  
Threshold Energy Calculation: The mathematical expression for the calculation of threshold energy is given below:  
\[T_{Energy}^{(A,B)}=\big{(}E_{elec}+E_{comp}\big{)}\big{(}\frac{n_{active}}{K_{ opt}}\big{)} \tag{4}\]  
where, \(E_{elec}\) and \(E_{comp}\) indicate the calculation of energy consumption during the process of transmission and data aggregation, \(N_{active}\) indicates the active vehicle in the path and \(K_{opt}\) represents the optimum number of clusters and is expressed as below:  
\[K_{opt}=\sqrt{\frac{n_{active}}{2\pi}}\sqrt{\frac{\varepsilon_{fs}}{\varepsilon _{mp}}}(\frac{C_{Area}}{D_{Average}}). \tag{5}\]  
where, \(\varepsilon_{fs}\) and \(\varepsilon_{mp}\) indicates the parameter used to illustrate the energy consumption in multi path network, \(C_{Area}\) indicates the coverage area of the sensing region and \(D_{Average}\) indicates the average distance among vehicles A and B. These are all the major parameters that which are considered for the selection of CH.