1 Introduction

According to EPA (2022), a typical fuel vehicle emits about 4.6 metric tons of carbon dioxide annually. This situation generates that a vehicle on the road has a fuel economy of about 22.0 miles per gallon and drives around 11,500 miles per year (EPA 2022). Every gallon of gasoline burned creates about 8887 g of CO2. A gallon of diesel emissions is 10,180 g of CO2 (EPA 2022). Therefore, new research has recently focused on solving the vehicle routing problem by considering sustainability. Various works have advanced from basic models to formulations that better capture real situations. Environmental issues have led to updated logistics operations in the last two decades. Companies are looking for mechanisms to reduce the environmental effects of delivering goods by considering the conflict between climate change and disruptive technological advances through better planning or less polluting transportation modes.

Developed countries have implemented incentives, tax advantages, and various benefits of using vehicles with alternative fuels. Therefore, a growing research community has been generated around using electric vehicles as a sustainable alternative to conventional transportation. Recently, several approximate algorithms have been formulated based on electric vehicles. For an electric vehicle, the battery is one of its main components. The batteries have a valuable life whose longevity depends on various factors associated with their use, limiting the autonomy of vehicles. This paper studies battery electric vehicles (VEBs) with an entirely electric propulsion scheme. VEBs have high efficiency, and their driving range varies depending on the battery power capacity. The vehicle must be charged from the electrical network (Gómez-Gélvez et al. 2016).

The battery of electric vehicles constitutes approximately 1/3 of its sale price (Gómez-Gélvez et al. 2016). The lithium battery (LB) is one of the most promising technologies, with high energy and power density. A LB is light, cheap, nontoxic, and can accept fast charging (Young et al. 2015). LBs have a useful life, and their capacity decreases according to use and time. The reparation of the LB reduces their degradation and lengthens their life within the daily use of the vehicle. The main factors affecting battery degradation are the charge cycle, power, charge depth, and high temperature, among other factors (Barré et al. 2013).

This paper studies the E-VRPTW considering the recharging process's battery charge status, linearity, and non-linearity. We propose exact models based on the previous works proposed by Schneider et al. (2014) and Montoya et al. (2017) for solving the problem using benchmark instances from the literature. This paper’s main objective is to evaluate the impact of restricting recharging by comparing the linear and non-linear charging processes, limiting the battery's state of charge (SoC), and representing the energy transfer process more realistically.

Several papers have studied the EVRP, assuming that the charging battery process is only carried out in the linear portion of the recharging function, which is far from reality. Allowing the battery to charge for exceeding the threshold or the breaking point where the curve begins to degrade, generates better solutions, avoiding additional unscheduled visits to charging stations. This paper proposes a mathematical model, including the non-linearity of the stations' recharging process and the battery's degradation within different states of charge, generating less expensive solutions, represented as a decreased battery value or as a minimum number of electric vehicles composing the fleet.

The rest of the paper has been structured as follows. Section 2 describes the Literature Review section related to electric vehicles. Section 3 details the proposed mathematical model. The computational results of the benchmarking instance are shown in Sect. 4. Finally, concluding remarks and future work are described in Sect. 5.

2 Literature review

Battery University (2020) indicates that a deep discharge stresses the battery more than a partial discharge. A deep discharge of a battery occurs when the battery's capacity has been exhausted. It means that battery cells cease to function. The deep discharging process originates an increased internal resistance, making the battery difficult to charge. Indeed, the deep discharge causes 1.5–2 times as much electric discharge as the battery can support (EPPower 2023). However, a battery affected by a deep discharge could be difficult to charge. Therefore, charging a battery frequently is better than discharging it entirely. In this work, the battery's dynamic stress reflects its capacity loss for different charge and discharge band cycles.

The \(SoC\) is the current ratio of the electrical charge within the battery relative to the maximum possible charge (Pelletier et al. 2017). A charge battery cycle between 25 and 100% of battery capacity generates further degradation. Even higher than a total discharge (reach of 0%). Between 65 and 75% \(SoC\), the battery's life is extended. However, it is only possible to maintain the \(SoC\) within a margin since its autonomy would be minimal, requiring a close charging station that supplies energy every time. Between 50 and 100% \(SoC\), more than 5.000 charge and discharge cycles are achieved. However, problems associated with battery overload would arise while the vehicle's autonomy remains limited. Between 25 and 85%, the \(SoC\) (keeping the battery capacity at 60%) could reach up to 5.000 cycles and provide sufficient autonomy to carry out the delivery tasks (Pelletier et al. 2017).

Although different approaches expose the battery charge as a linear function, this situation does not occur in the real world. The charging functions are generally non-linear due to the terminal voltage and changes during the charging process (Montoya et al. 2017). In the first stage, the charging process remains constant. Therefore, the battery level increases linearly with time. The first charging phase continues until the battery terminal voltage rises to a specified maximum value. In the second phase, the energy decreases exponentially, and the voltage at the terminals remains constant to prevent damage to the battery. The battery level increases concavely over time (Pelletier et al. 2017). Generally, the behavior of the charging process is challenging to model with differential equations. However, given the difficulty, the charging functions have been approximated. One alternative is performing a piecewise linear approximation (Montoya et al. 2017).

