Research on Optimization of Electric Vehicle Routing Problem With Time Window

As the urban population and scale gradually increase, the per capita income level of urban residents is also constantly increasing, more people have put forward higher requirements for material life. The degree of congestion of urban roads has a strong positive correlation with the development level of the national economy. The crowded lanes directly affect the way people travel, especially in the field of logistics distribution. Electric vehicle distribution is one of the existing distribution methods that is less affected by traffic, but it is subject to mileage, cargo capacity and number of vehicles. In order to find an optimal urban distribution route that satisfies both the electric vehicle limitation and the customer time window limitation, a mixed planning model is established to conduct in-depth research on the routing problem. In the process of verifying the correctness of the model, a mixed algorithm with lower time complexity, which was calculated by the highest order in the model, is established, and two sets of instance data are used for calculation. The results show that the mixed algorithm not only has a faster calculation speed, but also can calculate the vehicle route in a large-scale situation.


I. INTRODUCTION
In recent years, with the rapid development of online shopping in China, the market competition of products has become increasingly fierce. However, the existing technical capabilities of enterprises in this industry are limited. The traditional ways of reducing material consumption to obtain the ''first source of profits'' and of saving labor to get the ''second source of profits'' have been far from satisfying the needs of enterprise development. Companies have begun to look away from the production areas to the circulation. Thus, the development of the logistics industry has become the companies' ''third source of profits'', which, to a large extent, affects the quality of service. The efficient and reliable logistics environment at the current scientific and technological level has become one of the key factors for the success of online stores, so transportation costs have become the focus The associate editor coordinating the review of this manuscript and approving it for publication was Francisco Perez-Pinal . of many companies. Enterprises require goods to be delivered in a more efficient and faster way. Therefore, efficient and flexible distribution planning plays a vital role in promoting enterprise competitiveness.
Logistics network optimization is an important part of logistics system optimization, which mainly optimizes the collection, loading and delivery of goods. Currently, the last mile is regarded as one of the most expensive, least efficient and most polluted parts of the entire supply chain. In addition, customers also put forward diverse demands for logistics companies, which requires flexibility in the delivery process. More and more scholars began to notice this practical combination optimization problem and study the last mile distribution problem, Vehicle Routing Problem (VRP). The VRP aims to find the optimal set of routes for a fleet of vehicles to serve customers under specific constraints. In its basic form, the VRP involves a single depot as the start and end point of the routes. Each customer is associated with a location and a demand quantity. Each vehicle serves the customers along VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ the designated route, and the total demand cannot exceed the maximum capacity of the vehicle [1]. Based on the basic vehicle routing problem [2], it has extended and changed for a number of different types in academic research and practical application, including vehicle routing problems with time windows (VRPTW) [3], Vehicle Routing Problem with Time Deadlines (VRPTD) [4], Vehicle Routing Problem with Pickups and Deliveries (VRPPD) [5], multi-depot and periodic vehicle routing problem (MDPVRP) [6], multi-compartment vehicle routing problem (MCVRP) [7], split-delivery vehicle routing problem with time windows (SDVRPTW) [8].
Early scholars mainly studied static unconstrained VRP, but the problem is prone to the criticism that has no flexibility. In addition, it does not take into account of vehicle capacity constraints and distribution center constraints; it is difficult to apply in practice to address the issues of mismanagement and waste of resources. Therefore, scholars began to study the dynamics of the more constrained VRP, and consider the broader implementation in real-life situations. In this article the electric VRP with time windows (EVRPTW), in which the delivery of goods to each customer should be occurred in the interval [a i , b i ]; where, a i and b i are the earliest and the latest allowable times that the service should be taken place. In general, solution approaches for EVRPTW can be divided into two main classes: those apply to deterministic dynamic routing problems without stochastic information; and those with non-deterministic dynamic routing problems that have stochastic information, where stochastic information is known. Our contribution is to propose an effective method to solve the EVRPTW which is able to provide reasonably results for numerous problem variants. According to the idea of maximal covering location we presented a divided jurisdiction model and related algorithms. We divide the whole region into several parts based actual daily customer requirement, and configure vehicles in each sub-area. We will make the coverage customer requirement of each area more balanced according to the number of vehicles and the time window limit to each node. When dividing jurisdictions, we consider minimizing the delivery distance of each jurisdiction to ensure that the total scheduling distance of all vehicles is minimized. This not only guarantee the vehicles travel's efficiency but also can prevent the occurrence of management costs greater than logistics costs and chaos in facility management. The whole process is a process of dynamic optimization, if this method is used together with the fleet management system, it will be quite promising, and has relatively large value of applications and generalization. This paper is organized as follows. Section II gives a detailed literature review on the VRP with a heterogeneous fleet. In Section III, the EVRPTW is described and formulated as a mathematical programming model. Subsequently in Section IV, a mixed algorithm with tabu-search is proposed to solve the EVRPTW and the algorithm complexity are compared with the best-known published algorithms. In Section V, experiments are conducted for each problem variant. Finally, this paper concludes in Section VI with a summary and possibilities for future research work.

