# An Improved Spider Wasp Optimizer for Green Vehicle Route Planning in Flower Collection
## 3 Problem Analysis and Mathematical Model
### Costs Variables Analysis
#### 3.3.3 Transportation Costs  
Transportation costs refer to the fuel consumption incurred by the engine while the vehicle is driving. To analyze fuel consumption during vehicle operation, the load estimation method is used to calculate fuel usage while driving [24]. The total engine fuel consumption during the vehicle's flower collection process can be calculated using Equation (4). \[F_{tra}=\sum_{k\in K}\sum_{e_{ij}\in A}y_{e_{ij}}^{k}d_{ij}\bigg{(}Q_{i}^{k} \frac{F_{\text{max}}-F_{\text{min}}}{Q_{max}}+F_{\text{min}}\bigg{)} \tag{4}\]  
Therefore, the total transportation costs can be calculated using Equation (5). \[c_{3}=\varphi_{3}F_{tra} \tag{5}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Symbols** & **Meaning** \\ \hline \(e_{ij}\) & If there is an edge between customer \(i\) and customer \(j\), then \(e_{ij}=1\); \\  & otherwise \(e_{ij}=0\) \\ \(z^{k}\) & When vehicle \(k\) is used, \(z^{k}=1\); otherwise \(z^{k}=0\) \\ \(x_{j}^{k}\) & when customer \(i\) is served by vehicle \(k\), \(x_{i}^{k}=1\); otherwise \(x_{i}^{k}=0\) \\ \(y_{e_{ij}}^{k}\) & When vehicle \(k\) is driving side \(e_{ij}\), \(y_{e_{ij}}^{k}=1\); otherwise \(y_{e_{ij}}^{k}=0\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Decision variables table. 3.3.4. Costs of Carbon Emissions Associated with Flower Collection  
CO\({}_{2}\) is produced both when the refrigeration system consumes fuel to maintain low temperatures and when the vehicle is in motion. Therefore, the total carbon emission costs can be calculated using Equation (6). \[c_{4}=\varphi_{4}q_{CO_{2}}(F_{re}+F_{tra}) \tag{6}\]  
3.3.5. Costs of Flower Damage  
During the flower collection process, opening the vehicle door causes a rise in temperature due to air convection, which exacerbates damage to the flowers. Therefore, the damage coefficient for flowers differs when the vehicle is in motion or waiting to serve a customer with the doors closed compared to when the doors are open during the flower collection process. It is assumed that the flower damage coefficient when the refrigerated vehicle's door is closed is smaller than when the door is open, with \(\eta_{1}<\eta_{2}\). Vehicle \(k\) travels from customer \(i\) to customer \(j\), and before it begins serving customer \(j\), the duration for which the door remains closed is given by \(t^{k}_{ij_{close}}=t^{k}_{ij}+w^{k}_{i}\). The costs of flower damage can be calculated using Equation (7). \[c_{5}=\varphi_{5}\sum_{k\in K}\sum_{i\in N}x^{k}_{i}\bigg{[}Q^{k}_{i}\bigg{(}1 -e^{-\eta_{i}t^{k}_{ij_{close}}}\bigg{)}\,+\,\Big{(}Q^{k}_{i}+q_{j}\bigg{)} \bigg{(}1-e^{-\eta_{i}g^{k}_{i}}\bigg{)}\bigg{]} \tag{7}\]  
3.3.6. Time Penalty Costs  
To address solutions generated during the search process that violate time window constraints, the model introduces time penalty costs to improve solution quality through a penalty mechanism. If the vehicle arrives before the earliest time window, it incurs a penalty due to the required waiting time; if the vehicle arrives after the latest time window, it also incurs a penalty. The time penalty costs can be calculated using Equation (8). \[c_{6}= \begin{cases}\sum_{k\in K}\sum_{i\in N}\varphi_{6}\max(es_{i}-g^{k}_{i },0),g^{k}_{i}<es_{i}\\ 0,es_{i}\leq g^{k}_{i}\leq ls_{i}\\ \sum_{k\in K}\sum_{i\in N}\varphi_{7}\max(g^{k}_{i}-ls_{i},0),g^{k}_{i}>ls_{i} \end{cases}  \tag{8}\]  
3.4. Mathematical Model  
Based on the analysis above, the flower collection vehicle routing model, with the objective of minimizing the total cost, can be expressed as follows:  
\[\min C_{total}=c_{1}+c_{2}+c_{3}+c_{4}+c_{5}+c_{6}\] (9) s.t.