A Two-Echelon Electric Vehicle Routing Problem with Time Windows and Battery Swapping Stations

: Driven by the new laws and regulations concerning the emission of greenhouse gases, it is becoming more and more popular for enterprises to adopt cleaner energy. This research proposes a novel two-echelon vehicle routing problem consisting of mixed vehicles considering battery swapping stations, which includes one depot, multiple satellites with unilateral time windows, and customers with given demands. The fossil fuel-based internal combustion vehicles are employed in the ﬁrst echelon, while the electric vehicles are used in the second echelon. A mixed integer programming model for this proposed problem is established in which the total cost, including transportation cost, handling cost, ﬁxed cost of two kinds of vehicles, and recharging cost, is minimized. Moreover, based on the variable neighborhood search, a metaheuristic procedure is developed to solve the problem. To validate its effectiveness, extensive numerical experiments are conducted over the randomly generated instances of different sizes. The computational results show that the proposed metaheuristic can produce a good logistics scheme with high efﬁciency.


Introduction
With the development of industrialization and urbanization, the significant increase in greenhouse gas (GHS) emissions caused by overexploitation of a large number of fossil fuel resources has led to increasingly serious air pollution in cities recently. For example, in January 2013, a large-scale haze continued to cover Central and Eastern China [1]. Since the emission was owed to large fossil fuel-based internal combustion vehicles (ICVs), this is identified as the main cause for fog haze weather, and large ICVs with heavy loads are starting to be prevented from entering urban areas by more and more governments in China. Thus, it is quite common now that large ICVs are only permitted to transport demands from the depots located in the suburbs of cities to the satellites near customers, while small vehicles with lower emissions (e.g., electric vehicles) are employed to transport demands from satellites to customers, which arouses the interests of the investigators in the two-echelon vehicle routing problems (2E-VRP) [2].
Due to the environmental advantages, electric vehicles (EVs) have gradually played an important role in transportation. The environmentally friendly features of EVs, such as free of GHG, lower noise pollution, and higher energy efficiency, can help transportation companies to gain a green image or even subsidies for environmental protection. The governments of China, the US, Japan, the EU, and other countries have strongly promoted the use of EVs and encouraged supply chains to apply EVs in constructing a sustainable logistics distribution network [3]. As early in 2008, EVs were introduced in Beijing to serve the transportation of the Olympic Games. Similarly, in Vienna, fully electric vehicles have been operating for several years. In 2017, Shenzhen, China replaced more than 16,300 buses in the city with EVs, making it the city with the largest fleet of EVs in the world [4]. As one of the largest e-commerce companies in China, JD.com (accessed on 1 September 2019) is gradually replacing its existing vehicles with EVs [5]. In 2018, the amount of EV ownership in China was ranked first in the world [6]. Furthermore, EV sharing systems are being considered recently [7]. The routing problem considering EVs has become a research hotspot [8].
In this work, a new two-echelon vehicle routing problem with time windows, including one depot, multiple satellites, and customers, as well as several battery swapping stations (BSSs), noted as 2E-EVRPTW-BSS, was considered. Compared with existing investigations, two new features of the problem can be highlighted. First, considering the limited capacity of EV batteries, insufficient charging installations for long-distance transportation, as well as transportation efficiency, the mixed-fleet scheme is considered. That is, conventional heavy-loaded trucks are used from the depot, which is usually far away from the urban area, to the satellites, which are supposed to be located around the urban fringe, for the first echelon, while EVs are employed from the satellites to the customers within the city for the second echelon due to the environmental considerations or regulations. Secondly, the optimization of the transportation strategies of the two echelons is effectively linked via the time constraint of the satellites as an intermediate, while they are usually optimized separately according to previous research. This is essential to reduce or even avoid the waiting time of the demands at satellites in real life. A hybrid metaheuristic based on the variable neighborhood search (VNS) is developed to solve this new problem, which has been proven to be both effective and efficient by extensive numerical experiments.
The rest of the research is organized as follows. In Section 2, a review of the related literature is introduced. In Section 3, a mixed integer linear programming model is proposed to formulate the problem under consideration. Section 4 details the proposed algorithm for solving this 2E-EVRPTW-BSS, while numerical experiments are carried out and analyzed in Section 5. Finally, Section 6 summarizes the conclusions of this paper.