II. LITERATURE REVIEW
Since Dantzig and Ramser proposed the vehicle routing problem in ''Truck Scheduling Problem'' in 1959 [9], scholars gradually invested a lot of energy to study it. Then Balinski and Quandt established the basic VRP model in the early days [2]. Clarke and Wright proposed the Clarke-Wright algorithm for solving the standard vehicle routing optimization model [10]. Kim G. et al. made a model and algorithm review of the city VRP problem, and found that the development of VRP can be roughly divided into three parts: dynamic VRP, static VRP, and eco-friendly VRP. The author also points out that the VRP with customer time windows is more in line with the actual conditions and has higher research value [11]. Since some scholars have found that customers have strong flexibility in practical problems, it is necessary to add time windows constraints to the traditional model to make the model more realistic. Leonardo et al. proposed an exact algorithm which was column generation based to solve the vehicle routing problem with time windows [12]. However, with the increase in the number of customers to be considered, the scale of actual problems gradually expanded, and it is difficult for exact algorithms to solve VRPTW. Some scholars focused their research on heuristic algorithms. Zhang D. et al. proposed a hybrid approach which is a combination of Tabu search and Artificial Bee Colony algorithm, and use it to solve the problem with 56 vehicle routing problem with time windows. Also, results show the effectiveness of the proposed hybrid algorithm [13]. When studying the VRPTW problem, Susilawati et al. believed that the goal of the problem was to minimize the total travel cost and operating cost, and proposed a heterogeneous VRP (HVRP) to solve the problem, used a feasible domain method to solve the problem [14]. Niroomand et al. successfully applied the VRPTW to the postal network, and proved the effectiveness of the ant colony optimization algorithm (ACO) to solve the VRPTW service provided by regional post offices in their own research [15].
With the development and progress of human society, the construction of environmentally friendly VRP has become a hot research spot. Electric vehicles have become the optimal choice for the urban distribution industry due to their low energy consumption and low emissions, EVRPTW has a place in the stage. Schneider et al. introduced the route of electric vehicles with time windows and charging stations (EVRPTW) for the last mile distribution using battery electric vehicle. In the model, the vehicle's freight capacity and customer time are specifically considered window. And a mixed heuristic algorithm combining variable neighborhood search algorithm and tabu search algorithm is used to solve the model, and the effectiveness of the algorithm is proved by an example test [16]. To cope with the limitation of greenhouse gas emissions, Wygonik et al. developed an EVRPTW model from ArcGIS. The model mainly starts with policy changes and operational changes to study the influencing factors. There is a stable relationship between acquisition cost and carbon dioxide, and the cost per kilogram of carbon dioxide increases by $ 3.50 [17].
The research of Goeke and Schneider proposed the electric vehicle routing problem with time window and mixed fleet (E-VRPTWMF). This model starts from the actual energy consumption, combines speed, slope and other conditions to establish the model, and uses an adaptive large field Search algorithm to solve the example [18]. Hiermann proposed an adaptive large neighborhood search (ALNS) hybrid solution method to solve the time window and E-FSMFTW in E-FSMFTW by combining the heuristic algorithm of ALNS and plug-in local search and markup program [19]. Grangier et al. proposed a cross-docking vehicle routing problem based on the Large Nearest Neighbor Search and Periodic Call Set Partitioning methods [20]. The constant change of the VRP algorithm has led to an increase in the number of solvable examples, and specific trends can be obtained from the data in the table 1.
Throughout the literature survey, the existing EVRPTW models can not contain all the elements involved in actual operation, the models are not comprehensive, and it is difficult to match with the actual. At the same time, although the existing solving algorithms are developing in the direction of solving large-scale practical problems, the solving ability of the algorithm is not ideal. It is still necessary to improve the solving ability and speed of the algorithm to meet the practical needs.

III. BASIC ASSUMPTIONS AND SYMBOL DESCRIPTIONS
VRP is a branch of TSP, and the basic models of the two problems have similarities. The simplest mathematical model of the TSP can be written in the following integer linear programming.

