1. Introduction
The widespread use of conventional internal combustion engine vehicles (ICEVs) powered by fossil fuels has made the automotive sector a major contributor to greenhouse gas emissions and air pollution, exacerbating global warming and posing serious health risks. In response to growing concerns about climate change and environmental degradation, there has been a significant shift toward sustainable transportation in recent years. Electric vehicles (EVs), which run on battery power and produce zero tailpipe emissions, have emerged as a key solution to reducing the environmental impact of transportation. By significantly lowering emissions, improving air quality, enhancing energy efficiency and fostering economic opportunities, EVs are now considered essential in mitigating climate change. Their adoption is particularly beneficial in urban areas experiencing high levels of air pollution, where improved air quality can have a direct positive impact on public health. Additionally, EVs offer superior energy efficiency, as electric motors convert a higher proportion of energy into vehicle movement compared to internal combustion engines.
The global EV market experienced significant growth in 2023, with sales reaching approximately 13.8 million units, accounting for 18% of total car sales and representing a 35% increase from the previous year [
1]. This expansion is driven by supportive policies, improved charging infrastructure, advancements in battery technology, cost reductions and growing consumer demand. Although EVs promise a cleaner future and a transition to sustainable mobility, challenges remain in providing a reliable and convenient charging infrastructure worldwide.
Despite technological advancements in EVs, several major challenges continue to hinder their widespread adoption. Battery capacity, size and cost remain key constraints, leading to a limited driving range compared to ICEVs [
2,
3]. Furthermore, the availability of charging infrastructure is still insufficient and EVs require significantly longer charging times, in contrast to the quick refueling process of ICEVs [
4]. As a result, EV drivers must carefully plan their trips based on the accessibility of charging stations (CSs) [
5]. Given these limitations, policymakers have prioritized the expansion and efficient management of EV charging infrastructure to support the continued growth of the EV market and address the mobility needs of both urban and rural areas [
6,
7,
8].
Although the adoption of high-capacity battery packs has helped reduce drivers’ anxiety about the remaining driving range of EVs, this concern persists when charging is needed due to inaccurate range predictions. Such inaccuracies can make it difficult for drivers to determine the optimal time and location for charging. To address this issue, the method proposed in this work aims to alleviate range anxiety by providing realistic and traffic-aware information tailored to the specific conditions of the studied city.
As the number of EVs increases and the availability of CSs remains limited, drivers may face challenges such as imbalanced usage of CSs and prolonged waiting times. Additionally, the nearest CS may be located at an inconvenient point relative to the EV’s intended route, potentially causing drivers to experience anxiety about recharging during their trip. Another issue arises when an EV arrives at a chosen CS only to discover that the charging slots are already occupied by other EVs. Moreover, road traffic conditions and unexpected events along the route can significantly influence drivers’ decisions when selecting an energy provider, as such factors may introduce uncertainty in reaching the chosen CS. This uncertainty can result in suboptimal provider selection and reduce overall efficiency of the trip. In summary, the key factors influencing the prioritization of optimal energy provider selection include the current state of the battery, the required amount of energy, the current position of the EV, the trip destination, the specifications of CSs, real-time traffic conditions, among other factors.
In this work, we discuss recent research studies on the prediction of EV energy consumption and remaining driving range (RDR), the selection of optimal CSs and strategies for minimizing travel time. These topics are essential for enhancing the EV driver experience, accurately estimating energy consumption and developing driver assistance systems that efficiently select the best CS.
Regarding energy consumption prediction, in the article [
9], a deep learning (DL)-based hierarchical framework for plug-in hybrid EVs was employed to develop a data-driven predictive energy consumption minimization strategy. The study explores fuel-saving potential by optimizing the reference state of charge (SoC) trajectory and predicting power demand based on multi-source trip information.
Similarly, the study in [
10] utilized real-world driving data from EVs in Nanjing, China, and applied the Extreme Gradient Boosting (XGBoost) algorithm to estimate EV energy consumption under various road conditions. The model accounted for key factors, including trip conditions, road characteristics, weather and driving behavior. The results showed that the XGBoost model outperformed other machine learning (ML) models, such as Random Forest and k-nearest neighbors (KNN).
In a related study, the XGBoost algorithm was used in [
11] to directly predict the remaining mileage of EVs, employing a dimension expansion and model fusion strategy. Although the study utilized operational data collected from various EVs in Guangzhou, China, the dataset was limited in size and covered only a narrow range of vehicle usage scenarios.
A novel probabilistic, data-driven model using a multilayer perceptron (MLP) neural network to estimate a probability distribution of EV trip energy consumption was introduced in [
12]. This study comprehensively considers various factors, including vehicle dynamics, environmental conditions and driver behavior, such as average acceleration and average deceleration. The model used the ChargeCar dataset [
13], and chieved a mean absolute percentage error of 9.3%, demonstrating high reliability.
In another study, a hybrid Long Short-Term Memory (LSTM)–Gated Recurrent Unit (GRU) model was proposed in [
14] to predict the battery state of EVs across different seasons, demonstrating high predictive accuracy, with a minimum standard deviation of 0.06% under experimental conditions.
In parallel, optimal CS selection has emerged as a key research area. The paper [
15] presented a charging and navigation strategy for EVs that incorporates differences in user time utility between charging and driving time during route planning. Their approach aims to determine the optimal path to a CS that minimizes both travel and charging costs. To achieve this, a charging path planning model based on Dijkstra’s algorithm was implemented on an 18 km
2 urban network, used as a case study, to identify the most cost-effective route. In their analysis, the authors selected a specific starting point and evaluated multiple CSs to identify the one with the lowest overall travel cost.
Whereas the study [
16] proposed a novel ML framework to predict the selection of CSs by EVs, using two years of real-world data from 500 EVs in Japan. Their study investigated key influencing factors and demonstrated that the XGBoost model outperformed other ML classifiers, including Logistic Regression, Naïve Bayes and Random Forest, in accurately predicting CS selection behavior under both normal and fast charging scenarios.
Moreover, strategies for minimizing total trip time for vehicles have been explored. The authors in [
17] developed a DL-based framework for real-time traffic prediction and path planning for connected vehicular networks. Utilizing predicted traffic data, the authors proposed a gridded path planning approach to optimize vehicle routes within predefined grid areas, aiming to reduce travel time and alleviate congestion. The framework’s effectiveness was validated using OpenStreetMap (OSM) [
18] and real-world vehicle data collected from Beijing.
While the study [
19] proposed a traffic management scheme for emergency EVs using the Internet of Vehicles (IoV), combining route selection based on the estimated arrival time at maximum speed with traffic clearance delay analysis. This approach integrates signal preemption schedules and proactive lane reservation to optimize traffic flow and ensure unobstructed EV passage.
The authors of [
20] developed a dynamic traffic network model that incorporates fuel consumption and emissions estimation, utilizing real-world vehicle data from China. The study employed the Dijkstra algorithm for path planning, optimizing routes based on criteria such as shortest travel time, shortest distance, minimal fuel consumption and lowest emissions across different road types and varying traffic conditions throughout the day. However, the model lacked real-time adaptability to congestion.
To improve overall travel time and mitigate traffic congestion, [
21] proposed a bidding-based dynamic route planning approach within a connected vehicle environment. The approach seeks to balance individual travel time with overall traffic efficiency through a bidding process.
In [
22], the authors applied the KNN algorithm to develop a traffic-aware path planning model that leverages both real-time and historical traffic data to identify routes with the shortest travel time.
To achieve real-time travel time estimation, [
23] proposed a distributed transportation system architecture that utilizes roadside units (RSUs) at road intersections for real-time traffic data collection and sharing. The model considers factors such as vehicle connectivity rates in Vehicular Ad hoc Networks (VANETs), traffic flow on road segments, bypassing duration at intersections and waiting time at traffic lights.
In the context of traffic simulation and mobility modeling, the Simulation of Urban MObility (SUMO) [
24] has been widely used in recent research to model and optimize urban mobility systems. SEMSIM [
25] is a SUMO-based simulation framework designed to optimize ambulance base locations and reduce the response time of emergency medical service. Similarly, in [
26], SUMO was employed to analyze traffic demand generation tools and their impact on vehicle mobility and connectivity in VANET scenarios using real traffic data. Further extending the use of SUMO in transportation research, ref. [
27] adopted SUMO simulations to generate high-quality traffic datasets for major roads in multiple countries. Regression models were then applied to predict traffic characteristics and congestion across diverse environments, and these models were subsequently optimized using grid search and metaheuristic techniques.
While the aforementioned approaches have contributed significantly to their respective domains—such as energy consumption prediction, CS selection, and travel time estimation—they often address these challenges independently. In contrast, this study proposes an integrated ML-based framework that simultaneously considers multiple interrelated factors to support real-time, data-driven decision-making for EV routing and charging. The framework incorporates key inputs such as real-time traffic conditions, the EV’ destination, driver behavior, estimated average speed and distance, the EV’s current SoC, energy demand and the locations and characteristics of CSs. These characteristics include charging speed, congestion levels and historical charging efficiency. Additionally, the approach accounts for critical operational factors such as regenerative braking energy recovery and expected energy consumption during the trip—both of which are critical to accurate planning and optimal energy management. To further enhance predictive performance, ensemble ML models are employed to leverage the strengths of various algorithms, thereby improving both accuracy and reliability. Advanced optimization algorithms were also applied for hyperparameter tuning to ensure the models operate at their highest possible efficiency. The result is a comprehensive framework that enables intelligent route planning and optimal CS selection to minimize total travel time, while also providing accurate predictions of overall trip duration—including any necessary charging stops—and the remaining SoC upon arrival. Based on this SoC prediction, the system determines whether the EV can complete its journey without recharging or requires an intermediate charging stop. By combining these predictive insights, the proposed framework enables efficient, context-aware decision-making, enhances operational efficiency, improves the reliability of predictions and ultimately contributes to improving the overall driver experience.
In the following, we summarize the research contributions of the proposed work:
We have developed a smart charging service designed to assist drivers of low-battery electric vehicles (L-EVs) in finding the most suitable CS by considering several parameters, such as the current traffic conditions, the destination location, the EV’s current SoC, required charge and the location and specifications of available CSs. The proposed approach assumes a data exchange mechanism based on the concept of VANETs [
28]. Additionally, we compare different CS selection strategies, including the closest CS to the EV’s current location, the nearest CS to the destination, and the CS that minimizes the total travel time, including the time required for charging.
To achieve this, the study aims to establish a realistic simulation platform to model various conditions affecting EV charging, generate high-quality datasets that reflect EV traffic within the study area for later use in training ML models and evaluate the performance of the proposed models. Our work leverages SUMO [
24] to generate traffic patterns over realistic road scenarios, OSM [
18] for detailed map data and Python for automating the simulation process.
This work develops an ensemble ML-based model to predict the energy consumption of an EV en route to its destination. The model considers key factors influencing EV energy consumption, such as traffic density, driver behavior, estimated average speed, estimated distance, the EV’s current position and destination and the energy generated through regenerative braking [
29]—an aspect often overlooked in previous studies. By comparing various ML models and applying optimization techniques to fine-tune regression parameters, we aim to select the best model for predicting EV energy consumption. This approach helps drivers estimate their energy needs, determine whether charging is necessary and ensure they have sufficient charge to reach their destination. Moreover, the model estimates the maximum distance each EV can travel based on its remaining battery energy and identifies reachable CSs for a stress-free and efficient journey.
In addition, we have developed an ensemble ML model to predict trip time and select the optimal CS that minimizes the total trip time, including the stop to charge. The Minimum Total Travel Time Model (MTTM) recommends the optimal CS by considering key factors such as the availability of charging slots, queue waiting times at each reserved CS, CS efficiency, charging speed, and the required amount of energy including both the pre-required energy and the compensation for the expected energy consumption during the trip to the CS and then to the destination—together with real-time traffic conditions, and the overall trip time. Extensive experiments comparing various ML models, combined with optimization techniques to refine regression parameters, were conducted to identify the best-performing approach. This comprehensive initiative integrates critical factors for route planning and travel time optimization. To the best of our knowledge, it is the first intelligent model to simultaneously consider both traffic congestion and charging time requirements.
The remainder of this paper is organized as follows.
Section 2 presents the driver’s charging decision-making process and appropriate CS selection.
Section 3 describes the design of an EV energy consumption prediction model to improve charging efficiency.
Section 4 focuses on designing a model for CS selection with minimum total travel time for EVs.
Section 5 outlines the methodologies applied to develop and evaluate the proposed models.
Section 6 discusses the frameworks and simulators used to support this research.
Section 7 presents the implementation of the EV charging scenario and a description of the dataset used for training and evaluating the models.
Section 8 and
Section 9 present the performance evaluation of the energy consumption model and the minimum total trip time model for optimal charging station selection, respectively. Finally,
Section 10 summarizes the study and presents conclusions, along with future research directions.
2. Driver’s Charging Decision-Making Process and Optimal Charging Station Selection
Several parameters impact the energy consumption of EVs from the start of a trip to the destination. Beginning with the energy source, electrical energy is transferred to the EV’s battery, and the efficiency of this transfer determines the amount of energy lost during the process. Meanwhile, the charging rate affects the duration of the charging process, while the availability of chargers and energy resources influences the overall charging experience. Battery storage capacity is another crucial factor in EV performance. The battery’s capacity limits the maximum trip duration and impacts the size of the EV fleet. Moreover, the initial SoC sets the potential travel range of the EV.
Enhancing the accuracy of RDR estimation for EVs and addressing drivers’ range anxiety presents a complex challenge. Due to various external environmental factors and driving behaviors, the RDR of EVs, initially considered linear, often follows a nonlinear trend. This discrepancy between actual and estimated RDR can lead to the risk of insufficient range during trips, negatively impacting the driving experience. Existing solutions generally fall into two main categories.
The first approach relies on the assumed linear relationship between RDR and remaining energy, aiming to control energy consumption by considering factors such as the State of Health (SoH) of the battery, braking frequency, and road smoothness [
30]. However, this method may negatively affect driver comfort. In contrast, the second approach leverages real-time data and ML algorithms to predict RDR more accurately, factoring in variables such as traffic conditions, environmental factors and driving habits. This approach improves RDR prediction accuracy, enhances driver comfort and alleviates range anxiety. Consequently, selecting the most suitable ML model to assist in estimating RDR has become a key area of research.
In EVs, SoC—which represents the ratio of the battery’s current capacity to its maximum charge capacity—is used as an indicator of remaining energy, replacing the traditional fuel gauge found in conventional vehicles.
where
denotes the remaining capacity of the battery and
represents the maximum capacity of the battery. According to [
31], the SoC of an EV’s battery should be maintained within a safety range rather than utilizing the full capacity from 0% to 100%. Studies suggest that optimal battery performance and reduced capacity degradation are achieved by maintaining SoC within the range of approximately 20% to 80%, as prolonged operation outside this range—whether below 20% or above 80%—adversely affects battery longevity [
32]. In particular, it is recommended to avoid exceeding 80% during charging to further preserve battery health [
33].
Efficient management of the charging process in EVs is crucial to ensuring an uninterrupted journey. Drivers must decide when and where to charge based on various factors, including the remaining battery level, distance to the destination, availability of CSs and urgency to reach their destination. Selecting the optimal CS—one that minimizes total travel time—is essential for reducing delays and enhancing the overall driving experience. Informed charging decisions can significantly lower energy consumption, travel time and waiting times at CSs. Therefore, implementing a decision-making framework that helps drivers choose the best charging option is vital for optimizing EV performance.
In this regard, the design of our proposed smart charging service takes into account the following key factors:
Current battery conditions: Specified by SoC or amount of energy available in the battery.
RDR: Determines whether an energy-requiring EV has sufficient battery energy to reach its destination or not.
Current position of L-EVs: Used to calculate the distance to nearby CSs.
Travel time to each energy provider: Estimated by considering current traffic conditions along the route, which affect both the total travel time and the selection of the optimal CS.
Trip destination: Relevant for identifying energy providers along the EV’s route.
Charging duration: Influenced by the type of charger, its technical specifications and the efficiency of the charging services.
Waiting time at candidate CSs: This factor considers the delays caused by the unavailability of charging spots, requiring EVs to wait until a spot becomes available.
Traffic conditions throughout the city: These can impact the overall performance of the charging system.
Path planning: Responsible for identifying the shortest route to the selected CS and final destination. This process can be achieved by using Dijkstra’s algorithm.
Of course, the charging price is another crucial parameter influenced by factors such as the time of charging (e.g., morning or night), the charging method (e.g., mobile CS, plug-in CS, Vehicle-to-Vehicle (V2V) charging or inductive charging), and the charger’s speed, among others. However, in this work, we do not consider the impact of charging price, leaving it for future research.
Figure 1 illustrates the flowchart of the proposed CS selection scheme, designed to assist drivers in making informed charging decisions and selecting the optimal CS. The flowchart highlights key decision points, beginning with an assessment of the EV’s SoC. If the SoC exceeds a predefined threshold, the EV can continue its journey directly to the destination Algorithm 1. However, if the SoC falls below this threshold, the system initiates a predictive evaluation using an ensemble ML model to estimate the expected energy consumption for the planned route Algorithm 2. Based on this prediction, the system determines whether the available energy is sufficient to reach the destination. If the predicted remaining charge is below 20%, the system calculates the minimum required energy and identifies the maximum reachable distance. To initiate the CS selection process, candidate CSs within the EV’s driving range are filtered Algorithm 3, after which the CS reservation table is consulted to identify free-slot CSs. If none are available, reserved CSs are considered as alternatives. Depending on the chosen strategy Algorithm 4, the most suitable CS is selected—whether it is the nearest to the EV, the closest to the destination, or selected through an advanced evaluation based on minimizing total travel time via the ensemble ML model Algorithm 5. The CS with the lowest predicted total travel time is then selected, ensuring an energy-efficient and time-optimized charging decision. Finally, the EV charges at the chosen CS. If the charge is adequate, the trip continues Algorithm 6; otherwise, the system reassesses the situation and updates the plan accordingly. This approach optimizes energy usage, minimizes delays and improves the reliability of charging decisions, enabling drivers to make informed choices and ensuring a seamless, efficient journey with minimal disruptions.
The equations utilized in this process are presented below and play a crucial role in supporting efficient charging decisions. They facilitate the calculation of the required energy to reach the destination, the current SoC and the corresponding RDR, which determines whether the EV can complete its journey. If the available charge is insufficient for the EV to reach its destination, the system must identify a suitable CS for recharging.
Algorithm 1: (Step 1: SoC Check and Decision) |
![Futureinternet 17 00374 i001 Futureinternet 17 00374 i001]() |
Algorithm 2: (Step 2: Energy Consumption Prediction) |
![Futureinternet 17 00374 i002 Futureinternet 17 00374 i002]() |
kWh (kilowatt-hour): It is a unit of energy.
(kWh): Expected remaining charge at the final destination.
(kWh): The current remaining charge in the battery.
(kWh): Predicted energy consumption during trip using our ML model.
(kWh): Maximum battery capacity.
(%): Expected state of charge at the final trip.
The driver can set a specific SoC percentage as a threshold. If the EV’s battery level drops below this threshold, the driver will opt to charge the EV. Alternatively, the
value can be relied upon, as long as it remains above 20%. If charging is required, it becomes essential to estimate the maximum distance the EV can travel with the remaining charge. This calculation helps identify an optimal CS within the reachable area, ensuring efficient route planning and minimizing the risk of depleting the battery.
(km): Expected shortest travel distance calculated via using the Dijkstra algorithm.
(kWh): Represents the amount of energy that the EV can consume during its trip.
(kWh): Represents 20% of the , which is the minimum energy to ensure safe operation of the EV.
RDR (km): It represents the maximum distance that the EV can travel before the SoC drops below 20%.
Algorithm 3: (Step 3: Selection of Reachable Charging Stations) |
![Futureinternet 17 00374 i003 Futureinternet 17 00374 i003]() |
Algorithm 4: (Step 4: Strategy-Based Charging Station Selection) |
![Futureinternet 17 00374 i004 Futureinternet 17 00374 i004]() |
Algorithm 5: (Step 5: Minimum Travel Time Prediction Using Ensemble ML Model) |
![Futureinternet 17 00374 i005 Futureinternet 17 00374 i005]() |
Algorithm 6: (Step 6: Charging Process After Selecting Best Charging Station) |
![Futureinternet 17 00374 i006 Futureinternet 17 00374 i006]() |
In case the driver has enough time and wants to fully charge the EV, the required energy (
) is calculated based on Equation (
7). Additionally, the energy consumed to reach the selected CS is considered and added to the amount of energy requested by the driver.
If the driver needs to charge and intends to reach the destination as quickly as possible, Equation (
9) is used to determine the minimum required charge that ensures the EV reaches the destination without dropping below the critical SoC threshold.
(kWh): Represents 80% of the , which is the maximum battery charge to ensure its safety and longevity.
(kWh): The predicted energy consumption from the current location to the selected CS.
(kWh): The predicted energy consumption from the selected CS to the destination.
(kWh): The total predicted energy consumption from the current location to the selected CS and from this selected CS to the destination.
(kWh): The minimum required energy in a time-sensitive charging scenario, ensuring the SoC remains above the critical level.
ER: The error margin added to account for variations in energy consumption.
Of course, the driver can always choose to charge any amount within the range between the minimum value computed using Equation (
9) and the maximum value determined by Equation (
7).
3. Factors to Predict the Energy Consumption of Electric Vehicles
Traditionally, RDR of EV has been estimated through various physics-based models and performance test data. These models typically include a physics-based vehicle energy consumption model, a regenerative braking model for energy recuperation, an energy consumption model by auxiliary electric devices and dual automatic temperature control, a battery charge-discharge model, among others. Nevertheless, such physics-based models often fail to account for other uncertain information or dynamic factors affecting real-world driving conditions. Moreover, combining multiple physics-based models may frequently overlook complex dynamic conditions that significantly influence energy consumption. To improve existing range prediction methods, navigation platforms and traffic information from the driving route can be incorporated to provide drivers with insights into traffic conditions along the remaining route, thereby supporting more reasonable predictions and enabling updates of battery power consumption [
34].
On the other hand, our approach involves using a realistic map imported from OSM, along with SUMO simulations to generate different realistic scenarios with various traffic densities. Then, the data generated from these simulations can be benefited in training a custom ML learning model to predict an EV’s energy consumption during the journey, including the consideration of energy generated from regenerative braking.
According to [
35], there is a strong correlation between energy consumption per kilometer and key factors such as road conditions, ambient temperature, and driver behavior. Among these, temperature is considered one of the most influential factors affecting the energy consumption of EVs. Extremely low or high temperatures can significantly increase energy consumption due to the need to use heating or cooling systems to ensure passenger comfort and maintain battery efficiency [
36].
In this work, we focus on mild temperature cities, where temperature is not a critical factor in determining energy consumption in EVs. Instead, to estimate the RDR, we prioritize factors such as traffic density, road conditions, driving behavior, average speed and distance to the destination.
4. Towards a Model for Charging Station Selection to Minimize Total Travel Time
To sustain the growing demand for EV charging, while improving the operational economy of these EVs and extending driving range, it is essential to support the deployment of high-capacity, high-efficiency charging infrastructures. The main factors affecting charging time are charging power (CP) and the maximum battery capacity of EVs [
37].
Charging Power (CP):Defined as the amount of power delivered to charge an EV over a given period. It is determined by the product of current multiplied by voltage and is measured in kilowatts (kW). CP represents the charging speed available at a particular slot of a CS.
Maximum battery capacity: Refers to the maximum amount of energy that the battery can store. Larger batteries allow EVs to travel farther, but they are already slower to full charge.
Based on these factors, the charging time of an EV (
) can be calculated; however, this estimation must account for energy losses occurring during the charging process.
can be obtained from Equation (
7) for normal charging, or alternatively, Equation (
9) can be applied when a time-sensitive charging need arises.
In general, refueling traditional vehicles requires a few minutes while EVs need a couple of hours to fully recharge. This is one of the biggest issues which requires finding solutions before relying entirely on EVs. Currently, EVs can be charged in public places, workplaces and at home.
The large-scale deployment of EVs, particularly when charging occurs during peak-load hours, can significantly increase electricity demand. This may necessitate the expansion of generation capacity and potentially lead to the overloading of CSs and service transformers, which accelerates equipment wear and tear. Therefore, it is essential to build additional CSs and implement strategies to shift EV charging to off-peak hours to alleviate peak load demand, ultimately benefiting the longevity of transformers. In response, utility companies have introduced time-based pricing structures to incentivize EV drivers to charge during off-peak hours, with electricity costs varying between peak and off-peak times. However, limitations in EV battery capacity and the insufficient number of CSs—often resulting in significant waiting times—still pose challenges to this approach.
Battery lifetime is a major challenge for the EV industry, prompting manufacturers to improve battery specifications to reduce consumption rates and support longer trips. However, EVs may still require extended charging times, leading to congestion at CSs and long wait times. Increasing the number of CSs throughout the city could help address these issues and encourage EV adoption. Nevertheless, large-scale deployment of CSs can be prohibitively expensive.
To address charging infrastructure limitations, several alternative solutions have been proposed, such as dedicated charging lanes, larger EV batteries and battery swapping. Although charging lanes offer energy and time efficiency, they require substantial infrastructure investment [
38,
39]. Large batteries, on the other hand, introduce challenges such as higher costs and increased vehicle weight, which demands more power to operate. While battery swapping has lower construction costs compared to charging lanes, the need for a large distribution of batteries for swapping makes it economically inefficient and sometimes impractical.
To advance toward a fully electrified transportation system, this study proposes a minimum travel time algorithm to help travelers select the most efficient CS, reducing wasted time. Moreover, it contributes to the balanced utilization of CSs by directing EVs to less congested and faster CSs, thereby preventing overcrowding and improving the overall efficiency of the charging infrastructure.
At present, many EV drivers struggle to identify the optimal CS for their journey. Decisions are often made based on proximity, route direction, or randomly—sometimes aided by traditional routing algorithms that minimize travel distance or time. However, these approaches typically fail to consider real-time traffic conditions, CS availability or queuing times, leading to the selection of suboptimal CSs that can significantly extend travel time. In some cases, drivers end up at highly reserved CSs, forcing them to wait in long queues and delaying their arrival at their destination.
To select the optimal CS, several factors must be considered. First, the maximum distance an EV can travel with the remaining energy should be calculated. This is achieved through an energy consumption prediction model, which estimates energy usage per meter, enabling precise calculation of the maximum reachable distance. Next, Dijkstra’s algorithm, supported by the SUMO simulation, is used to determine the shortest path to each CS, ensuring that only CSs within the EV’s range are selected, avoiding battery depletion below 20 percent, which is crucial for battery longevity.
Once the reachable CSs are identified, the availability of free slots is checked. If free slots are available, the best CS is selected. Otherwise, the most suitable reserved CS is chosen. The best CS is defined as the one offering the shortest overall travel time, determined using a minimum travel time prediction model based on an ensemble of a Feedforward Neural Network (FFNN) and XGBoost regressor. To apply this model, several factors must be considered, including the EV’s current position and destination, the location of CSs, current traffic density, expected average speed, acceleration, deceleration, and—most importantly—the total time required to complete the charging process.
To accurately calculate the total charging time, it is essential to account for the energy required to reach the selected CS, from the CS to the final destination, as well as the energy needed by the driver. The next step involves determining the charging time based on the CS’s power, the charger’s efficiency and the waiting time in the queue, which is calculated by summing the total charging times of all EVs ahead in the line, plus the remaining time required to charge the currently charging EV. After considering all these factors and providing the model with the necessary data, it will predict the most efficient CS in terms of minimizing total travel time to the destination.
5. Methodologies
This section provides a brief overview of the key technologies, methodologies and simulation tools employed to develop a charging management framework for EVs. Moreover, it explains the ML methods used for predicting energy consumption and estimating the minimum total travel time for EVs.
5.1. Traffic Routing Algorithm—Dijkstra Algorithm
To determine the most efficient route and shortest distance for vehicles (Veh)—or any other mode of transportation—to reach a given destination, we adopt the Dijkstra algorithm [
40] for optimal path planning in this study. Our map is modeled as a rectangular area with a limited number of traversal nodes to simplify the search space. Among classical path planning algorithms, Dijkstra’s algorithm is a well-established optimization method that calculates the shortest distance from the departure point to the destination through iterative node-selection computations in the search space. However, since the Dijkstra algorithm is static, it does not adapt to real-time changes in traffic conditions. To address this limitation, we incorporate traffic density data into our approach, enabling us to predict arrival times and assess traffic conditions in advance.
SUMO provides traffic simulation data, including vehicle speeds, traffic densities on each road segment and road characteristics such as lane count, speed limits, gradients, elevations and road types. By utilizing SUMO’s TraCI interface, real-time traffic and road data can be dynamically retrieved during the simulation to update edge weights based on factors such as current congestion, average speed and lane occupancy. The edge weights are recalculated to reflect these live conditions. With the updated edge weights, Dijkstra’s algorithm can then compute the most efficient routes, taking these dynamic factors into account. This approach allows the routing process to adapt to real-world conditions, thereby enhancing the realism and accuracy of the simulation.
In SUMO, the
findRoute function uses the Dijkstra algorithm by default to compute the shortest path from the source edge to the destination edge, exploring all possible routes based on edge weights. The algorithm iteratively selects the node (or edge) with the lowest accumulated cost, defined as the sum of the weights along the path. An illustration of the traffic routing algorithm is shown in
Figure 2.
Indeed, the weights used in Dijkstra’s algorithm depend on this configuration options:
Distance-based: Weights are edge lengths (e.g., shortest physical path).
Time-based: Weights are calculated using edge lengths and speed limits (e.g., shortest travel time).
Custom metrics: You can modify weights to account for other factors like congestion, emissions or energy consumption.
In addition, SUMO supports several other routing algorithms, including A* (A-star), Contraction Hierarchies, CHWrapper and Floyd-Warshall [
41]. The interpretation and calculation of edge weights depend on the specific application and the available data and these weights directly impact the efficiency and accuracy of the routing algorithms.
5.2. Overview of Machine Learning
ML is a branch of Artificial Intelligence (AI) that enables systems to learn from data and improve over time without human intervention [
42]. Through the training process, a general model—using a particular set of parameters—becomes specialized for particular tasks. Unlike traditional ML models, artificial neural networks (ANNs) can outperform them, especially when dealing with data abundance due to their ability to discover and learn features from raw data automatically [
43]. ANNs are computational systems inspired by biological neural networks, consisting of interconnected artificial neurons, organized into an input layer, one or more hidden layers, and an output layer. Each connection is associated with a weight that adjusts during training, while biases help fine-tune the output [
44]. Furthermore, feed-forward and back-propagation algorithms form the backbone of neural network architectures. Learning in ANNs is driven by backpropagation, which minimizes error using techniques like Stochastic Gradient Descent. DL extends ANNs by incorporating multiple hidden layers, thereby enhancing performance [
45]. Learning is optimized using backpropagation and activation functions, including Sigmoid, Softmax, Hyperbolic Tangent (tanh) and Rectified Linear Unit (ReLU). DL models are generally classified into supervised and unsupervised learning. Supervised learning has been adopted in our work. From supervised learning, there are two main categories, feed-forward topology, and recurrent topology [
46,
47].
In this study, ensemble ML models were utilized to improve the accuracy of the prediction of EV energy consumption and the estimation of minimum travel time. By combining multiple ML and DL techniques, the models leveraged their respective strengths to enhance predictive performance. The main models covered in this study include XGBoost Regressor, FFNN and Recurrent Neural Network (RNN).
5.2.1. XGBoost Regressor
While traditional ML models like decision trees and random forests are easy to interpret, they often face challenges in achieving high accuracy on complex datasets. XGBoost is a high-performance and efficient supervised learning algorithm specifically designed to enhance regression models. It builds on decision trees as base learners, improving predictions through sequential boosting and optimizing them using an objective function that incorporates a loss function and regularization term [
48].
5.2.2. Feed-Forward Neural Network
In FFNN, the information flows from input to output in a single direction, with no feedback connections. Additionally, there are no restrictions on the number of layers, the choice of activation functions or the number of connections between them [
46].
5.2.3. Recurrent Neural Network
RNNs extend traditional FFNNs by introducing feedback connections to prior layers or even within the same layer to retain past information, making them useful for sequential data processing [
49]. As a result, information flows not only forward but also backward within the network. However, RNNs suffer from short-term memory loss due to the vanishing gradient problem, which emerges when handling with long data sequences. To address this issue, LSTM was introduced as an improvement over RNN, which expands their memory. LSTM is capable of learning long-term dependencies, and has the ability to retain important information over both short and long time and carry it forward by incorporating memory cells and three gates (input, forget, and output) [
49,
50,
51]. In this context, Bidirectional LSTM (Bi-LSTM) further enhances the performance of LSTM by processing data in both forward and reverse directions, thereby improving contextual understanding [
51,
52].
5.3. Tuned Machine Learning Approaches
ML algorithms are extensively used for making general predictions based heavily on datasets to train these models, and the accuracy and reliability of these predictions are significantly impacted by the characteristics of these datasets. Furthermore, various algorithms could be employed to train these models. Relying on the features of the research problem and the datasets adopted, they exhibit varying behaviors and predictive capabilities. Accurately estimating energy consumption for the remainder of the journey and making the optimal choice for a CS can greatly influence the driver’s optimal decision, ensure a safe trip and minimize total travel time. The choice of an appropriate CS—one that guarantees the minimum total travel time—relies on precise energy consumption forecasts required to complete the journey, road conditions, CS specifications and congestion levels, as well as EV characteristics. Conversely, incorrect decisions in this context could lead to undesirable outcomes, such as battery depletion or delays in reaching the destination. Therefore, this field demands further research and improvements to achieve high accuracy in energy consumption predictions and minimum total travel time forecasts. This includes leveraging model optimization techniques, obtaining high-quality datasets and applying advanced hyperparameter tuning methods to enhance predictive performance.
The hyperparameter process can be carried out using different strategies, including Bayesian search [
53], metaheuristic optimization [
54], random search and grid search [
55]. Bayesian search employs a probabilistic model for the objective function taking into account past performances. While metaheuristic algorithms apply high-level procedures to optimize problems, offering flexible solutions that can be adapted to different issues. Metaheuristic algorithms are effective in finding the most suitable solutions for defined problems, which are known for their simplicity and robustness in solving optimization challenges [
54,
56]. It work by encoding candidate solutions and searching for the optimal one independently, regardless of the type of problem [
57]. The metaheuristics mechanisms can be categorized as population-based, single-point, nature-inspired or non-nature-inspired. Evolutionary algorithms such as Genetic algorithm [
58], Differential Evolution [
59] and Evolution Strategy [
60], along with swarm intelligence algorithms like Particle Swarm Optimization [
61], FireFly Algorithm [
62] and Ant Colony Optimization [
63] represent two categories of metaheuristic algorithms that utilize nature-inspired behavior to solve optimization problems. Regarding search approach, the random search approach involves experimenting random hyperparameter values within a defined search space. While grid search systematically explores all possible combinations of parameter values in the search space, and evaluating their performance to find the optimal configuration.
5.4. Evaluation Methodology for the Machine Learning Models
The effectiveness of trained ML models is evaluated using holdout data by measuring the discrepancy between predicted and actual values through various performance metrics. In this study, the following standard metrics are employed to comprehensively assess the predictive performance of the models: Mean Squared Error (MSE), Mean Absolute Error (MAE), Root Mean Squared Error (RMSE) and Normalized Mean Absolute Error (NMAE). These metrics compare the actual target values (
y), the predicted values (
) and the mean of the actual values (
). Lower values indicate better model performance.
Moreover, the coefficient of determination (
) is employed as an additional evaluation metric to quantify the model’s explanatory power by measuring the proportion of variance in the dependent variable that is explained by the independent variables. In this context,
is used to assess the influence of independent variables on the dependent variable and to evaluate the overall explanatory capability of the model. An
value closer to 1 indicates a better model fit. It is defined as:
6. Simulation Framework
Simulations provide a highly effective approach for conducting multiple tests, enabling long-term and large-scale evaluations. This approach allows researchers to identify and mitigate potential issues in a controlled and repeatable environment, without the need for costly equipment or resource-intensive field tests. Additionally, simulations offer the flexibility to study system behavior under various scenarios, including different city layouts. Realistic simulation environments play a crucial role in obtaining reliable and meaningful results. The subsections below outline the core components of the realistic simulation framework developed in this study.
6.1. OpenStreetMap (OSM)
OSM [
18] is a collaborative project aimed at creating free and editable maps. These maps are generated using geographic information collected through mobile GPS devices and various other free sources. In addition to providing free maps, the data generated by the OSM project includes many realistic features of the environment, such as road networks, buildings, streets, points of interest, and more. OSM data is freely accessible, accurate, regularly updated, and continuously verified by the community of OSM contributors. All maps are licensed under the Open Data Commons Open Database License (Open Knowledge Foundation) by the OpenStreetMap Foundation and as such, can be used for academic research purposes.
Nowadays, OSM stands out as the most successful crowdsourced geographic information project. The main objectives of this organization were to address the legal and technical limitations on maps that had been imposed in 2004, as well as to create and freely disseminate global geographic data. Notably, the OSM geospatial database is released under the Open Database License [
64], permitting non-restrictive use, modification, and expansion of the database, as long as proper attribution is given to OSM contributors.
6.2. Simulation of Urban MObility (SUMO)
SUMO [
24] is a widely recognized microscopic road traffic simulation environment within the research community. This simulator is designed to handle large road networks and provides high-performance traffic simulation through a user-friendly graphical user interface (GUI). Moreover, it seamlessly integrates with OSM to import realistic road networks with traffic demand. Several tools and applications are incorporated into the SUMO package to achieve the necessary level of detail for microscopic simulations. Specifically, the NETCONVERT and NETEDIT applications allow users to build and edit road networks based on real maps imported directly, such as from OSM. Furthermore, to incorporate building information into the scenario, the POLYCONVERT tool enables the extraction of building locations directly from OSM. As for the characteristics of the individual road network, these include lane count, traffic light timings, maximum speed and more. Traffic demand provides details about vehicles, such as speed, position, direction, departure time and destination. SUMO traffic generators enable the creation of random trips, vehicle flows, fixed routes, and more. The
randomTrips.py script can be executed to generate multiple trips for EVs across the road networks, while dynamic simulation behavior can be retrieved or modified during the simulation via the socket connection TraCI [
65].
6.3. Jupyter and Python Environment
Model development and experimentation were conducted using Python (3.11.5) in a Jupyter Notebook environment. Python serves as the primary programming language due to its extensive library support and flexibility in handling data processing, model building and evaluation. Jupyter Notebook, on the other hand, provides an interactive computing environment that allows for seamless integration of code, visualizations and narrative text.
6.4. Hardware
The hardware configuration of the experimental environment used in this paper includes an Intel i9-12900H processor, an NVIDIA GeForce RTX 4060 graphics card with 8 GB of GDDR6 dedicated VRAM and 16 GB of DDR5 memory.
7. Implementation and Dataset Preparation for the Electric Vehicle Charging Scenario
In the first stage, we focused on preparing a representative dataset for the scenarios under consideration. To enhance the realism of the simulation, the map of real roads along with all necessary simulation files were imported from OSM. Specifically, a section of the Eixample district map in Barcelona, covering an area of approximately 3.5 km
2, was selected, as depicted in
Figure 3, and used in the subsequent steps of our work.
Using the SUMO platform, realistic scenarios were developed by generating the necessary traffic routes, CSs, and EVs. The simulation settings are presented in
Table 1. The dataset collected from EVs, CSs, and environmental interactions within these scenarios served as the foundation for training the ML models. These scenarios allowed the collection and analysis of data, facilitating comparisons that provided insights into the behavior of EVs and their batteries under varying conditions. In this setup, electric trucks were selected, each equipped with a maximum battery capacity of 35 kWh.
As previously discussed, the SoC range of an EV’s battery operating within a safety zone is between 80% and 20% of its maximum capacity. Therefore, in this scenario, the maximum and minimum SoC levels were 28 kWh and 7 kWh, respectively. For the purpose of simulating energy providers, six CSs were randomly distributed across the map.
Figure 4 illustrates the evolution of an electric truck’s battery capacity as a function of its average speed over time, under a scenario of normal traffic density of 75 Veh/km
2. In general, the battery capacity gradually decreases while the EV is in motion and declines more rapidly with increasing acceleration (see red dots). The graph also reveals a slight increase in battery level during deceleration due to the regenerative braking system (see green dots), while it remains stable when the EV is at a complete stop (see blue dots). Since a moving EV has significant kinetic energy, braking to reduce speed requires dissipating this energy. The regenerative braking system leverages the EV’s motor as a generator, converting a portion of the kinetic energy lost during deceleration into electrical energy, which is then fed back into the battery [
29]. This process effectively results in a brief recharging period.
To develop accurate ML models, the first step involved the collection and preprocessing of data derived from realistic SUMO simulations. Two representative datasets were created: one for EV energy consumption prediction and another for minimum travel time estimation, containing 1,048,575 and 10,727 records, respectively. These datasets were generated after identifying and handling outliers, addressing missing data and ensuring data consistency.
In the second step, the most important features from the existing datasets were selected and analyzed. The datasets are specifically limited to EVs and CSs around Barcelona, Spain.
Our first dataset includes these features:
Traffic density
EV’s average speed
EV’s acceleration and deceleration
EV’s current position (latitude and longitude)
EV’s destination (latitude and longitude)
Estimated distance to the destination
EV’s energy consumption (target to be predicted)
Our second dataset contains these features:
Traffic density
EV’s average speed
EV’s acceleration and deceleration
EV’s current position (latitude and longitude)
EV’s destination (latitude and longitude)
Estimated distance to selected CS, and from the CS to the final destination
CS location (latitude and longitude) and charging efficiency
Duration of charging
Total trip time including charging stop (target to be minimized)
After selecting the features and splitting each dataset into training, validation and test sets, the next step is to compare various models for predicting EV energy consumption and minimum travel time. This comparison is conducted using the same dataset rather than relying on models from disparate literature sources with varying datasets. Once trained and validated, the performance of the ML models is evaluated using test datasets to assess how accurately each model predicts the target variable. Finally, the selected models for EV energy consumption and minimum travel time prediction should be integrated into a realistic simulation scenario to conduct a performance evaluation.
Figure 5 presents the simulation workflow, showing the integration of OpenStreetMap, SUMO, and the ML models for energy consumption prediction and CS selection. The simulation scripts are available at [
66].
8. Performance Evaluation of the Machine Learning-Based Model for Electric Vehicle Energy Consumption
This section explores the evaluation of various ML models to determine the most effective approach for predicting the energy consumption of EVs. The models under comparison include XGBoost regressor [
48], FFNN [
46], LSTM [
50,
51], Bi-LSTM [
51] and an ensemble model that integrates Bi-LSTM with XGBoost regressor.
Hyperparameter tuning played a crucial role in optimizing the performance of both the Bi-LSTM and XGBoost regressor models. Techniques such as Bayesian optimization, Randomized Search and Metaheuristic methods were applied to identify the best configurations. The best-performing hyperparameters for the Bi-LSTM and XGBoost regressor models, along with their performance results are summarized in
Table 2,
Table 3,
Table 4 and
Table 5. To normalize the input data, the MinMaxScaler method was employed with a feature range of (0, 1). Among the tuning techniques, Bayesian optimization yielded the best results for the Bi-LSTM model (see
Table 3), while Randomized Search proved to be slightly more effective for the XGBoost regressor (see
Table 5).
Table 6 presents the optimal hyperparameters for FFNN, LSTM and Bi-LSTM models obtained through Bayesian optimization. A performance comparison of the four ML models is presented in
Table 7, revealing that Bi-LSTM and the XGBoost regressor achieved slightly better performance than FFNN and LSTM across all evaluation metrics, consistently emerging as the most effective models for energy consumption prediction.
Although the performance of Bi-LSTM and the XGBoost regressor is comparable (see
Table 7), combining both models into an ensemble—referred to as Bi-LSTM + XGBoost—yielded even better results. The ensemble capitalized on the complementary strengths of both models, leading to improved precision and robustness.
Table 8 presents the MAE and NMAE results, as discussed in
Section 5.4, obtained from simulations conducted across five different scenarios over various traffic densities (50, 100, 150, and 200 Veh/km
2). The results present a comparison of the performance between the standalone Bi-LSTM model and the ensemble approach, which combines Bi-LSTM with XGBoost regressor. These results demonstrate that the ensemble model Bi-LSTM + XGBoost improves performance compared to Bi-LSTM alone, highlighting its effectiveness as a more robust solution for predicting the energy consumption of EVs.
For the Bi-LSTM model, training was conducted over 35 epochs, which was identified as the optimal number. Although additional epochs yielded marginal improvements, the increased computational cost outweighed the benefits.
To assess the performance of both the Bi-LSTM + XGBoost ensemble model and the standalone Bi-LSTM model in predicting the energy consumption of EVs, we compared the average energy consumption (kWh/km) of EVs under different vehicle densities (50, 100, 150, and 200 Veh/km
2), as shown in
Figure 6. Confidence intervals of 90% are included, with 5 repetitions per scenario, each using independent simulation seeds. The results indicate that the ensemble model (Bi-LSTM + XGBoost (green bars)) outperforms Bi-LSTM (red bars) alone, providing greater accuracy in estimating energy consumption, as it is closer to the actual values (blue bars). These findings demonstrate that the ensemble model (Bi-LSTM + XGBoost) better approximates the average actual energy consumption, highlighting its superior predictive performance and consistency across various vehicle density levels. To further validate the generalizability of the proposed ensemble model (Bi-LSTM + XGBoost), additional comparisons were conducted between the actual and predicted mean energy consumption in two alternative simulation environments: Berlin and Paris, as depicted in
Figure 7 and
Figure 8, respectively. In both cities, the model (green bars) maintained predictive capability across varying traffic densities, closely aligning with the actual energy consumption values (dark blue bars), most notably in
Figure 8. This observation is further supported by the MAE values presented in
Table 9, which indicate low prediction errors in both Berlin (0.241–0.263 kWh/km) and Paris (0.165–0.179 kWh/km), confirming the robustness and adaptability of the model across diverse urban contexts.
As previously mentioned, maintaining battery health requires in EVs keeping the SoC within the optimal range of 20% to 80%. Additionally, one of the key challenges faced by EVs is the time required to charge their batteries. In certain situations, such as when a driver is in a hurry to reach their destination with a low SoC. In such cases, it is crucial for the driver to determine whether the remaining battery charge is sufficient to safely complete the journey without dropping below the critical threshold of 20% SoC. Therefore, this study focuses on addressing this scenario by proposing a solution that ensures safe arrival while effectively managing battery constraints. Specifically, the objective is to determine whether an EV can reach its destination without its SoC falling below 20% or whether a charging stop is necessary to prevent such a situation. To achieve this, the approach leverages an energy consumption prediction model to estimate the EV’s energy requirements for the trip. By subtracting the predicted energy consumption from the available energy, the remaining SoC at the end of the journey is determined. If the estimated remaining SoC falls below the 20% threshold, a charging stop is recommended; otherwise, the EV can continue without interruption.
In
Figure 9 and
Table 10, multiple scenarios were evaluated across four different traffic density levels using the selected model (Bi-LSTM + XGBoost). The objective was to predict the energy consumption of each EV, starting with an initial SoC of 25%, and to determine whether the remaining energy would be sufficient to reach the destination or if a charging stop would be required. The interpretation of each bar in
Figure 9 is summarized as follows:
Green bar: The percentage of EVs that really required charging and were accurately predicted by our model to need charging.
Blue bar: The percentage of EVs that did not require charging and were correctly identified by the model as not needing charging.
Yellow bar: The percentage of EVs that did not need charging but were incorrectly predicted by the model as requiring charging, which could cause inconvenience for drivers. However, since the drivers in this case reached their destination with a bit more than 20% battery remaining, the error can be considered somewhat acceptable.
Orange bar: This bar represents the percentage of EVs that were mistakenly predicted by the model as requiring to charge, despite having more than 22% remaining charge upon reaching their destination. Since these EVs could have completed their journey without the need to recharge, this case may lead to unnecessary charging stops, causing inconvenience and potential concerns for drivers.
Red bar: The percentage of EVs that actually required charging but were incorrectly predicted by the model as not needing charging. EVs where the SoC dropped below 20%, which is a critical issue, as the model failed to predict the need for charging despite actual requirements. However, this issue was minimal, occurring at rates of 0.16% in low traffic density, 0.3% in medium traffic density and 0.09% in high-density scenarios, indicating the model’s overall reliability in ensuring that EVs can complete their journey safely without dropping below critical SoC.
9. Performance Evaluation of the Minimum Travel Time Model for Optimal Charging Station Assignment
The results presented in this section provide a comprehensive comparison of various ML models for selecting the optimal CS based on minimum travel time predictions. The evaluated models include XGBoost regressor, Ridge Regression, Lasso Regression, Support Vector Machine (SVM), FFNN and an ensemble model that combines XGBoost regressor (50%) and FFNN (50%). Model performance was assessed using key standard metrics—MSE, MAE, RMSE and R
2—as described in
Section 5.4. These metrics quantify prediction errors, model fit and explanatory power regarding the relationships between independent and dependent variables. To determine the optimal hyperparameters for FFNN and XGBoost regressor, multiple optimization techniques were employed, including metaheuristic approaches, Bayesian optimization and Random/Grid Search techniques.
Table 11,
Table 12,
Table 13 and
Table 14 present the optimal hyperparameters and performance evaluation results for FFNN and XGBoost regressor in minimum travel time prediction. In this context, MinMaxScaler with a feature range of (0, 1) was used to normalize the data. The results indicate that Bayesian Optimization yielded the best performance for FFNN, while Randomized Search proved to be the most effective optimization method for the XGBoost regressor.
The comparative results presented in
Table 15 highlight the performance of the evaluated models. The findings show that the XGBoost regressor consistently outperformed the other models across all evaluation metrics, achieving the lowest MSE (0.0007), RMSE (0.027), and MAE (0.017), demonstrating its precision in minimizing prediction errors. The R
2 value of 0.96 further emphasizes its ability to explain 96% of the variance in the target variable, making it the most accurate and reliable model for this dataset.
Despite XGBoost’s superior individual performance, the ensemble model combining the FFNN and the XGBoost regressor—achieving MSE (0.0013), MAE (0.023), RMSE (0.034), and R2 (0.93)—was selected due to the complementary strengths of both approaches. While FFNNs excel at capturing complex, non-linear relationships in data, the XGBoost regressor effectively handles structured data and feature interactions through gradient boosting. Combining these models strikes a balance between bias and variance—FFNNs reduce bias by capturing intricate patterns, while XGBoost regressor contributes robustness and interpretability, thereby reducing variance. Moreover, the ensemble benefits from enhanced generalization by leveraging the distinct learning paradigms of FFNNs and XGBoost, improving performance on unseen data. XGBoost’s built-in regularization mechanisms further enhance the model’s robustness against overfitting. Overall, the ensemble model combines their unique advantages, resulting in superior predictive performance, improved generalization, enhanced robustness against overfitting and greater adaptability to complex datasets. This integrated approach leverages their complementary capabilities, making it a powerful and versatile solution to the minimum travel time prediction task.
In our work, we utilized the FFNN model with 50 training epochs and the XGBoost model to predict the minimum travel time for selecting the optimal CS. Through experimentation, 50 epochs were identified as the optimal choice for the FFNN model, offering a balanced trade-off between prediction performance and computational efficiency.
The total travel time (
) can be expressed as the sum of the time spent traveling and the time spent charging the L-EV at the CS, including any waiting time at the CS if no charging point is available. It can be written as follows:
where
includes the time spent by the L-EV traveling from its current position to the selected CS (
) and, once charged, the time required to reach the original destination (
).
Based on Equation (
10), the total charging time (
) spent by an L-EV at the CS, including both the waiting time in the queue and the actual charging time, is calculated as follows:
where
represents the total charging time of the EVs ahead of the L-EV in the queue at a specific CS, minus the travel time required for the L-EV to reach this CS (
);
denotes the time required for the current
to complete its charging at the specific CS;
represents the total charging time required for those EVs in the queue to receive their required amount of energy; and
n denotes the number of EVs that have reserved a slot, before the L-EV, at the specific CS and are waiting to charge. In cases where
yields a negative value, it is adjusted to zero, implying that the L-EV can begin charging immediately upon arrival, without any waiting time.
We evaluated the performance of the ML-based models designed: FFNN + XGBoost, FFNN and XGBoost, as well as the Mathematical model (T-MATH), which was derived based on Equation (
16). Furthermore, we compared the results with the actual travel time obtained from realistic simulations. We also included 90% confidence intervals, computed from five independent simulations.
Figure 10 presents the MAE for minimum travel time estimation across the four models under five scenarios with varying vehicle densities.
Figure 11 illustrates the average travel time predictions of the same models, comparing them with the actual results from the SUMO simulation (dark blue bar). In this comparison, each bar represents the average minimum travel time predicted by each model across five different scenarios for four traffic density levels. The models evaluated include FFNN + XGBoost (yellow bars), FFNN (light red bars), XGBoost (light green bars) and T-MATH (light blue bars). In both figures, 90% confidence intervals (CI) are included.
The findings reveal that the ensemble model (FFNN + XGBoost) (yellow bars) provides the most accurate predictions, closely matching the actual travel times (dark blue bars). This model achieves the best performance in estimating the shortest travel time, enabling the selection of the most suitable CS. The comparison also demonstrates significant improvements over the baseline T-MATH approach. Subsequently, a further comparison was carried out between the average travel times of the actual values, T-MATH and the proposed ensemble model (FFNN + XGBoost) in the Berlin and Paris simulation environments. As illustrated in
Figure 12 and
Figure 13, the results demonstrate the clear advantage of the ensemble model (yellow bars) over T-MATH (light blue bars), confirming its superior predictive performance and consistency under varying traffic conditions.
The T-MATH model, formulated using Equation (
16), calculates the total travel time by summing three components: the travel time from the EV’s starting point to the selected CS, the charging duration there and the travel time from this CS to the final destination. These calculations follow the routing algorithm implemented within the SUMO simulation environment. While the T-MATH model provides a structured and formulaic estimation, it lacks the flexibility and predictive accuracy of ML models—particularly the FFNN + XGBoost regressor hybrid. The results highlight each model’s predictive performance under varying traffic conditions, providing a comprehensive assessment of their effectiveness. Furthermore,
Table 16 presents the MAE and NMAE results for T-MATH, FFNN, XGBoost and the ensemble model (FFNN + XGBoost), based on simulations conducted across five distinct scenarios with four different traffic density levels. The analysis confirms that the FFNN + XGBoost hybrid model (yellow bars) consistently outperforms the other models, achieving the shortest average travel time. This demonstrates its superior ability to generalize across diverse scenarios compared to individual models (FFNN, XGBoost and the mathematically derived baseline T-MATH).
To interpret and visualize the contribution of each feature to the CS selection decision, SHapley Additive exPlanations (SHAP) analysis was applied to the ensemble model (FFNN + XGBoost), as illustrated in
Figure 14. The results reveal that the overall charging duration—including the charging time, waiting time at the CS, CS charging speed and CS charging efficiency—is the most influential factor, contributing approximately 52% to the model’s prediction.
Figure 15 compares three strategies for selecting the optimal CS: (i) the nearest CS to the EV; (ii) the nearest CS to the EV’s final destination (DS); and (iii) the CS that minimizes total travel time based on the predictive model. The figure presents the average time required for L-EVs to charge and complete their trips under four different vehicle densities. The results indicate that the minimum travel time strategy (green bars) consistently achieves the shortest trip times across all scenarios, demonstrating its effectiveness in minimizing the total travel time, including the charging stop.
Figure 16 and
Figure 17 illustrate how EVs are distributed across the deployed CSs based on different strategy types for selecting the optimal CS. The figure provides insights into the distribution of L-EVs at selected CSs under high traffic density (200 veh/km
2). Each CS has a capacity of four charging slots, and the selection process prioritizes finding an available slot. If no free slots are available, L-EVs proceed to select reserved CSs and wait in a queue. The data reveals significant congestion at certain CSs under the first and second strategies (selecting the nearest CS to the EV and the nearest CS to the EV’s final destination).
In the scenario presented in
Figure 16, the deployed CSs have heterogeneous charging power levels: CS1 operates at 50 kW, CS2 at 70 kW, CS3 at 200 kW, CS4 at 150 kW, CS5 at 320 kW, and CS6 at 100 kW. EVs take this information into account when applying the “Minimum Travel Time” strategy to select the optimal CS. Consequently, CS5 experienced significant overcrowding under this strategy, as it offers the highest charging speed. Conversely, the scenario depicted in
Figure 17 assumes homogeneous CSs, each providing a uniform charging power of 50 kW. In this case, the “Minimum Travel Time” strategy resulted in a more balanced distribution of EVs across CSs compared to the other strategies. This balance reduced congestion at specific CSs, optimized energy resource utilization and minimized waiting times. As a result, the shortest travel time strategy not only ensured the lowest overall trip durations but also facilitated a more even distribution of demand among CSs. This improved both travel efficiency for drivers and equitable utilization of charging infrastructure.
10. Conclusions and Future Work
Due to increasing concerns about climate change, urban air pollution and the growing awareness of clean energy, the demand for electric vehicles (EVs) and renewable energy generation has risen significantly in recent years. To support the transition to electro-mobility, this research introduced a smart, machine learning-driven charging coordination framework that serves as a foundation for innovative services aimed at improving EV charging efficiency and management. The framework integrates two ensemble models: Bi-LSTM combined with XGBoost for predicting EV energy consumption throughout the trip, and FFNN combined with XGBoost for selecting the optimal charging station (CS). The objective is to minimize total trip time, improve charging infrastructure utilization and enhance the driver experience. The proposed system dynamically adjusts to real-time traffic conditions to optimize charging decisions. Through realistic simulation scenarios based on SUMO and OpenStreetMap data, we generated a representative dataset of EVs requiring charging in an urban environment and validated the framework’s performance. The results demonstrated the framework’s capability to minimize total trip time, achieving a mean absolute error (MAE) between 2.29 and 4.5 min, depending on traffic conditions—substantially outperforming traditional SUMO-based and mathematical approaches. Furthermore, we analyzed the impact of several key simulation parameters to ensure a high-performance framework, accurate ML models and an efficient system for dynamic EV charging services.
The main achievements of this research are as follows:
Proposing an efficient EV charging service for urban areas, particularly when EVs are in a critical state of charge (SoC).
Addressing key challenges such as limited CS availability, CS congestion, increasing EV adoption and traffic-unaware CS selection.
Predicting EV energy consumption and optimizing the selection of energy providers.
Preventing grid overload, particularly during peak hours, due to the simultaneous charging of multiple EVs.
Encouraging EV adoption while enhancing driver comfort and satisfaction.
Designing realistic simulation scenarios, evaluating the framework’s performance and achieving high-accuracy ensemble ML models.
As future work, we aim to expand coverage to larger areas while ensuring user privacy and minimizing communication overhead during data transmission. To achieve this, we will adopt a decentralized Federated Learning approach, allowing models to be trained locally on distributed data sources without the need to transfer raw data to a central server [
67,
68].
In addition, we plan to incorporate charging price and energy source type (e.g., percentage of renewable energy) into the decision-making process for selecting the optimal CS, taking into account user profiles such as time-sensitive drivers, eco-friendly drivers, economy-focused drivers, or those seeking a balanced option. The balanced strategy will dynamically adjust based on SoC to select a CS that offers an optimal trade-off between price, charging time, and travel distance.
Finally, we plan to integrate vehicular network capabilities into our framework to enable vehicle-to-infrastructure and vehicle-to-vehicle communication, thereby enhancing battery charging services. This includes functionalities such as reserving charging slots, estimating traffic conditions, and receiving incident alerts, among other possibilities. To achieve this, we intend to incorporate additional simulators for the vehicular network protocol stack, such as OMNeT++ [
69,
70] and Veins [
71], into our framework.