The well-known capacity vehicle routing problem (CVRP) does not consider the action of fuel loading because it is assumed to be of unlimited accessibility (Bernal et al. 2018; Kalatzantonakis et al. 2023), which is irrelevant to the problem. However, this situation does not restrict the autonomy of vehicles whose fleets commonly consist of combustion vehicles. The extension of the EVRP considering time windows is called the E-VRPTW (Daza et al. 2009). The E-VRPTW is a challenging NP-hard combinatorial optimization problem due to its high computational complexity (Schneider et al. 2014). The E-VRPTW considers a fleet of a fixed number of capable vehicles with limited autonomy departing from a depot, where they are fully recharged. The vehicles leave the depot to serve customers and visit stations, searching for battery energy during their planning horizon and thus extending their autonomy to meet customer demand within the corresponding time window (Lin et al. 2021). In the last decade's research on the use of electric vehicles, there have been various contributions related to minimizing the fleet size or the number of recharging stations (Cataldo-Díaz et al. 2022). Generally, the published works deal with electric vehicle routing problems and their variants. Their objectives are to find the best routes considering the location of various recharging stations at different geographical points.

Schneider et al. (2014) consider the linear recharging process at stations, constant speed, and recharging time related to the battery’s remaining capacity. This paper introduces the electric vehicle routing problem with time windows and recharging stations (E-VRPTW), which incorporates the possibility of recharging at any available stations using an appropriate recharging scheme—a hybrid heuristic approach, combining a variable neighborhood search algorithm with a tabu search, has been proposed to solve the considered problem. The instances generated by Schneider et al. (2014) have been widely used to solve different variants of the EVRP. Time windows for the recharging stations have been proposed by Desaulniers et al. (2016), Keskin and Çatay (2016), Felipe et al. (2014), and Sassi et al. (2014).

Other published papers include multiple recharging options and fast charging with so–called "superchargers" (Kobayashi et al. 2011; Keskin and Çatay 2016; Felipe et al. 2014). Felipe et al. (2014) combine partial recharging with fast charging options. This work proposes several heuristics for a variation of the vehicle routing problem in which the transportation fleet comprises electric vehicles with limited autonomy. Some authors have added physical variables to the problem to attach more reality to the formulations. For example, Sassi et al. (2014) include power grid limitations. Preis et al. (2014) consider the components of resistance to air, slope, wheels, and regenerative braking. Basso et al. (2019) use coefficients with information on topography, speed, powertrain efficiency, and the effect of acceleration and braking at traffic lights and intersections. Alesiani and Maslekar (2014) restrict the number of simultaneous vehicles at recharging stations. Goeke and Schneider (2015) consider information associated with the vehicle's mass, speed, and road shape.

Several contributions consider battery recharging a linear function. However, Montoya et al. (2017) model the batteries (Sweda and Klabjan 2012). The main objective of this work is to minimize the number of routes, considering that the battery charge is always above a minimum threshold below its capacity, without allowing it to reach zero, and thus protect the battery from deep discharges. The problem of finding a minimum-cost route for an electric vehicle when it must recharge along the way is modeled as a dynamic program by Sweda et al. (2017). In particular, the optimal charge level at recharging stations along a given route significantly extends the batteries' useful life. The optimal level and the stops are determined by adding a recharging cost and a penalty factor (based on the total cost of the recharging station) to the successive and frequent stops.

Recently, the battery swap at stations has been studied by considering technological advances to reduce cost and time. Highlighted contributions on this topic have been proposed by Yang and Sun (2015), Verma (2018), and Hof et al. (2017). These works consider exchanging batteries with the stations that must be located. Yang and Sun (2015) present an electric battery swap station location routing problem (BSS–EV–LRP), which aims to determine the location strategy of battery swap stations (BSSs) and the routing plan of a fleet of electric vehicles (EVs) simultaneously under battery driving range limitation. The problem is formulated as an integer programming model under the basic and extended scenarios. Two heuristic algorithms are proposed to solve the problem (SIGALNS and TS–MCWS). Verma (2018) present a variant of the Electric Vehicle Routing Problem with Time Windows and Recharging Stations by allowing the available stations to serve both as Recharging Stations (RSs) and Battery Swapping Stations (BSSs). A model and algorithm for this problem are presented. Hof et al. (2017) propose an Adaptive Variable Neighborhood Search (AVNS) algorithm to solve the battery swap station location-routing problem with capacitated electric vehicles. Raeesi et al. (2020) introduce a new formulation that considers changing batteries through "mobile stations." Futalef et al. (2020) address the EVRP using a genetic algorithm. This work considers the limitation of the battery charge status (38% and 82% of its capacity) to safeguard its useful life and protect it from degradation. This situation affects vehicle autonomy and considers a charging infrastructure (limited capacity) and a non-linear charging function.

Xu et al. (2021) address the electric vehicle fleet size problem by considering vehicle allocation and charging strategies for profit maximization. A charge-on-demand strategy is proposed to determine the fleet size to avoid battery degradation and to achieve long-term cost savings. This work considers the nonlinear battery cost incurred during the charging and discharging. A piecewise linear approximation approach is used to linearize the problem. Reyes-Rubiano et al. (2019) analyze a real electric vehicle routing problem, considering driving range constraints and stochastic travel times. The objective function minimizes the expected cost based on the time required to complete the planned routes. Finally, Zang et al. (2022) adopt three methods of battery degradation over time, calculating the valuable life with greater precision; these are (1) a nonlinear discharge function, (2) a linear charge function and discharge cycle, and (3) a linear function of the total travel distance.