Literature Review
The problem of 2E-EVRPTW-BSS mainly includes two streams of concerns: the electric vehicle routing problem (EVRP) and the two-echelon vehicle routing problem (2E-VRP). Hence, the survey is organized from these two aspects.

Related Research on the EVRP
Considering the threat of generated pollution in the transportation system, research on the Green Vehicle Routing Problem (GVRP) has become a hot issue [9]. As an extension of the GVRP, the EVRP has been studied for many years, such as by Cru-Chávez et al. [10] and Cattaruzza et al. [11]. In the past ten years, with the popularity of EVs around the world, there has been a myriad of research carried out on the use of EVs in the field of the transportation system [12].
The first to consider optimization algorithms for EVs were Conrad and Figliozzi [13]. In their paper, the batteries of EVs can be recharged at customer locations with extra recharging costs. The research regarding the technical and market background of EV demand distribution, as well as a review of EVRP's research work were presented by Pelletier et al. [14]. The main studies on EVs in the field of transportation research were summarized in their work. Many advantages provided by EVs were given by them, such as frequent stop-and-go, low driving speed, and reduction in air pollution. Time window constraints for customer delivery and restrictions on recharging stations (RSs) were studied by Schneider et al. [15]. Four variants of the EVRP considering time windows categorized by the allowable charging times of each route and the battery charging scheme (full recharge or partial recharge) were studied by Desaulniers et al. [16]. The BSS location routing problem with capacitated EVs, which aims to determine the locations of BSSs and their routing plan, was proposed by Yang and Sun [17]. An online routing problem regarding EVs was presented by Adler and Mirchandani [18]. Their aim was to make an occasional detour for vehicles by booking a battery to benefit future vehicles, thereby minimizing the average delay of all vehicles. For a given EV transportation network, how to achieve the solution with the shortest transportation time was stated in Liao et al. [19]. From an environmental perspective, Zhang et al. [20] studied EVRP considering RSs to find the minimized energy consumption routing plan. Karakatič [21] considered the nonlinear recharging times at stations and optimized the EVRPTW with multiple depots. Raeesi et al. [22] researched the Electric Vehicle Routing Problem with Time Windows and Synchronized Mobile Battery Swapping (EVRPTW-SMBS), which considered Battery Swapping Vans to recharge EVs in a designated time and space.
A branch-price-and-cut algorithm proposed by Desaulniers et al. [16] aimed to optimally solve four variants of the problem in their work. They also found the optimal solution for instances with up to 100 customers and 21 RSs. However, the EVRP was more commonly solved by heuristics. The electric vehicle routing problem considering time windows and recharging stations (E-VRPTW) was stated by Schneider et al. [15] and the hybrid heuristic combining VNS and Tabu search was considered to solve the E-VRPTW. To solve the BSS location routing problem involving capacitated vehicles, methods on how to extend algorithms to the vehicle routing problems considering intermediate stops were shown in Hof et al. [23]. Their work improved the best solutions previously found for the instances of Yang and Sun [17] by using the proposed extended adaptive variable neighborhood search (AVNS) algorithm. An adaptive large neighborhood search (ALNS) algorithm was introduced by Keskin and Çatay [24] for the EVRP considering partial recharging. Breunig et al. [25] applied EVs in the second echelon of the two-echelon transportation system, which was named as the electric two-echelon vehicle routing problem (E2EVRP).