Model 1
Min The decision variables in Model 1 are is in the optimal tour 0 else while slack variables u i ≥ 0 i = 1, 2, · · · , n are used to constraint the maximum number of visits in one tour, which is represented by p. d ij is the distance between node i to j. So far, the CPLEX software has a strong ability in solve mixed integer programming. It can solve 30-nodes-TSP problem within a normal time on a conventional computer. VOLUME 8, 2020 Based on the TSP problem, scholars have raised the VRP problem. As shown in model 2.
In this model, the limiting capacity and maximum cost (time or distance) constraints are the same for all the vehicles. p is the capacity for vehicle, T is the maximum cost allowed for one route of the vehicles, then the formulation can be written as: In the above formulation, (2b) -(2e) ensure that each node is being served only once and that all the V vehicles are being used. (2f) -(2h) are the subtour breaking constraints which also represent the node constraints, capacity constraints and cost constraints respectively. In a word, these equations ensure that all the tours are starting and ending at the distribution center N and contains at most L severs nodes. Meanwhile, every route has the capacity that no more than P and the maximum allowable cost is T .
Based on the allocation of electric vehicles, the route of electric vehicles must not only consider the unit transportation cost, but also consider the following costs: (1) Fixed cost used by vehicles C t ; (2) Waiting cost incurred by waiting customers TC 2 · w ij ; (3) Charging cost of vehicles TC 3 · e ij Thus, the objective function becomes: With this objective, we need to add the following constraints: (1) Whether the electric vehicle is charged, the total number of constraints that need to be added at this time is (N − 1) · (N − 1).
(2) The time window constraint of the electric vehicle, the total number of constraints that need to be increased at this time is 2 · (N − 1) · (N − 1).
(3) Whether the electric vehicle is waiting for the constraint, the total number of constraints that need to be increased at this time is (N − 1) · (N − 1) In addition to the above cost constraints, we need to further consider the choice of model. This will add new constraints, which means that the scale of the Model 3 increases. Therefore, accurate models cannot solve the problem of large-scale distribution of electric vehicles, a heuristic algorithm suitable for large-scale problems needs to be proposed.

IV. PROCESS FRAMEWORK
Through the statistical analysis in Table 1, it is found that the research focus on VRP includes the distance traveled by the vehicle, the quality of the cargo carried by the vehicle, the time window of the customer, the fixed cost of the vehicle, the cost of charging the vehicle and the cost of waiting for the vehicle. But studies included all of the above factors have not yet appeared. In addition, when reviewing the literature on exact algorithms for solving VRP problems, it is found that when the number of customers exceeds 30, the existing exact solving algorithms cannot solve the problem, and heuristic algorithms are needed to solve large-scale problems. The problem of electric vehicle distribution in the real management problem far exceeds the scale of 30 nodes. Therefore, the heuristic algorithm is more suitable for solving the model proposed in this paper.
For heuristic algorithms for VRP problems, commonly used solving algorithms include ant colony algorithm [35], genetic algorithm [36], simulated annealing algorithm [24], 2-opt, 2-exchange [35], [37], [21], or-opt, and so on. In fact, the mixed use of some simple algorithms may be more ideal in terms of computational speed and accuracy. The mixed algorithm proposed in this paper makes practical problems more available. Also, the mixed algorithm is effective in reducing algorithm complexity, in the calculation process, the algorithm complexity sometimes determines the success of the algorithm.
Step 1: Get basic data. In this process, the collected data includes the location of the distribution center, the location of the charging station, the location of the customer, the shortest travel time between any two locations, the volume and quantity of customer demand, the demand time window, and the basic information of transportation vehicles.
Step 2: Get the initial delivery route. Using an iterative algorithm to gradually obtain the information of each distribution line, including the departure time, end time, and delivery position and delivery sequence of each vehicle.
Step 3: Optimization using insertion. Insert one or more nodes in one line into another line to optimize delivery costs.
Step 4: Optimization using exchange method. Exchanging one or more nodes in one line with one or more nodes in another line to achieve optimal distribution costs.
Step 5: Optimize the charging position of each line. Optimize the charging position in a line, including the selection and optimization of the charging pile location.   Step 6: Optimize a single line again using the insert method. Insert new nodes again in the previously optimized route to get the best delivery cost.
Step 7: Reusing the exchange method to optimize a single line again. Exchange one or more nodes in one line with one or more nodes in another location to achieve optimal distribution costs.
Step 8: Line optimization termination detection. Determine whether the optimization method of the second step to the seventh step optimizes the distribution cost, and if it is optimized, returns to the second step, otherwise the iteration ends. Figure 1 through Figure 7 illustrate how the mixed algorithm doing when determine the delivery route. There are two ways to optimize the delivery route, one is to optimize the order of the same vehicle to visit the customer, and the other is to optimize the service customers of different vehicles.
The mixed algorithm accelerates the speed of problem solving and also greatly reduces the complexity of the algorithm. Table 2 shows the complexity of different algorithm, and the mixed algorithm has a significantly low    complexity [38]. Time complexity is used here to compare different algorithms. The higher the time complexity, the greater the difficulty in solving. Figure 8 shows the framework of all 8 steps in the mixed algorithm. A tabu search table can be used to reduce the number of iterations. With the tabu search table, in-group optimization and inter-group optimization of distribution VOLUME 8, 2020  lines can be quickly implemented. In-group means that the order in which a vehicle visits the customer must be considered, and inter-group means that different vehicle travel routes must be considered. Each time the loop  optimized by inserted or exchanged, a new tabu search table will be generated. Repeat these steps until the optimal solution is found.