Several authors have studied diverse variants of E-VRPTW. Lebeau et al. (2015) consider time windows, vehicle capacity, and service time for customer deliveries using a mixed fleet formulation of electric vehicles. The location routing problem for electric vehicles (E–LRP) has been considered by Hof et al. (2017), Yang and Sung (2015), Qin et al. (2021), and Hulagu and Celikoglu (2021). Hierman et al. (2016) propose a formulation for the Electric Fleet Size and Mix Vehicle Routing Problem with Time Windows and recharging stations, E–FSMFTW. Van Duin et al. (2013) only consider routes with electric vehicles, determining the ideal fleet to transport a known cargo demand located at a central depot to a known set of recipients using vehicles of varying types. Conrad and Figliozzi (2011) formulated a model considering the time windows and vehicle capacity for battery recharging at customer locations for the EVRP. Erdoğan and Miller-Hooks (2012) introduced the green vehicle routing problem (green VRP), which considers the recharging of vehicles with alternative fuels, minimizing the traveled distance, and considering driving autonomy with the location of the charging stations. Finally, Omidvar and Tavakkoli Moghaddam (2012) studied the integration and the effect of traffic congestion.

Table 1 shows the research from the last decade, considering the particular characteristics of each published work and their differences from ours. The standard variables of the literature are the partial recharge time window, the penalty of deep discharge, energy overload at the stations by the transfer process, and the formulations characterizing the recharging curve as a nonlinear function.

Table 1 Main Characteristics of the published papers of the last decade.

3 Materials and methods

This section introduces the E-VRPTW. Additionally, the proposed models consider constraints on the \(SoC\) during the performed routes and the energy transfer process in the stations.

3.1 Problem description

The E-VRPTW, considering the \(SoC\) and the linearity or non-linearity of the recharging process, implies a set of geographically distributed customers that must be visited. Each customer has a specific demand and time window. A homogeneous electric vehicle fleet with a fixed capacity and limited autonomy is available at each depot to satisfy the customers. While the vehicle moves, it consumes energy proportional to the traveled distance. Therefore, the vehicle must frequently go to recharging stations distributed at various nodes. The battery must be recharged efficiently, and its energy must be managed to complete the route. The battery recharging time depends on the \(SoC\) state where the vehicle arrives at the station and the amount of supplied energy. The recharging process follows a non-linear behavior over time.

The main objective is determining the routes to be performed with the minimum cost (time). The routes must begin and end at the depot—besides, each customer must be visited once to satisfy its demand. The problem considers that a fleet’s size contributes to achieving this objective by seeking to attend the stations as few times as possible. The visits to the stations allow partial recharges, implying transferring only enough energy to complete the route (recharging efficiency), trying to avoid a deep discharge of the battery during the route, and overloading the energy transfer process. This situation extends the useful life of batteries.

3.2 Mathematical general structure

Two mixed-integer linear programming models, linear charging (Sect. 3.3) and non-linear charging (Sect. 3.4), have been proposed to solve the E-VRPTW considering the load state. Both models have a similar structure. The linear model is inspired by the work proposed by Schneider et al. (2014). Unlike those components proposed by Schneider et al. (2014), we allow partial recharge of the vehicles on stations and limitation of deep discharge. The objective function for the non-linear model is derived from Montoya et al. (2017). Unlike those proposed by Montoya et al. (2017), we consider the limitation of deep discharges and penalization of the overload of the charge on stations, improving the useful life of batteries (as usual in real-life cases). Besides, we have considered different charge rates for the section greater than 85% of \(SoC\). We have defined a variable set and specific constraints on its composition to represent the different behaviors of the \(SoC\). Although both models can solve the problem efficiently, the non-linear formulation allows for evaluating the impact generated by including the non-linearity performance of the recharging curve process. Otherwise, the linear model considers the energy transfer linearly.

Let \(V^{\prime}\) be a set of nodes with \(V^{\prime} = V \cup F\), where \(V\) denotes the set of customers, and \(F\) denotes the real and fictitious charging station. \(F = F_{R } \cup F_{{\text{F}}}\), where \(F_{R }\) corresponds to the real charging stations, and \(F_{F }\) is an array containing copies of each station to allow multiple visits (fictitious charging stations allow visiting the stations several times). The nodes \(0\) and \(N\) denote the depot from each route that starts and ends. Let be \(V_{0}^{\prime} = V \cup F \cup \left\{ 0 \right\}\) the set of nodes including charging stations and depot 0, \(V_{0} = {\text{V }} \cup \left\{ 0 \right\}\) the set of customers including the depot \(0\), \(V_{N}^{\prime} = V \cup F \cup \left\{ N \right\}\) the set of customers including charging stations and depot \(N\), and \(V_{0,N}^{\prime} = V \cup F \cup \left\{ 0 \right\} \cup \left\{ N \right\}\) includes the charging stations and depot \(0\) and \(N\).

The E-VRPTW considering the charge of the batteries could be defined with a complete directed graph \(G = \left( {V_{0,N}^{\prime} ,{\text{A}}} \right)\), with the set \(A = \left\{ {\left( {i,j} \right)| i,j \in V_{0,N}^{\prime} , i \ne {\text{j}}} \right\}\) associated with a Euclidean distance \(d_{ij}\) between nodes \(i\) and \(j\) (\(i \in V_{0}^{\prime} , j \in V_{N }^{\prime}\)) (1), and a travel time \(t_{ij}\) between nodes \(i\) and \(j\) (\(i \in V_{0}^{\prime} , j \in V_{N }^{\prime}\)), with a constant battery consumption rate \(h\) (linear model) and different battery consumption rates (non-linear model) for each traveled edge between \(i\) and \(j\) (\(i \in V_{0}^{\prime} , j \in V_{N }^{\prime}\)). The fleet comprises electric vehicles with similar characteristics, with a load capacity of \(Q\) and a battery capacity of \(C\). Each node \(i \in { }\) V is associated with a positive demand \(q_{i}\) (\(i \in V;\) is 0 if \(i \notin {\text{V}})\). Additionally, the set of nodes \(i \in { }\) V’ have a service time called \(S_{i } \left( {S_{0} ,{\text{ S}}_{{\text{N}}} = 0;{ }i{ } \in V_{0,N}^{\prime} } \right)\), and each node \(i \in { }V_{0,N}^{\prime}\) is associated with time windows \([e_{i} , l_{i} ]\) where a service cannot start before \(e_{i}\) nor after \(l_{i}\). Also, \(g\) indicates the recharging battery rate until it gets 85% of its capacity on stations (linear model) and different recharging battery rates (non-linear model). Finally, \(m\) is defined as fleet size (number of electric vehicles), and \(vel\) indicates the average driving speed.