Related Research on the 2E-VRP
The two-echelon vehicle routing problem (2E-VRP) can be regarded as a special case of the two-echelon location routing problem (2E-LRP), where the locations of the depots and satellites are usually given. Cuda et al. [26] gave the review of the 2E-VRP and the 2E-LRP. The routing problem was first applied to the two-echelon transportation system by Jacobsen and Madsen [27]. After that, the definition of a 2E-VRP was given by Crainic et al. [28]. The 2E-VRP transportation system was first proposed in Perboli et al. [29]. According to their research, it can be concluded that a mathematical model of the 2E-VRP based on the flow of the demand of each arc was first introduced. Constraints such as time windows of customers and synchronization were considered in the 2E-VRP in Grangier et al. [30]. Li et al. [31] considered the real-time transshipment capacity variation of the 2E-VRP, and in their work, a mathematical model was given. Some exact algorithms were adopted to solve the 2E-VRP, and they can be found in Jepsen et al. [32], Baldacci et al. [33], and Santos et al. [34]. However, most of the 2E-VRPs were solved by heuristics. Crainic et al. [35] introduced a multi-start heuristic that solved the two-echelon transportation subproblems iteratively. Breunig et al. [36] proposed the large neighborhood search (LNS) combined with local search to solve the 2E-VRP and only applying ICVs both in two echelons. An adaptive large neighborhood search (ALNS) algorithm with kinds of destroy and repair operations was proposed by Hemmelmayr et al. [37] to solve the problem. Wang et al. [38] combined the VNS algorithm and the integer programming algorithm to solve the two-echelon capacitated vehicle routing problem with environmental considerations (2E-CVRP-E). Kitjacharoenchai et al. [39] presented a new two-echelon routing problem, which considered a synchronized truck-drone operation by allowing several drones to fly from a truck. Boysen et al. [40] presented and discussed research on the last-mile delivery.
The EVRP and the two-echelon network issues have drawn more and more public attention in academic research and practical application in the literature. In order to determine the urban distribution strategy under the limit of battery range, Jie et al. [41] first studied the 2E-VRP in the context of EV application. Breunig et al. [25] used EVs in the secondechelon transportation, and they observed that the detour miles due to recharging decrease as a function of the charging stations' density; however, they did not consider the time windows of customers and the unilateral time windows of satellites. Considering that most distribution companies follow the customer-oriented service standard nowadays, how to satisfy the requests of customers, such as time windows, is more important. For the twoechelon transportation system, studying unilateral time windows of satellites can avoid extra wait at satellites for vehicles. Wang et al. [42] proposed the mathematical model of the 2E-VRP in the context of ICV and EV application, which considered the time windows.
Based on the survey, it is not difficult to find that only a limited number of papers with a focus on 2E-VRP involving EVs, where the research on the mixed fleet and integrated optimization for two echelons are rare. Motivated by the state of the art of the investigations and the managerial requirements from the real applications, this paper aims at providing a new solution to this problem.

Problem Description
The 2E-EVRPTW-BSS system considers a depot, multiple satellites, a number of customers with deterministic demands, and a group of BSSs that have no restrictions on the capacity of EVs. In addition, the positions of all these nodes have been given and fixed.
Heavy loaded ICVs are employed in the first echelon to transport demands from the depot to each satellite, while EVs are considered in the second echelon to transport demands from satellites to each customer, as depicted in Figure 1. EVs are supposed to have a limited driving range and have to visit BSSs to swap their batteries before they run out of battery power. In addition, to promise the timeliness of delivery, this work also considers the time windows of customers, which in turn require the latest arrival time of ICVs at the satellites, i.e., there is also a time window for the arrival time of ICVs at each satellite. The 2E-EVRPTW-BSS aims to minimize the total costs, including the transportation cost of two echelons, fixed cost of the vehicles, and battery swapping cost. that most distribution companies follow the customer-oriented service standard days, how to satisfy the requests of customers, such as time windows, is more imp For the two-echelon transportation system, studying unilateral time windows of s can avoid extra wait at satellites for vehicles. Wang et al. [42] proposed the mathe model of the 2E-VRP in the context of ICV and EV application, which considered t windows.
Based on the survey, it is not difficult to find that only a limited number of with a focus on 2E-VRP involving EVs, where the research on the mixed fleet an grated optimization for two echelons are rare. Motivated by the state of the art of vestigations and the managerial requirements from the real applications, this pap at providing a new solution to this problem.

Problem Description
The 2E-EVRPTW-BSS system considers a depot, multiple satellites, a number tomers with deterministic demands, and a group of BSSs that have no restrictions capacity of EVs. In addition, the positions of all these nodes have been given and Heavy loaded ICVs are employed in the first echelon to transport demands fr depot to each satellite, while EVs are considered in the second echelon to transp mands from satellites to each customer, as depicted in Figure 1. EVs are supposed a limited driving range and have to visit BSSs to swap their batteries before they of battery power. In addition, to promise the timeliness of delivery, this work also ers the time windows of customers, which in turn require the latest arrival time at the satellites, i.e., there is also a time window for the arrival time of ICVs at each s The 2E-EVRPTW-BSS aims to minimize the total costs, including the transportati of two echelons, fixed cost of the vehicles, and battery swapping cost.

