## 4 Privacy-Preserving Optimization Based on Advanced CH Selection (P2O-ACH)
### Enhanced ROA-Based CH Selection  
In general, the ROA algorithm is used to solve complicated optimization issues. So, it is essential to improve the algorithm when it is applied to the dynamically varying VANETs. To improve the performance further, a trusted ROA is introduced. In general, ROA consist of four patterns, such as bypass, follower, overtaker, and attacker, which are chosen randomly to obtain the solution. Here, the pattern consists of an order to obtain better performance. Simultaneously, to protect the network from route request flooding, the selected patterns have to be encoded properly. Now, the patterns are processed in the order that is represented as \(CH_{by},CH_{fr},CH_{ot},CH_{at}\). Only this sequence will be repeated again and again. If any order changes occur, then we can identify if route request flooding happens. So, detection and prevention of route request flooding are essential to finding the shortest path. To protect the network from this, an express trust model is initiated. The parameter which is considered for the express trust model is the rate of packet delivered, rate of packet loss, average latency, average energy, and integrity. The calculation of these parameters is given below. Rate of packet delivered: Delivered packet rate is defined as the ratio of the total number of packets transmitted from the sender \(\mathit{TP}_{S}(t)\) to the total number of packets accepted by the receiver \(\mathit{AP}_{r}(t)\). The computation of delivered packets is given below. \[\mathit{DP}_{rate}(t)=\frac{\mathit{TP}_{S}(t)}{\mathit{AP}_{r}(t)}\times 100 \tag{16}\]  
Rate of packet loss: Loss of packet rate is defined as the ratio of the total number of packets accepted by the receiver to the total number of packets transmitted by the sender. The computation of packet loss is given below. \[\mathit{LP}_{rate}(t)=\frac{\mathit{AP}_{S}(t)}{\mathit{TP}_{r}(t)}\times 100 \tag{17}\]  
Average latency: Average latency is defined as the delay in time taken during the process of communication from the sender to the target. The latency can occur during route finding and request flooding. The computation of average latency is given below. \[\mathit{L}_{average}=\frac{\sum_{i=1}^{N}(\mathit{PT}_{i}(time)-\mathit{PA}_{ i}(time))}{\mathit{TP}_{S}(t)} \tag{18}\]  
where, \(\mathit{PT}_{i}(time)\) represents the packets transmitted time to the receiver and \(\mathit{PA}_{i}(time)\) represents the packets allocated time by the sender to reach the receiver. Average energy: The average energy remaining in the CH after the process of energy indulgence is computed below. \[\mathit{E}_{average}=\frac{\sum_{j=1}^{\mathit{CH}^{*}}\mathit{RE}_{j}^{CH}- \mathit{CE}_{j}^{CH}}{\mathit{IE}_{j}^{CH}} \tag{19}\]  
where, \(\mathit{RE}_{j}^{CH}\) represents the residual energy of \(\mathit{CH}_{j}\) and \(\mathit{CE}_{j}^{CH}\) represents the consumed energy of \(\mathit{CH}_{j}\). Integrity calculation: It is the final trust measure to improve trustworthiness. The trust values of CH and the CM are determined using the history that considers the normal joining, abnormal joining, normal leaving, and abnormal leaving of the neighbors, as well as the multiple distributions. Integrity is calculated according to the successful and unsuccessful transmission. \[\mathit{I}_{CH-CM}(t)=\frac{1}{r}\;\frac{S_{CH-CM}(t)}{S_{CH-CM}(t)+\mathit{ US}_{CH-CM}(t)} \tag{20}\]  
where, \(r\) represents the node's overall neighbors, \(S_{CH-CM}(t)\) represents the successful transmission, and \(\mathit{US}_{CH-CM}(t)\) represents the unsuccessful transmission. These are the parameters calculated to protect the network from the route request flooding attack using an express trust-based ROA optimization approach. The process of ROA-based CH selection is described in a pseudo code in Algorithm 1.