The calculation of \(d_{ij}\) is carried out using Expressions (1). Considering that the average driving speed (\(vel\)) and the rate of energy consumption (\(h\)) are constant and have a unit value (linear model), it is possible to calculate the time between nodes (\(t_{ij} )\) and the amount of consumed energy when making this movement (\(z_{ij} )\) by Eqs. (2) and (3), respectively:

$$d_{ij} = \sqrt {\left( {x_{j} - x_{i} } \right)^{2} + \left( {y_{j} - y_{i} } \right)^{2} } \;\;\;\;\forall i \in V_{0 } , j \in V_{N}^{\prime} , i \ne {\text{j }}$$
(1)
$$t_{ij} = \frac{{d_{ij} }}{vel} \left( {{\text{seconds}}} \right)\;\;\;\;\forall i \in V_{0 } , j \in V_{N}^{\prime} , i \ne {\text{j}}$$
(2)
$$z_{ij} = d_{ij} *h \left( {{\text{kWh}}} \right)\;\;\;\;\forall i \in V_{0 } , j \in V_{N}^{\prime} , i \ne {\text{j }}$$
(3)

The \(SoC\) must not drop 25% below to avoid battery degradation. The SoC can only exceed that threshold in the final section of the route, which includes the last visited customer and the depot. The decision variables are generated with a single index, which tracks different states of the vehicle during its route. These variables are \(\tau_{i}\), indicating the arrival time (hour) at node \(i\) (\(i \in V_{0,N}^{\prime}\)), \(u_{i}\) indicating the load remaining at node \(i\), and \(y_{i}\) the remanent capacity of the battery \(SoC\) (battery's state of charge) at node \(i\), where \(i \in {\text{V}}_{{0,{\text{N}}}}^{\prime}\). Additionally, \(w_{i }\) is defined as the amount of supplied energy to the battery at charging station \(i\), with a transfer rate \(g\) (linear) and different rates (non-linear), allowing the battery to be recharged up to 85% of its capacity, where \(i \in F\).

The non-linearity of the recharging process incorporates new variables representing the behavior of the real recharging curve, generating the possibility of exceeding the recommended maximum threshold of the \(SoC\) (85%) and assuming its cost (time). The value of \(p_{i }\) is defined as the supplied energy between 85 and 95% of the recharging curve at a transfer rate \(G\), and \({\text{b}}_{{\text{i }}}\) includes the supply of 95–100% of the curve at a rate \(R\). The binary decision variable \(x_{ij}\) with \(i \in V_{0}^{\prime} , j \in V_{N}^{\prime}\) takes the value 1 if the edge is traversed and 0 otherwise.

The objective function seeks to minimize the total time of the routes, considering the travel time between nodes, the recharging time of the batteries, and the service time. Likewise, the optimal fleet size is calculated for the considered problem. Therefore, given a fleet of vehicles, it could be reduced by considering the optimal number of electric vehicles.

3.3 Mathematical model assuming lineal recharge time

The linear model restricts the deep battery discharge to 25% of its capacity, prioritizing surface discharge. It allows partial recharges at the stations. However, an upper threshold is defined to limit the overload of the energy transfer process, which maintains the \(SoC\) within the recommended range. This range is set to [25–85%], considering 60% autonomy, which, according to the dynamic stress tests carried out by Battery University (2020), would allow the long-term battery life to be extended. A linear recharge process is assumed, where energy is transferred to the battery at a rate of \(g\). The time for this process depends on the \(SoC\) at the station and the amount of supplied energy. The mathematical model is expressed by (4)–(23):

$$Min Z = \mathop \sum \limits_{{i \in V_{0 }^{\prime} , j \in V_{N}^{\prime} , i \ne {\text{j}}}} t_{ij} x_{ij} + \mathop \sum \limits_{{i \in {\text{F}}}} g w_{i} + \mathop \sum \limits_{{i \in V_{0 }^{\prime} , j \in V_{N}^{\prime} , i \ne {\text{j}}}} S_{j} x_{ij}$$
(4)

Subject to

$$\mathop \sum \limits_{{ j \in V_{N }^{\prime} , i \ne {\text{j}}}} x_{ij} = 1 \;\;\;\;\forall i \in V$$
(5)
$$\mathop \sum \limits_{{ j \in V_{N }^{\prime} , i \ne {\text{j}}}} x_{ij} \le 1 \;\;\;\;\forall i \in F$$
(6)
$$x_{0N} = 0$$
(7)
$$\mathop \sum \limits_{{ i \in V_{ }^{\prime} }} x_{0i} \le m$$
(8)
$$x_{ij} = 0\;\;\;\;\forall i \in F, j \in F$$
(9)
$$\mathop \sum \limits_{{i \in V_{N }^{\prime} , i \ne {\text{j}}}} x_{ji} - \mathop \sum \limits_{{i \in V_{0 }^{\prime} , i \ne {\text{j}}}} x_{ij} = 0\;\;\;\;\forall j \in V^{\prime}$$
(10)
$${\uptau }_{i} + { }\left( {{\text{t}}_{ij} + S_{i} } \right)x_{ij} - l_{0} \left( {1 - x_{ij} } \right) \le {\uptau }_{j} \;\;\;\;\forall i \in V_{0 } , j \in V_{N}^{\prime} , i \ne {\text{j }}$$
(11)
$${\uptau }_{i} + {\text{ t}}_{ij} x_{ij} + g w_{i} + S_{i} - \left( {l_{0} + gC} \right)\left( {1 - x_{ij} } \right) \le {\uptau }_{j} \;\;\;\;\forall i \in F, j \in V_{N}^{\prime} , i \ne {\text{j }}$$
(12)
$$e_{j} \le {\uptau }_{j} \le l_{j} \;\;\;\;\forall j \in V_{0,N}^{\prime}$$
(13)
$$u_{j} \le u_{i} - q_{i} x_{ij} + Q\left( {1 - x_{ij} } \right)\;\;\;\;\forall i \in V_{0 }^{\prime} , j \in V_{N}^{\prime} , i \ne {\text{j }}$$
(14)
$$u_{0} \le Q$$
(15)
$${\text{y}}_{j} \le {\text{y}}_{i} - {\text{ z}}_{{{\text{ij}}}} x_{ij} + C\left( {1 - x_{ij} } \right)\;\;\;\;\forall i \in V_{0 } , j \in V_{N}^{\prime} , i \ne {\text{j}}$$
(16)
$${\text{y}}_{j} \le \left( {{\text{y}}_{i} + w_{i} } \right) - {\text{ z}}_{{{\text{ij}}}} x_{ij} \;\;\;\;\forall i \in F, j \in V_{N} , i \ne {\text{j}}$$
(17)
$$\left( {C*0.25} \right) \le y_{i} \;\;\;\;\forall i \in V^{\prime}$$
(18)
$$\left( {{\text{y}}_{i} + w_{i} } \right) \le \left( {C*0.85} \right)\;\;\;\;\forall i \in F$$
(19)
$$y_{0} \le C\;\;\;\;\forall i \in V_{0}^{\prime} , j \in V_{N }^{\prime}$$
(20)
$$x_{ij} \in \left\{ {0,1} \right\}\;\;\;\;\forall i \in V_{0}^{\prime} , j \in V_{N }^{\prime}$$
(21)
$${\uptau }_{{\text{i}}} , u_{i} , y_{i} \ge 0\;\;\;\;\forall i \in F$$
(22)
$$w_{i} \ge 0\;\;\;\;\forall i \in F$$
(23)

Equation (4) is the objective function and minimizes the total time of the routes, considering the travel time between nodes, the recharging time of the battery at the stations, and the service time at the customer's location and the recharging stations. For the linear model, we assume that the energy transfer curve is linear and limited to 85% of the maximum battery capacity (\(SoC\)). Equations (5) guarantee customer connectivity, allowing only one edge to travel to another customer, the recharging station, or the final depot.

Equations (6) allow an output edge to another customer or depot from the recharging station. In addition, Expression (7) does not allow a connection between depots. Equation (8) determines the number of electric vehicles leaving the depot. Constraints (9) prevent the existence of consecutive recharges, restricting immediate visits to charging stations. Equations (10) ensure the continuity of the route considering a flow equilibrium. Indeed, the number of output edges must be equal to the number of input edges at each node. Equations (11) address the edges' temporal viability, leaving the customers and the depot. These expressions consider the arrival, service, and travel times between nodes. Constraints (12) guarantee the temporary viability of the vehicles leaving the charging station, considering the service time to recharge the battery. Equations (13) guarantee compliance with each node’s time window, including the depot. Expressions (11), (12) and (13) are responsible for eliminating the subtours. Equations (14) and (15) ensure compliance with customer demand.

Expressions (16) control the \(SoC\) of the depot and the customers, considering the energy consumption between nodes. Constraints (17) control the \(SoC\) when arriving and leaving the station, recharging only enough energy to continue the route. Equations (18) indicate the value of \(SoC\). The \(SoC\) cannot decrease below 25% of its total capacity. Constraints (19) define a maximum threshold to charge the battery in a station (85% of its capacity). Equations (20) determine the \(SoC\) at the initial depot. Expressions (21)–(23) define the nature of the decision variables.

3.4 Mathematical model considering the nonlinearity of the energy transfer process

The non-linear formulation, similar to the linear mathematical model, restricts the battery's deep discharge, allows partial recharging, and does not limit overcharging. The transfer of energy follows a non-linear curve over time. We have extended the linearization of the recharge curve proposed by Montoya et al. (2017) for the EVRP without considering a limited deep discharge to our problem by dividing the non-linear behavior into three linear sections. For the non-linear model, a recharge rate given in \({\text{h}}/{\text{Wh}}\) is assigned to each defined section, representing the real–time (\({\text{h}}\)) the vehicle must pass through the station according to the amount of supplied energy (\({\text{Wh}}\)) to the battery. When the threshold of 85% (\(SoC\)) is exceeded, the time begins to increase non-linearly due to the curve's concavity at that breakpoint, generating a more significant impact on the objective function. Therefore, it is necessary to decide if it is convenient to access the upper sections of the curve (exceeding 85% \(SoC\)) and assume the cost (time), or attend a more significant number of stations and thus fulfill the task of delivering goods within the recommended charging interval (25% and 85%).

The stations define a single recharging option for the present work. The slow recharge curve represents the nonlinear behavior in Fig. 1. The breakpoints are assumed to be 85%, 95% and 100%.

Fig. 1
figure 1

Source: Owner

Piecewise linear approximation recharge rate.

Figure 2 shows the recharge curve. We assign a letter representing each section according to the corresponding recharge rate. Therefore, it is possible to define the sections of the recharge curve for the development of the proposed approach:

  • 25–85% \(SoC\), recharging rate \(g \left( {\frac{{\text{h}}}{{{\text{Wh}}}}} \right)\) (less degradation of the battery).

  • 85–95% \(SoC\), recharging rate \(G\left( {\frac{{\text{h}}}{{{\text{Wh}}}}} \right)\).

  • 95–100% \(SoC\), recharging rate \(R\left( {\frac{{\text{h}}}{{{\text{Wh}}}}} \right)\).

Fig. 2
figure 2

Source: Owner

Model (a), Instance R203C10_S5. Mathematical model assuming limited lineal recharge time.

Note that the proposed mathematical model is flexible and can be adapted by adding more letters considering different recharging sections. In addition, based on the slopes obtained between the breakpoints, it is possible to define the equivalence between the recharge rates of the upper sections concerning the first fraction of the curve (25–85%). We defined the following values of the recharging rate:

$$G = 2.5*g$$
(24)
$$R = 6.25*g$$
(25)

The values of the battery recharging rate \(G\) and \(R\) are generated for instances based on different existing battery charging technologies (Anseán et al. 2013; Zhu et al. 2019; He et al. 2020; Duru et al. 2021; Al-Saadi et al. 2021), including fast chargers that are very useful during daytime operations and slow chargers that can be used at night. The different values can be found in Tables 2, 3, 4, 5, 6.

Table 2 Main parameters of instance R203C10_S5.
Table 3 Summary of the obtained results for five customers.
Table 4 Summary of the obtained results for ten customers.
Table 5 Summary of the obtained results for fifteen customers.
Table 6 Main parameters of instance tc0c10s3ct1.

3.4.1 Notation

The non-linear model considers the same sets and parameters as the linear model. However, the following parameters and variables referring to energy recharge in the upper sections of the curve are added.

\(G =\) Battery charging rate for the section 85–95% SoC.

\(R =\) Battery charging rate for the section 95–100% SoC.

\(p_{i} =\) Amount of supplied energy to the battery at charging station \(i\) considering a recharging rate \(G\) (\(i \in F\)).

\(b_{i} =\) Amount of supplied energy to the battery at charging station \(i\) considering a recharging rate \(R\) (\(i \in F\)).

The mathematical formulation is the following:

$$Min Z = \mathop \sum \limits_{{i \in V_{0}^{\prime} , j \in V_{N}^{\prime} , i \ne j}} t_{ij} x_{ij} + \mathop \sum \limits_{i \in F} g (w_{i} - p_{i} - b_{i} ) + \mathop \sum \limits_{{i \in V_{0}^{\prime} , j \in V_{N}^{\prime} , i \ne j}} S_{j} x_{ij} + \mathop \sum \limits_{i \in F} G* p_{i} + \mathop \sum \limits_{i \in F} R* b_{i}$$
(26)

Subject to

$${\uptau }_{i} + {\text{ t}}_{ij} x_{ij} + g( w_{i} - p_{i} - b_{i} ) + G* p_{i} + R*b_{i} + S_{i} - \left( {l_{0} + gC} \right)\left( {1 - x_{ij} } \right) \le {\uptau }_{j} \;\;\;\;\forall i \in F, j \in V_{N}^{\prime} , i \ne {\text{j}}$$
(27)
$$\left( {{\text{y}}_{i} + w_{i} } \right) \le \left( {0,85*C } \right) + p_{i} + b_{i} \;\;\;\;\forall i \in F$$
(28)
$$p_{i} \le 0,1*C\;\;\;\;\forall i \in F$$
(29)
$$b_{i} \le 0,05*C\;\;\;\;\forall i \in F$$
(30)
$$g < G < R$$
(31)
$$p_{i} , b_{i} \ge 0\;\;\;\;\forall i \in F$$
(32)

Additionally, to constraints (5)–(11), (13)–(18) and (20)–(23).

Objective function (26) is similar to the linear model. However, it includes the time to recharge the battery at the station, following a non-linear behavior, and considering a penalty for exceeding the threshold of 85% and 95% \(SoC\). Equations (27) guarantee the temporary viability of the edges leaving the station, considering the energy transfer time to the battery and the recharge rate for each section of the curve. Equations (28) define a maximum threshold to recharge the battery, corresponding to 85% of its total capacity. However, the model allows the option of exceeding that limit if needed. Equations (29) limit the second section of the recharging curve (85–95%) to 10% of the battery capacity. Equations (30) limit the third section of the recharging curve (95–100%) to 5% of the battery capacity. Equation (31) guarantees that the curve's recharge rate is higher in the upper sections. Finally, Eqs. (32) define the nature of the decision variables.

Defining the number of electric vehicles (\(m\)) for the complete fleet is necessary to solve the problem by replacing objective functions (4) and (26) with (33).

$$Min Z = \mathop \sum \limits_{{j \in {\text{V}}^{\prime} }} x_{0j}$$
(33)

Equation (33) minimizes the number of vehicles leaving the depot.

4 Computational experiments

This section presents the obtained computational results. First, the problem is solved using the benchmarking instances proposed for the EVRP by Schneider et al. (2014). Some additional parameters have been added. Both models are tested to clearly show the impact of the non-linearity of the recharge curve and to evaluate their behavior concerning fleet size, route distribution, and the total time of the routes. New input data have been added for the second set of instances proposed by Montoya et al. (2017).

The proposed models have been implemented in the Julia programming language and solved using the commercial solver Gurobi Optimizer version 9.5.0. The computer used where the experiments were carried out has the following characteristics:

  • Processor Intel® Core™ i7-7700 K CPU @ 4.2 GHz

  • Memory (RAM) 32 GB

  • Type of System: 64 Bit Operation System, processor × 64.

4.1 Set of instances by Schneider et al. (2014)

For this set of instances, different distributions, numbers of customers, and recharging stations have been considered to determine the proposed models' efficiency. An associated service time on each visit to a station (34) is assumed.

$$S_{i} = 10\;\;\;\;\forall i \in F$$
(34)

The instances consider 5, 10 and 15 customers, whose distribution can be considered in three ways: “C” (grouped customers), “R” (randomly distributed customers), and “RC” (grouped and randomly distributed customers) (Schneider et al. 2014). The minimum fleet size (\(m\)) calculated according to (33) is presented. The number of vehicles has been estimated using the linear model’s expressions to evaluate the possibility of reducing the fleet size by considering the nonlinear recharging behavior. The matrices corresponding to the distances, travel times and energy consumption between nodes present equivalent values for this case. Next, Figs. 2 and 3 present the solution of the instance R203C10_S5 described by the two proposed models. Table 2 shows the main parameters of the R203C10_S5 instance.

Fig. 3
figure 3

Source: Owner

Model (b), Instance R203C10_S5. Mathematical model considering nonlinearity in the energy transfer process.

4.2 Summary of results for all test instances

Tables 3, 4, 5 summarize the obtained results for the two proposed models on instances of different sizes and distributions.

4.3 Analysis of results by Schneider et al. (2014)

Based on the computational experiments carried out on instances of 5, 10, and 15 customers, we note that the non-linear model (b) can find feasible and optimal solutions (Gap of 0%) for all the instances proposed by Schneider et al. (2014). However, the linear formulation (a) could only achieve 92% of the cases. This fact is mainly due to the limitation of the \(SoC\) since the linear model grants only 60% autonomy (25–85% \(SoC\)) to develop the routes.

For any customer distribution, the computing time considering five customers is less than a second for both models. The non-linear model (b) cannot reduce the fleet size for 63% of all the cases. Additionally, the objective function decreases as the number of visits to the recharging stations due to the energy transfer process exceeds 85% \(SoC\) (60% of the cases). For the non-linear model, this situation allows accessing the curve's upper reaches and generating savings (travel time + service time + recharge time) by not visiting a new station.

The objective function does not decrease for the non-linear model in 40% of the cases, keeping the performed routes. Besides, the number of vehicles decreases with an increment of the objective function for the 37% of instances with five customers (non-linear model). This situation is generated mainly due to a growth in the number of times electric vehicles exceed the threshold of 85% SoC and attend a new station searching for energy to try to supply the reduced number of vehicles.

The fleet size is kept for 63% of cases by considering instances with ten customers and solving the non-linear model. Besides, for these cases, the objective function and the number of visits to the charging stations are reduced. The reduction of the objective function is directly related to the possibility of accessing the upper sections of the non-linear recharge curve. The number of vehicles is reduced for 37% of the instances by executing the non-linear model, and the objective function value increases for 75% of the cases.

The computing time for both models is strictly related to the particular distribution of the parameters. The computing times range from a minimum of 1 to a maximum of 249 s. Finally, for the non-linear model, the number of electric vehicles is maintained, and the total time decreases since the algorithm unnecessarily recharges vehicles to increase their autonomy by overcharging the battery (> 85% \(SoC\)).

4.4 Set of instances by Montoya et al. (2017)

Montoya et al. (2017) solved the EVRP with a non-linear objective function. The authors propose a benchmarking set of 120 different instances. For the E-VRPTW, we have selected the instances that can be solved within a reasonable time (7200 s). The structure of the instances proposed by Montoya et al. (2017) is the following:

  • Customers are evenly distributed, clustered, or a mix of both.

  • Recharging stations are located using the P-median heuristic or randomly.

  • There is not a time window for customers.

  • The vehicles have a given time for performing a route.

  • The actual recharging curve of a commercial battery is provided.

  • Slow, moderate, and fast recharge options are considered.

  • There is no vehicle capacity.

  • The demand is unitary.

We have performed the following analyses:

  • The maximum time of each route corresponds to the upper time window of the final depot, thus ensuring that all vehicles composing the fleet arrive at the depot before the established time.

  • The service time is considered both by customers and in recharging stations (as instances generated by Schneider et al. 2014).

  • There is only one recharge option at the station.

4.4.1 Description of the set of instances

An example of a structured instance is formulated based on the distribution of nodes by Montoya et al. (2017). The instance tc0c10s3ct1 considers ten customers and three charging stations, where both sets are randomly distributed. Table 6 shows the details of the input data.

The set of instances by Montoya et al. (2017) is solved using the non-linear model because it can represent the behavior of the recharge curve. A scenario is proposed in which the maximum time of each route decreases to 8 h, representing a typical effective working day. Figures 5 and 6 graphically show the results when solving the tc0c10s3ct1 instance. Table 7 shows the solution in some instances where the customers and stations are uniformly distributed. The associated curves are shown in Figs. 4, 5, and 6.

Table 7 Obtained results for a set of instances by Montoya et al. (2017).
Fig. 4
figure 4

Source: Owner

Piecewise linear approximation with slow recharging.

Fig. 5
figure 5

Source: Owner

Piecewise linear approximation with moderate recharging.

Fig. 6
figure 6

Source: Owner

Piecewise linear approximation, fast recharging.

4.5 Analysis of obtained results on set of Montoya et al. (2017)

The non-linear model can solve the instances within a reasonable time by reducing the maximum time of each route to 8 h, regardless of the charging station. For 84% of the instances, the fleet size was maintained or increased to comply with the limitation for each associated route. The fast-charging option reduces the total time compared to the other scenarios where the curve is slow or moderate.

For 100% of the cases, the vehicles exceeded the threshold of 85% \(SoC\), increasing their autonomy and avoiding new visits to recharging stations. In 75% of the cases, the number of vehicles was reduced since, by reducing the recharging time, the vehicles extended their range within the maximum defined time. Generally, reducing the number of vehicles composing the fleet is possible. However, the objective function could increase since the number of edges must increase due to a fleet with fewer vehicles. Moreover, the size of the instance and the distribution of customers and charging stations directly affect the solution time of the model. Figures 7 and 8 show the obtained results considering ten and eight-hour solutions, for instance, tc0c10s3ct1.

Fig. 7
figure 7

Source: Owner

Model (b), Maximum time 10 h, instance tc0c10s3ct1.

Fig. 8
figure 8

Source: Owner

Model (b), Maximum time 8 h, instance tc0c10s3ct1.

We have performed a sensitivity analysis of the non-linear model to analyze the effect of the energy threshold and the charging rate on the objective function. Four experiments have compared the objective function and computing time results. Tables 8 and 9 summarize the obtained results by the performed experiments considering the following notation:

  • Objective Value Base: Objective function obtained with the original parameters (results described in Tables 3, 4, 5)

  • Objective Value Case 1: Objective function obtained considering complete deep discharge until arriving at 0% \(SoC\) (i.e., relaxing the constraints of full deep discharge)

  • Objective Value Case 2: Objective function obtained considering linear recharge until arriving 100% \(SoC\) (i.e., imposing linear charging rate of the non-linear model for the part 85% –100% \(SoC\))

  • Objective Value Case 3: Objective function obtained considering a factor of 1.10 instead of “2.5” for Eq. (24) and a factor of 1.20 instead of “6.25” for Eq. (25).

  • Objective Value Case 3: Objective function obtained considering a factor of 1.25 instead of “2.5” for Eq. (24) and a factor of 3.125 instead of “6.25” for Eq. (25).

  • Time OF Base: Time required to obtain Objective Value Base.

  • Time OF Case 1: Time required to obtain Objective Value Case 1.

  • Time OF Case 2: Time required to obtain Objective Value Case 2.

  • Time OF Case 3: Time required to obtain Objective Value Case 3.

  • Time OF Case 4: Time required to obtain Objective Value Case 4.

Table 8 Obtained results by considering a sensitivity analysis of the energy threshold.
Table 9 Obtained results by considering a sensitivity analysis of the charging rate.

Table 8 shows obtained results by considering the effect of the energy threshold. Note that naturally, the objective function decreases, relaxing some constraints. Table 9 shows the obtained results for different charging rates. Indeed, considering a significant charging rate, the objective function increases according to (26). This performance is independent of the type of set of instances.

5 Concluding remarks and future work

This paper studies the E-VRPTW considering the battery charge state and the linearity and nonlinearity of the recharging process. The impact of solving the problem by considering an efficient recharge process avoiding deep discharge has been considered. Additionally, scenarios have been implemented restricting the autonomy of electric vehicles through recommended charge and discharge intervals to extend the useful life of the batteries. In addition, this paper considers the non-linear component of the recharging process and thus studies its behavior with the fleet size, total time, and the number of visits to the recharging stations. Using benchmarking instances, two mathematical models are compared (linear and non-linear) to represent the recharging process.

Based on the obtained results, it is possible to conclude that the proposed models accurately represent the different behaviors of the battery charge status and can quickly find optimal solutions for small instances. The obtained results demonstrate that the inclusion of nonlinearity in the recharging process produces a reduction in the total time of the routes due to the threshold of 85% (\(SoC\)) being exceeded by accessing the upper sections of the curve, producing more significant degradation and, at the same time, greater autonomy. Therefore, avoiding unnecessary visits to recharging stations is possible, reducing the distance traveled. In some cases, the objective function increases, but the fleet size decreases, fulfilling customers' demand with a minimum number of vehicles.

Future work should focus on studying the different variants of the problem and adding new variables to convert the problem into a rich electric vehicle routing problem (electric vehicle routing problem by considering real-life constraints and computational and operational real implementation schemes). The scope can be extended by incorporating heterogeneous fleets or different types of batteries. Likewise, it is possible to limit the capacity of the electrical network, the number of vehicles simultaneously recharging, the geographical layout of the land, consider the energy from the regenerative brake, and include traffic constraints, among other adjustments. However, heuristic techniques such as those based on a granular search aspect could be considered for solving significant problems. Granular search approaches within trajectory-based metaheuristics allow for generating high-quality solutions within short computing times for vehicle routing problems (Bernal et al. 2017, 2018, 2021; Escobar 2014; Linfati et al. 2014; Escobar et al. 2017, 2022).