Model
The 2E-EVRPTW-BSS is defined on a complete digraph G = (V, A), where th nodes V includes customers, satellites, and BBSs. Demands are transported from th to the set of customers. Denote qi as the demand of the ith customer. The num

Model
The 2E-EVRPTW-BSS is defined on a complete digraph G = (V, A), where the set of nodes V includes customers, satellites, and BBSs. Demands are transported from the depot to the set of customers. Denote q i as the demand of the ith customer. The number of available ICVs in the first echelon is K 1 , while that of EVs in the second echelon is K 2 . The capacity of the ICVs and EVs are Q 1 and Q 2 , respectively. Some assumptions are made for the model.
(1) Direct delivery from the depot to customers is prohibited.
(2) Each satellite can be visited by ICVs multiple times in the first echelon.
(3) Only the first echelon allows split deliveries.
(4) There is no direct travel between satellites in the second echelon. (5) The supply at the depot is sufficient. (6) The loading and service time at customers are assumed as being included into the travel time, and thus can be ignored. (7) The violation of time windows is not allowed.
The variables and parameters for the model are summarized in Table 1. Table 1. Variables and parameters of the 2E-EVRPTW-BSS.

Symbol Description
Set of the ICVs in the 1st-echelon and set of EVs in the 2nd-echelon.
The max running time of the proposed VNS algorithm.
The capacity of the ICV and EV, respectively. B The battery capacity of the EVs. c 1 , c 2 Cost of unit time from i to j for ICV and EV, respectively. c 3 Battery swapping cost.
The fixed cost of ICV and EV.
The time window for the deriving at node i. a The electric power consumption of each EV for unit time. The remaining demand in vehicle k at node i. x ijk 1 if vehicle k travels arc (i,j) in the 1st-echelon; 0 otherwise. z ijsk 1 if EV k travels arc (i,j) from the satellite s; 0 otherwise.
In our model, the total cost to be minimized includes three parts: (1) Travelling costs of ICVs and EVs: (2) Battery swapping costs: 6 of 17 (3) Fixed cost of ICVs and EVs: The model is presented as follows. Objective: Subject to: The main constraints of the above model can be divided into three parts. The constraints of the first echelon and the second echelon are the Formulas (7)-(11) and (13)-(23), respectively, while the constraint (12) links the two echelons through the latest arrival time at each satellite.
More specifically, constraints (7) and (13) ensure the flow conservation for ICVs and EVs, respectively. Constraint (8) implies that each satellite can be visited more than once by ICVs. Constraints (9) and (15) promise that the loading cannot exceed the capacities of ICV and EV, respectively. Constraints (10) and (18) give the upper bound of the arrival time of two echelons. Constraints (11) and (19) specify lower bounds of the arrival time of two echelons. Constraint (12) requires that the arrival time of ICV at each satellite s should be earlier than t s . Constraint (14) guarantees that each customer can be serviced by an EV only once. Constraint (16) ensures fully meeting the demands of each customer. Constraint (17) promises that each EV should arrive at each customer within the time window. Constraint (20) means that the EV does not consume battery power during the operation of a customer. Constraint (21) guarantees that the EV is fully charged when it starts from the satellite or a BSS. Constraints (22) and (23) keep track of the state of battery power of EVs starting from node i to node j.

Algorithms for the 2E-EVRPTW-BSS
Considering the classical VRP is NP hard [36], its variant 2E-EVRPTW-BSS is undoubtedly an NP-hard problem as well. Hence, we adopt a metaheuristic to achieve the optimal solution within a reasonable time.
The proposed metaheuristic is developed based on a VNS algorithm. Mladenović and Hansen [43] first proposed the VNS algorithm. In their work, the systematic changes of the neighborhood were employed within the local search to get rid of the local optimal solutions, which can be used to successfully solve myriad optimization problems in reality [44,45].
In this study, the proposed algorithm begins with an initial solution S 0 = (S 0 1 ,S 0 2 ), where S 0 1 and S 0 2 are the initial solutions of the first and second echelons, respectively. The shaking neighborhood structures (denoted as N k , k = 1,2, . . . , k max and k max is the number of shaking neighborhood structures) are first used to improve the efficiency in searching for solution space, followed by the local search neighborhood structures (denoted as the set N l , l = 1,2, . . . , l max , and l max is the number of local search neighborhood structures). A solution S = (S 1 , S 2 ) is first generated in a shaking neighborhood structure N k in each iteration, then a local search procedure is applied to produce a better solution S" for improvement.
The iterative process stops until the shaking neighborhoods have been exhausted or the given termination criterion is met-the maximum running time (T max ) in this paper. The overall iterative structure of the proposed VNS is presented in Algorithm 1, and the details will be discussed in the following sub-sections.
Shaking: pick a random solution S 2 from the kth neighborhood of S*. Construct S 1 based on S 2 . Update the solution as S = (S 1 , S 2 ) 3.
Local search S 2 ← the best solution from the lth neighborhood of S 2 .
If the termination condition is met, then return S*.