V. CASE STUDY A. CASE ANALYSIS OF COMPANY A
To validate the performance of the model, we perform experiment using the distribution data of Company-A in city X. In order to protect user privacy and data security, all data has been sampled and desensitized. The data includes statistical data of the distribution services provided by the logistics center B of company A to more than 1,000 customers scattered in city X on a certain day in 2018. Table 3 shows the information of logistics vehicles, Table 4 shows part of the merchant delivery data.
The data includes the GIS latitude and longitude coordinates of the node, the delivery of the cargo data on a certain day, and the information of the distribution center and the charging station. Clients are B2B customers or commodity customers, Company-A Logistics expects to combine various factors to minimize transportation costs, waiting costs, charging costs and fixed use costs.
The following assumptions were made during the experiment: (1) The vehicle departs from the distribution center and needs to return to the distribution center after customer needs are met. The vehicle can be re-circulated and re-routed several times. The departure time is 8:00 in the morning and the latest time to return to the center is 24:00 that day.
(2) The arrival time of the vehicle must arrive before the latest time requested by the customer, and there is a waiting cost before the earliest arrival time requested by the customer; the first departure of the distribution center does not count the waiting cost, and the rest waits to calculate the cost; if the vehicle is not used, it will not incur any cost.
(3) The vehicle departing from the distribution center is fully charged, and does not calculate the charging cost and charging time, including the phenomenon of multiple trips to and from the distribution center.
(4) Each distribution vehicle does not exceed the vehicle load and volume limits.
(5) Customers must be served, and each customer can only be served by one car a day, the unloading time is constant at 0.5h, and the loading time is not taken into account.
(6) The number of charging piles in the charging station is not limited. The vehicle needs to be charged at the charging station before the sustainable mileage arrives. The vehicle is fully charged once, and the charging time is constant at 0.5h. Figure 9 shows the data related to the distribution of city X. The purple diamonds are the distribution centers. The blue points are service nodes which with a round-trip distance of less than 100km from the distribution center, the light blue nodes are service nodes which with a round-trip distance from the distribution center of 100km to 120km, and the red points are service nodes which with a round-trip distance of more than 120km from the distribution center. The green dots are charging stations.
It gives the basic data information table of an enterprise electric vehicle distribution from Table 3 and Table 4. Company A is currently responsible for the distribution of goods for 1,000 stores and has 100 locations for charging. VOLUME 8, 2020   After optimization of the algorithm, it can be found that the number of vehicles required to complete the task is reduced by 13 vehicles. Table 5 gives the cost improvement of the optimization process, the total cost is reduced by 61,515 yuan, and the reduction ratio is 20%. It shows that our algorithm has better optimization results. Figure 10 demonstrates the optimal result of EVRPTW in Company-A, each loop represents one vehicle departing from distribution center and go back to there when customers have been served. Blue square means charging station that electric vehicles can get charged on a trip. After the vehicle departs from the center, it reaches the red node in turn and enters the charging station to charge when needed, then return to the center.

B. CASE ANALYSIS OF COMPANY B
In order to test the effectiveness and reliability of the hybrid heuristic algorithm, this paper uses another case to illustrate. In the verification process, in view of the small size of the ant colony algorithm and genetic algorithm, this article randomly selected 200 customer information from the data provided by Company B as a small sample. The mixed algorithm proposed in this paper, ant colony algorithm and genetic algorithm are used to calculate the sample data, and the results are compared and analyzed to get the solution efficiency of the three algorithms:

1) ACQUISITION OF SAMPLE DATA
The data used in the sample calculations are derived from the data provided by Company B, using random points to select customer points, which makes the sample calculations representative. Randomly select 200 customer points from 1000 customer points, and obtain relevant delivery information in the sample data by establishing a customer index. Due to the large amount of data, only part of the data is displayed. The basic information of the data is shown in Table 6:

