## 5 A Case Study
### Results and Validation  
In this section, the problem discussed in the previous section is solved. For this case study, we consider a set of problems, each with a fleet of 500 vehicles. Problems are generated randomly; for instance, both the arrival and departure times of these vehicles are chosen randomly, without any constraints imposed on the duration of each vehicle's stay. The energy level of vehicles upon arrival is determined randomly and takes a value between 0 and 1, while three distinct pricing levels for energy are considered, these being 0.8 units per battery for the cheap value, 1 for the average price and 1.2 for the expensive one. Moreover, whether the electricity price is considered high, low, or average is also determined randomly, and changes every 4 h. The first scenario incorporates all constraints and definitions previously presented, and the proposed heuristic is used to solve it. In Figure 5, the evolution of the battery level of a vehicle caused by the decision-making of the heuristic can be observed. Conversely, in the second scenario, vehicles are only charged the hour before leaving, regardless of the electricity price. Figure 6 shows the dispersion of the solutions for both scenarios. The \(y\)-axis represents the total cost, where 1 is the cost of charging a battery of an EV at an average price. To compare the variances of the two scenarios, an analysis of variance (ANOVA) technique is applied to determine whether the means of the two samples are significantly different [41]. According to the test results (\(p\)-value < 0.0001), it can be concluded that there are significant differences between the scenarios' means in terms of the objective function values. Consequently, the null hypothesis is rejected, which assumes equal means for both populations. In addition, the two populations satisfy the normality assumption. However, upon conducting a homoscedasticity test, it is revealed that the constancy in the variances is not met (\(p\)-value < 0.0001). Finally, following the non-parametric nature of our data, a signed-rank Wilcoxon test is performed to compare the medians of the two populations [42]. The obtained \(p\)-value is significantly below the threshold of \(\alpha=0.01\), leading us to reject the null hypothesis, suggesting a substantial difference in median performance metrics between the two scenarios. These findings  
The \(y\)-axis of Figure 6 represents the total cost when using each of the two algorithms described earlier. The results demonstrate that the heuristic model significantly reduces costs compared to the passive approach. On average, the mean cost of the solved problems is approximately 350 for the heuristic model, whereas it is around 500 for the passive one. Furthermore, it is worth noting that the best solution obtained by the second method falls above the 75 th percentile of the first method's solutions. This means that, among all generated problems, the best outcome from the second algorithm is still worse than 75% of the solutions produced by the first one. Given that each point represents a distinct problem, with significant variability due to random generation, this demonstrates the effectiveness of the heuristic in solving this mathematical model, and highlights the effectiveness of the intelligent charging and discharging strategy. Moreover, the results of the heuristic are compared with those of the exact method solved in Gurobi. Notably, the heuristic consistently returns the optimal solution to the problem. Since both methods produce the same results, Table 2 only compares the time in seconds each of them takes to solve different problems with the specified number of vehicles. Although both algorithms obtain the optimal solution, the traditional approach is significantly slower than the heuristic one. Moreover, once the number of vehicles is large enough, other bottlenecks start to appear aside from the system's speed, such as system memory.