Solution Representation and Encoding
A full solution is composed of two parts; the first part includes a sequence of satellite nodes that are visited by ICVs that start and end at the depot for the first echelon, while the second part contains a sequence of customer nodes (including BBSs) which start from and end at a given satellite node for the second echelon.
In our study, the optimization for the routes of the two echelons are interrelated. Specifically, the routes of the first echelon are generated based on that of the second echelon. Hence, the solution can be encoded with the routes of only the second echelon, i.e., the encoded solution is composed of only S 2 = {r 2 1 , r 2 2 , ..., r 2 K 2 }. The full solution will be generated through a decoding process.  k ) are denoted as the sets of customers and BSSs, respectively. An example is depicted in Figure 2. The full solution S = (S1, S2) for 2E-EVRPTW-BSS includes two parts, with S1 = {(0,1,3,0), (0,2,0), (0,1,2,0)} and S2 = {(1,5,16,6,7,1), (1,8,9,10,1), (2,11,12,18,13,2), (3,14,19,15,3)}. In our study, the optimization for the routes of the two echelons are interrelated. Specifically, the routes of the first echelon are generated based on that of the second echelon. Hence, the solution can be encoded with the routes of only the second echelon, i.e., the encoded solution is composed of only

Initial Solution
The initial solution (only the second echelon) is constructed based on Schneider et al. [15]. Firstly, for each satellite, the nearest customer node i0 is chosen, and all of the customers are sorted in ascending order of the angle between the customer itself, the satellite, and the i0. Then, the customers are inserted into one route iteratively. BSSs are inserted into the route when a violation of electric power occurs. If a violation of capacity occurs, a new route is created. To consider time window requirements, in each route, a customer u can be inserted between successive vertices i and j only when i u j e e e ≤ ≤ .

Solution Decoding
The main task for decoding is to determine the full solution including two echelons. Considering the latest arrival time at each satellite, the first echelon routes can be constructed based on those of the second echelon in this paper. The demand delivered by the EVs from each satellite and the latest arriving time of the ICVs at each satellite can also be derived according to all the second-echelon routes departing from and returning to it. Based on the simplified least-cost insertion heuristic, the generation of the first-echelon routes can be described as follows [25].
Step 1. According to the second-echelon routes, determine the latest arrival time of ICVs (ts) and the required demand for each satellite;

Initial Solution
The initial solution (only the second echelon) is constructed based on Schneider et al. [15]. Firstly, for each satellite, the nearest customer node i 0 is chosen, and all of the customers are sorted in ascending order of the angle between the customer itself, the satellite, and the i 0 . Then, the customers are inserted into one route iteratively. BSSs are inserted into the route when a violation of electric power occurs. If a violation of capacity occurs, a new route is created. To consider time window requirements, in each route, a customer u can be inserted between successive vertices i and j only when e i ≤ e u ≤ e j .

Solution Decoding
The main task for decoding is to determine the full solution including two echelons. Considering the latest arrival time at each satellite, the first echelon routes can be constructed based on those of the second echelon in this paper. The demand delivered by the EVs from each satellite and the latest arriving time of the ICVs at each satellite can also be derived according to all the second-echelon routes departing from and returning to it. Based on the simplified least-cost insertion heuristic, the generation of the first-echelon routes can be described as follows [25].
Step 1. According to the second-echelon routes, determine the latest arrival time of ICVs (t s ) and the required demand for each satellite; Step 2. Back-and-forth routes are created for each satellite whose demand is larger than capacity Q 1 (delivery split). That is, if the demand of satellite s is larger than Q 1 , construct a back-and-forth route (0, i, 0), and this process will continue until the remaining demand of the satellite is smaller than Q 1 ; Step 3. After Step 2, all satellites visited by the second-echelon routes are sorted in ascending order of the latest arriving time t s ; Step 4. Select an ICV, insert sequentially the visited satellites to generate its route until the arrival time of the ICV is later than t s of the last inserted satellite or the load of the ICV exceeds Q 1 . Then, select the next ICV to repeat the inserting process until all the satellites are visited. The first-echelon routes are thus constructed, and a complete solution is derived (as indicated in Figure 2).

