## 3 Proposed Method
### Hybrid Protocol-Based Path Selection
In the tuning-based forwarder selection approach, each node \(N_{i}\) with high-priority data packets (\(H_{p}\)) to send makes its forwarder choice based on the priority of these packets in its transmission queue. We devised a cost function that takes both delay and stability into account. Let \(Nf_{i,j}\) represent the cost of selecting downstream \(N_{j}\) as the forwarder from the perspective of \(N_{i}\). To give relative importance to these metrics, we assign two weights, \(\alpha\) and \(\beta\), respectively. The cost function is calculated as follows:  
Figure 2:7  
Figure 2:8  
When \(N_{i}\) intends to transmit a packet, it seeks to minimize delay. Therefore, it calculates the cost value \(Nf_{i,j}\) for each \(N_{i}\in Nl_{i}\), as specified in Equation (18), by assigning a higher weight to delay. The node selects the forwarder with the lowest cost as the optimal choice. Conversely, if the node holds a low priority (\(L_{p}\)) packet in its buffer, it prioritizes a stable forwarder to relay the data and reduce routing overhead. In this case, it increases the weight associated with stability in the cost function in Equation (18) and selects the CR with the minimum cost as the forwarding node. For instance, we can set \(\alpha=0.4\) and \(\beta=0.6\) for \(L_{p}\) data. The tuning-based forwarder selection, based on the packet type in the transmission queue, is presented in Algorithm 1. ```
Input: List of requesting nodes (\(N_{i}\)), forwarder list \(Nl_{i}\), \(\forall\)\(i\in M\) Output: Forwarder of \(N_{i}\)
1: Find \(Nl_{i}\), for each i \(\in\) M
2: Calculate delay \(D_{j}\), for each \(N_{j}\in Nl_{i}\)
3: Calculate stability \(s_{i,j}\), for each \(N_{j}\in Nl_{i}\)
4:if (\(N_{i}\) has \(H_{p}\) packets to send) then
5: {
```  
**Algorithm 1**Best forwarder selection algorithm ```
1:for every j \(\in Nl_{i}\), compute \(Nf_{i,j}\) by providing high weight  to \(\alpha\) and \(\beta\)
2:forwarder \((N_{i})=\min_{j\in N_{i}}\left(Nf_{i,j}\right)\)
3:}
4:end if
5:if (\(N_{i}\) has \(L_{p}\) packets to send) then
6:\(\{\)
7:for each j \(\in Nl_{i}\), compute \(Nf_{i,j}\) by providing a higher weight to \(\beta\) than \(\alpha\)
8:forwarder \((N_{i})=\min_{j\in N_{i}}\left(Nf_{i,j}\right)\)
9:}
10:endif
```

**Algorithm 1**_Cont._

## 5 Improved firefly optimization (IFO) algorithm. The improved firefly optimization algorithm operates under the premise that all fireflies are unisex and attract each other. Attractiveness depends on the brightness and distance between the fireflies. Brightness is directly proportional to attractiveness, while distance has an inverse proportionality. Therefore, one firefly moves toward another based on the strength of attraction between them. To facilitate optimization, there is a specific entry for the objective function in a sorted list. The primary objective is to maximize this objective function value. In the context of this algorithm, the objective function value is computed at each vehicle node, serving as a measure of the quality of a given solution. This objective function value guides the movement of the fireflies as they attempt to improve their solutions by gravitating toward brighter, more attractive fireflies, while taking into account the distance between them. This process continues iteratively, and the algorithm aims to converge toward a solution that maximizes the objective function value, thereby optimizing the desired transmission. Figure 2:9

where \(\alpha\) illustrates the brightness, \(\beta\) is referred to as delay, and \(\alpha_{0}\) denotes the initial value. So, the improved objective function (the movement of the \(x\)th node to another node \(y\)th) is defined in Equation (21), as follows:

Figure 3.0

where

Figure 3.1

\(\mathrm{d}=\mathrm{density}\), \(\mu_{f}\) denotes free flow speed, \(\mu_{j}\) denotes traffic density associated with completely blocked traffic, and \(\left|A_{x}-A_{y}\right|\) denotes the cartesian distance between the \(x\)th and \(y\)th node.