2) SETTING OF BASIC PARAMETERS
After obtaining the calculation data, the parameters of the algorithm need to be set. In the setting of ant colony algorithm, set the pheromone importance parameter alpha value to 1, heuristic factor importance parameter beta value to 5, pheromone evaporation coefficient Rho value to 0.75, and pheromone increase intensity coefficient Q is set to 10, and the number of ants is set to 200 since ants will die during the process of optimizing. After a lot of experiments, the ratio of ants to client nodes is 1.5: 1. The maximum iteration number item_max is set to 200, and the maximum capacity of the vehicle is 1. While in the setting of genetic algorithm, set the population size parameter to 100, the maximum number of iterations is 300, the crossover probability is 0.85, and the mutation probability is 0.15.

3) COMPARATIVE ANALYSIS OF RESULTS
The three algorithms are compared and analyzed in terms of the complexity of the algorithm, algorithm solution speed and algorithm solution time. Before the analysis, calculate the total travel distance, total cost, and time when the mixed heuristic algorithm solves 200 customer nodes. Table 7 shows the time for the three algorithms to calculate the optimal delivery route and the total cost of the corresponding delivery route when the number of customers changes from 10 to 200. Table 7 also shows the solution scale, cost optimization effect, and solution time of the three algorithms at different scales. From the data in table 7, we can find that: when processing less than 50 customer nodes, the performance gaps among the ant colony algorithm, genetic algorithm and the mixed heuristic algorithm are not large. In the example, the maximum calculation scale of the ant colony algorithm is to calculate 160 distribution lines between customers. Genetic algorithm and the mixed algorithm proposed in this paper can calculate the distribution routes among more than 200 customers in a short time, the calculation speed of the mixed algorithm is faster than that of the genetic algorithm. The minimum total cost of the delivery route calculated by ant colony algorithm and by genetic algorithm are comparable, which are higher than the total cost of the mixed heuristic algorithm, and the solution time is significantly longer than the mixed heuristic algorithm used in this paper. When solving large-scale examples in this paper, the mixed heuristic algorithm has the ability to solve large-scale examples, but the ant colony algorithm and genetic algorithm cannot. Therefore, the mixed heuristic algorithm is feasible in solving the examples provided by Company B, also could get a better result. Table 8 compares the cost changes of 200 customer nodes before and after optimization. In the distribution process of the first 200 customer nodes, the merchant needs delivery costs of 59682 yuan, charging costs of 3750 yuan, waiting costs of 423 yuan, and fixed costs of 9600 yuan. The total cost is up to 73,455 yuan. After the solution optimization of the mixed heuristic algorithm, the results show that the optimized distribution cost is reduced by 4019 yuan, the charging cost is reduced by 2400 yuan, the waiting cost is reduced by 310 yuan, and the fixed cost is reduced by 2600 yuan. The total cost was reduced by 9132 yuan. The cost contrast before and after optimizing can prove that the mixed heuristic VOLUME 8, 2020   algorithm has a good effect on solving large-scale calculation examples. Figure 11 shows the time taken to calculate the distribution route in the three cases of the initial state of company B, the ant colony algorithm, and the mixed heuristic algorithm, the mixed algorithm proposed in this paper can effectively reduce the calculation time. Figure 12 shows the comparison of distribution costs in three cases. In most cases, the cost of the mixed heuristic algorithm is the lowest. Figures 11 and 12 prove that the proposed algorithm in this paper is effective.

VI. CONCLUSION
In the context of the urgent global energy storage and the serious pollution of the ecological environment, electric vehicles have attracted more and more attention and use from countries. However, electric vehicles are very restrictive in terms of capacity, mileage and charging in the logistics industry. Therefore, the optimization and improvement of the electric vehicle distribution problem has theoretical promotion and practical application value. However, with the traditional mixed integer programming model and the calculation speed and capability of current ordinary computers, it is difficult to find the problem of electric vehicle allocation with more than 30 nodes in a shorter time. The mixed heuristic algorithm proposed in this paper can effectively solve this problem and obtain electric vehicle distribution routes for large-scale distribution problems in a short time. The mixed algorithm contains two parts: insertion method and exchange method, which can continuously improve the accuracy of the results. At the same time, the tabu search mode with insertion or exchange effectively improves the calculation speed of the algorithm. Finally, the application value of the algorithm is verified through two examples. In the future, it is still very meaningful to study heuristic algorithms for large-scale electric vehicle allocation problems with faster calculation speed.