Solution Evaluation
A solution is evaluated by Formula (29): f eva (S) = f (S) + αp cap (S) + βp tw (S) + γp bat (S) (29) where f (S) is the total cost as represented by Formula (6), p cap (S) shows the violation of total capacity defined by (30), p tw (S) shows the time window violation at customers as indicated in (31), p bat (S) measures the battery capacity violation defined by (33), and α, β, γ are penalty factors of the violations. The penalty factors are large enough values, which can effectively eliminate the possibility of the solution containing time window violation being the optimal solution. The total capacity violation of a solution S can be calculated by There are three cases leading to the violation of time windows, i.e., arrival time t 1 s > t s , t 2 i < e i and t 2 i > l i (I ∈ V C ). Hence, the total time window violation of a solution can be calculated by To calculate battery capacity violations, for each route r 2 k ∈ S 2 , k = 1, 2, ..., K 2 , we define the variable Φ k v i , k = 1,2, . . . , K 2 to represent the remaining battery power for the EV k when leaving node v i .
Obviously, Φ k v i should be non-negative. The battery capacity violation of a route r 2 k can thus be defined as A varying penalty scheme is adopted to accelerate the search process, which is similar to the work of Vidal et al. [46]. When an infeasible solution still violates the constraints after the penalty, each penalty factor will be multiplied by 10 and the local search will be conducted again. If the infeasible solutions still exist after two rounds of multiplication by 10, no further attempts will be made. Therefore, this procedure cannot ensure the elimination of all the infeasible solutions, but it can effectively reduce the number of them at a low cost.

Neighborhoods and Local Search
The proposed VNS of this paper adopted several frequently used inter-and intra-route neighborhood structures.
2-Opt*. As a modification of the 2-opt operator originally proposed by Lin [47], the 2-Opt* operator was applied to VRPTW by Potvin and Rousseau [48]. For the two routes that depart from the same satellite, this operator replaces the arc (i, I + 1) of one route and arc (j, j + 1) of another route with arcs (i, j + 1) and (j, I + 1) (Figure 3a). With respect to 2E-EVRPTW-BSS, there is at least one BBS among the nodes i, i + 1, j, j + 1 and no two successive BBSs in the generated routes, compared with the 2-Opt* operator in traditional problems in which only customers are swapped.
Relocate. This operator deletes and replaces a node from one route and then inserts it into another route (Figure 3b) or another location in the same route (Figure 3c). It is performed only on the sequence of customers.
Exchange. The exchange operator swaps the positions of two nodes, which is applied to customers. This operator can be used for both intra- (Figure 3d) and inter-route (Figure 3e) moves.
lite with another satellite and inserts the old satellite into a position of the route ( Figure  3j).
StationInRe. This operator, proposed by Schneider et al. [15], performs insertions and removals of BSS. This operator is applied to the arcs starting from a BBS (k, j), B k V ∈ . If the arc (k, j) does not belong to the current solution, the stationInRe will insert the BBS k between j and its predecessor, as depicted in Figure 3k. If the arc already exists, the BSS k will be removed, as shown in Figure 3l. The proposed VNS procedure in Algorithm 1 contains two phases to generate a neighborhood, i.e., shaking and local search. In the shaking phase, five inter-route neighborhood structures (2-Opt*, inter-Relocate, inter-Exchange, inter-Swap, and inter-Shift) and one intra-route neighborhood structure (Satellite-Change) are sequentially used to generate the neighborhood.
In the local search phase, five intra-route neighborhood structures, i.e., intra-Relocate, intra-Exchange, intra-Swap, intra-Shift, and Station-InRe, are sequentially applied. Local search neighborhoods are performed in a cyclic manner [49]. Each neighborhood is explored until no further improvement can be found, then the next neighborhood structure is selected. When all the five neighborhood structures have been performed, the search process repeats again. The procedure terminates when the local optimum is reached in every single neighborhood. Swap (λ 1 , λ 2 ). This operator swaps λ 1 consecutive customers in one route with λ 2 consecutive customers in another route (Figure 3f), or just swaps in the same route ( Figure 3g).

