## 2 Materials and Methods
### \(p\)-WOA Probabilistic Modelling  
To obtain the most up-to-date location of the vehicle, a probabilistic model was incorporated by adjusting the cross-over probability to increase the efficacy and population coverage of the suggested strategy. For more information on the crossover procedure, see Equation (8):  
\[\mathrm{P_{n}^{m}}\left(\mathrm{t}+1\right)=\left\{\overset{\mathrm{P_{n}^{m}} }{\mathrm{P_{n}^{m}}}\left(\mathrm{t}\right)\text{ if b}<\mathrm{cp}\right. \tag{8}\]  
In this equation, \(\mathrm{P_{n}^{m}}\) represents the mth reading taken from the current nth agent, b represents the random nodes or search vehicles in the population, and cp is the crossover probability used to determine the algorithm's running duration and convergence factor.  
The method will take longer to run, converge more quickly, and have a lower population range if cp is made smaller. The formula for determining cp's value is:  
\[\text{cp = c + (0.5- c)\_sin\left(\text{t}\cdot\frac{\pi}{2}.\text{tmax}\right)} \tag{9}\]  
In this expression, tmax is the maximum number of iterations allowed, and [0, 0.5] is the range of values for the constant c that is used to regulate the fluctuations of the parameter cp. By adjusting cp as given in Equation (9), we may enhance diversity and accuracy in vehicle location estimates.  
Self-adaptive weights have been assigned in the planned p-WOA to ensure that no vehicle can get lost. As demonstrated in Equation (10), where tmax is the maximum number of cycles permitted, we choose an adaptive probability 'ap' such that every automobile is linked to the best automobile found so far:  
\[\text{ap}=1.2-0.9.\cos(\text{t}.\pi/\text{tmax}) \tag{10}\]  
Algorithm 1 displays the generated mathematical model's pseudocode:  
```
1. Initialization of vehicles' positions and velocity randomly on a freeway by creating a mesh between vehicles. All vehicles in the above mesh should have the same values for their search agents.
2. Determine the separation between a vehicle and others,
3. **WHILE** (Iteration == Iterations \(\leq\) 350) or Convergence Factor = 0.001 **do**
4. **FOR** Nodes = 1 to 100 do**
5. Nodes for clustering = {All Nodes}
6. **WHILE** (Nodes for clustering! =empty) do
7. Calculate the likelihood of each node's selection
8. CH = Roulette Wheel selection [All nodes for clustering are possible]
9. Node. tour. append (CH) (Equation (1))
10. Neighbors of CH = find Neighbors (CH)
11. (Nodes for clustering) = (Nodes for clustering) -CH
12. (Nodes for clustering) = (Nodes for clustering) - Neighbors of CH
13. **END WHILE**
14. Nodes:cost = evaluation (Nodei.tour)
15. IF (Nodesi.cost < Best Node.cost)
16. Best Node = Nodei
17. Nodei++
18. **END FOR**
19. **FOR** Nodei = 1 to Population size **do**
20. Update Search (Nodei.tour, Nodei.cost)
21. **IF** (Best Node.cost == Last iteration Best.Node.cost) **do**
22. Calculate PDR for each node;
23. Calculate Latency between nodes;
24. Calculate the Average Throughput of the medium;
25. Stall Iteration ++;
26. **ELSE**
27. Stall Iteration = 0;
28. **END IF**
29. Iteration++;
30. **END WHILE**
31. Output: CHs = Best Node.tour;
```  
**Algorithm 1** Pseudocode of p-WOA  
The p-WOA kicks off with some made-up configurations. Every cycle, the cars improve their standing with either a predetermined vehicle or the best possible configuration found using a probabilistic method. Providing individual cluster head searching and identification necessitates lowering the \"a\" value from 2 to 0. When \(\mid\)A\(\mid\) > 1, the probability work chooses the most erratic vehicle, and when \(\mid\)A\(\mid\) < 1, the best configuration for the rearrangement of the vehicles is chosen. p-WOA may exhibit either a spiral or circular motion, as determined using the value of p.  
Simulation parameters are presented in Table 1.