Numerical Experiments
Shift (λ 1 , 0). This operator removes λ 1 consecutive customers and inserts them into another position in the same route (Figure 3h) or another route (Figure 3i).
Satellite-change. This operator was proposed by Wang et al. [38]. Subject to the constraints on the second-echelon EVs per satellite, this operator exchanges the current satellite with another satellite and inserts the old satellite into a position of the route (Figure 3j).
StationInRe. This operator, proposed by Schneider et al. [15], performs insertions and removals of BSS. This operator is applied to the arcs starting from a BBS (k, j), k ∈ V B . If the arc (k, j) does not belong to the current solution, the stationInRe will insert the BBS k between j and its predecessor, as depicted in Figure 3k. If the arc already exists, the BSS k will be removed, as shown in Figure 3l.
The proposed VNS procedure in Algorithm 1 contains two phases to generate a neighborhood, i.e., shaking and local search. In the shaking phase, five inter-route neighborhood structures (2-Opt*, inter-Relocate, inter-Exchange, inter-Swap, and inter-Shift) and one intra-route neighborhood structure (Satellite-Change) are sequentially used to generate the neighborhood.
In the local search phase, five intra-route neighborhood structures, i.e., intra-Relocate, intra-Exchange, intra-Swap, intra-Shift, and Station-InRe, are sequentially applied. Local search neighborhoods are performed in a cyclic manner [49]. Each neighborhood is explored until no further improvement can be found, then the next neighborhood structure is selected. When all the five neighborhood structures have been performed, the search process repeats again. The procedure terminates when the local optimum is reached in every single neighborhood.

Experiment Description and Parameter Settings
Considering the 2E-EVRPTW-BSS is a new model, there are currently no benchmark instances available to evaluate the algorithm performance of this problem; therefore, the test instances are proposed based on the instances of Breunig et al. [25], which are designed for the 2E-VRP. The locations of the depot, satellites and customers are directly used from Breunig et al. [25], and for each instance, several customer nodes are chosen to be the BSSs [50]. Customer demands are randomly generated between 10 and 150 kg.
This paper generates the locations of the BSSs randomly, and the number of BSSs is set to be 1/5 of the nodes in the network according to Schneider et al. [15]. The adjacency matrix of transportation time between any pair of nodes is calculated by dividing Euclidean distance by the ICV speed in the first echelon or the EV speed in the second echelon. The relative parameters are set as shown in Table 2.

Computational Results and Analysis
The proposed VNS is coded in Python 3.6 and is implemented on an Intel Xeon E3-123v3 (8 GB RAM) computer. The optimal solutions to some small-sized instances can be obtained by using the GUROBI 8.0.1 solver.

Comparison between the Proposed VNS and GUROBI for the Small-Sized Instances
The results obtained by the GUROBI solver and the proposed VNS are presented in Table 3. The instance size is based on the number of satellites (m), customers (n), and BSSs (l), as well as the number of ICVs and EVs, denoted as n (ICV) and n (EV), respectively. Each instance is operated 10 times, and "Best" is the best-found solution and "Avg" is the average optimal solution for the 10 instances. The objective value and CPU time for GUROBI and VNS are listed in the column of Obj and Time, respectively. It is easy to find in Table 3 that the proposed VNS achieves the optimal solution for all the 10 instances whose optimum can be reached by GUROBI. However, the running time of the VNS is incredibly short compared with that of GUROBI. With the size of the instance growing, the GUROBI solver fails to produce the exact solutions for the last five instances even when the running time is up to 4500 s, while the proposed VNS algorithm can still find solutions with good performance efficiently. In fact, the proposed VNS can arrive at the solution within 5 s for most small-sized instances and consumes only 26 s even for the instances that GUROBI is hard to handle in a reasonable time.

Comparison between Two Metaheuristics for the Middle-and Large-Sized Instances
In order to evaluate the performance of the proposed VNS for problems with a larger size, this paper compares the proposed VNS with another metaheuristic presented by Wang et al. [38]. Their algorithm does not consider the BBS and time windows; hence, some adaptions have to be made to fit the requirement for solving the 2E-EVRPTW-BSS. The algorithm is denoted as Wang (2017) in Tables 4 and 5.
The results of the middle-sized instances and the large-sized instances are reported in Tables 4 and 5, respectively. For the middle-sized instances, the algorithm terminates when all the shaking neighborhoods have been exhausted. The objective value and CPU time for the two algorithms, as well as the gaps between the two algorithms, are listed in Table 4. For the large-sized instances, however, we set the max running time T max of 2000 s as the termination criterion due to the over-long time for exploration. Hence, only the objective values and gaps are listed in Table 5.
We can find from Table 4 that the performance of the two algorithms is quite similar. Although the objective values obtained by the proposed VNS is slightly worse than that of Wang (2017), it exhibits the advantage in running time when the instance size is larger. Namely, the proposed VNS is more efficient in the computation for larger instances. This can be explained that the proposed VNS tries to optimize the whole solution including two echelons, while Wang (2017) optimizes only the sequence of the second-echelon and generates a feasible sequence for the first echelon based on the second part. Hence, the proposed VNS can find a better solution more easily with fewer explorations in local research.
The advantage of the proposed VNS in computation efficiency is even more significant for the large-sized instances. It is fairly apparent in Table 5 that the proposed VNS can achieve a better solution than Wang (2017) with the same running time for almost all the instances (with only one exception). Therefore, the proposed VNS shows a good performance in solution quality and significant advantages in computation efficiency for the 2E-EVRPTW-BSS with a larger size, which has special value in practical applications.

Comparison of Carbon Emission between ICVs and EVs in the Second-Echelon
One of the important advantages of EVs is the reduction in carbon emissions. To illustrate the effects of emission reduction, we compare the emissions of our solution with that of fossil fuel-based internal combustion vehicles (ICVs) for the second echelon. The unit emissions of EVs are calculated based on the formulation of Zhang et al. (2018) [20], and the unit emissions of ICVs are calculated based on the formulation of Wang et al. (2017) [38]. The parameters of an EV are adopted from Pelletier et al. (2019) [51], and the parameters of an ICV are adopted from Wang et al. (2017) [38]. We assume that the road grade angle is 0, the vehicle acceleration is 0, and the EV and the ICV have the same travel speed.
The results are shown in Table 6, where "EV" means the emissions when only EVs are adopted and "ICV" means the emissions when only ICVs are adopted. From last column in Table 6, it can be concluded that using EVs in transportation systems rather than ICVs is more environmental. The emissions of EVs can be reduced by about 20%. Thus, compared to ICVs, applying EVs is more environmentally friendly.

Conclusions
In this research, a novel two-echelon vehicle routing problem including mixed vehicles considering battery swapping stations (2E-EVRPTW-BSS) is considered, in which the integration of optimization for the two echelons is implemented by restricting the latest arrival time of ICVs at satellites in the first echelon to meet the requirement of EVs in the second echelon. The objective of the 2E-VERPTW-BSS aims to minimize the total cost. Various constraints related to vehicle capacity, battery capacity, time windows, and battery swapping stations are considered based on the requirements from real operations.
As a variant of the VRP, this problem is obviously NP hard and untractable by using exact algorithms. In addition, the integration optimization for a two-echelon transportation system inevitably increases the difficulty in solving this problem. Hence, a kind of VNS algorithm is proposed for solving the 2E-EVRPTW-BSS problem in this paper. To evaluate the performance of the proposed VNS, the algorithm developed by Wang et al. [37] is adapted according to the requirements of 2E-VERPTW-BSS for comparison. The extensive numerical experiments on different sizes of instances are conducted to examine the effectiveness and efficiency of the proposed VNS in this paper. It is found that the proposed VNS can easily achieve the optimal solutions for the small-sized instances. For larger instances, the proposed VNS demonstrates a higher efficiency in searching for the solutions of high performance compared with the algorithm of Wang et al. [37] and can find better solutions in the same running time.
The research of this paper is a kind of extension to the existing investigations. Of course, there are some other factors from the real demands worthy of being considered. For example, uncertainties are almost everywhere in the real world. Hence, in future studies, uncertainties in elements such as transportation time, electric power consumption, etc., can be included in the models, and the optimization under uncertainty can be considered.  Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: https://www.univie.ac.at/prolog/research/TwoEVRP/ (accessed on 11 November 2021).