Abstract

Under the background of severe air pollution and energy shortage, electric vehicles (EVs) are promising vehicles to support green supply chain and clean production. In the world, the renewal of EVs has become a general trend. Therefore, the concern about EVs is a hot issue at present, but EVs have the characteristics of limited driving distance and long charging time. When the EVs are used in logistics transportation, these characteristics have a significant impact on the vehicle routing problems. Therefore, based on the research experience of traditional vehicle routing optimization, combining with the characteristics of EVs, this paper presents an optimal problem of electric vehicle routes with time windows based on two charging methods and it also designs a mathematical model which was caused by early and late arrival as the objective function to minimize the transportation cost, vehicle use cost, power supply cost, and penalty cost. The model is solved using an ant colony algorithm. Finally, the ant colony algorithm is tested and analysed with an example.

1. Introduction

The research on vehicle routing began in the 1950s, Dantzig and Ramser firstly proposed the concept of vehicle routing problem (VRP), which refers to the purpose of distributing or collecting goods between distribution centres and a certain number of customers with different needs through the design of vehicle routing, and finally reached the goals, such as the shortest distance, the least time, and the least cost [1]. The importance of transportation in the logistics system distribution activities is undeniable, but in recent years, the large use of fossil fuel vehicles has resulted in the rapid consumption of oil resources and excessive emissions of greenhouse gases, so considering the balance and optimization of monetary costs and the environmental problems of fossil fuel vehicles, many vehicle routing problem models for fuel or emissions have risen, such as the fuel consumption rate of the VRP was considered by Xiao et al. [2], fuel consumption and carbon emission of the VRP considered by Zhang et al. [3], a time-dependent VRP model of minimizing fuel consumption of Norouzi et al. [4], the green vehicle routing problem (GVRP) model of Poonthalir and Nadarajan [5], and the vehicle scheduling problem of minimizing carbon emission of Wang et al. [6].

Because of the environmental protection characteristics of EVs, in recent years, with the rapid growth of the market share, EVs have been introduced into the market as personal and commercial alternative energy vehicles. In 2018, the number of electric vehicles worldwide exceeded 5.1 million, an increase of 2 million from 2017, and the growth of new vehicles almost doubled (IEA, 2019). In China, electric vehicles are growing at the rate of more than 50% per year (IEA, 2018). In 2018, the number of electric vehicles in China ranked first in the world [7]. Compared with traditional fuel vehicles, the main advantages of electric vehicles are zero greenhouse gas emissions, high efficiency, and low operating noise [8], which helps logistics companies get more and more social and environmental customer support. And it gets a green image [9]. Fernandez and Casals use sustainable analysis and practical estimation methods that take into account the life cycle carbon emissions of electric vehicles to analyse the contribution of electric vehicles to reducing greenhouse gas emissions [10, 11]. Wu et al. used the life cycle assessment method to estimate that the total life cycle greenhouse gas emission reduction potential of battery electric vehicles will gradually reach 13.4% in 2020 [12]. In addition to environmental benefits, EVs also have economic benefits. Compared with traditional fossil fuel powered vehicles, EVs consume 10% to 15% of the fuel cost of traditional vehicles at the same distance [13]. Therefore, the focus on EVs has become a hot issue at present. However, due to the characteristics of EVs such as low endurance mileage and long charging time, it becomes a significant and challenging task to study its VRP.

Electric vehicles refer to cars that use electric engines to provide energy through their own chemical batteries. The electrical energy used by EVs can be converted into many kinds of clean energy, which is the main force of environmental protection vehicles in the future with a high energy utilization rate and being clean and pollution-free. As a distribution vehicle, electric vehicles need to be charged much time for long-distance distribution, and the power replenishment time is longer than the refueling time. Therefore, it is necessary to consider the charging problems that may occur in the charging process. Based on traditional fuel vehicle route optimization, the introduction of the charging stations is the primary issue of electric vehicle upgrading combining with the characteristics of EVs. Electric distribution companies apply some coordination methods to control the charging load. That can affect the charging duration. Yang et al. studied the charging scheduling of electric vehicles on the highway [14]. Dogan and Alci optimized the charging schedule of electric vehicles considering the cost of battery degradation [15]. Dogan et al. based on a heuristic algorithm for charge and discharge coordination optimization [16]. Aravinthan and Jewell proposed a two-step method for scheduling EV charging, which limits the impact on EV charging on distribution assets [17].

At present, fast charging is the most common charging strategy. Schucking et al. proposed five charging strategies and believed that DC fast charging is essential [18]. In addition to fast charging on the issue of charging strategy, battery switching is also a relatively popular charging strategy. Adler and Mirchandani used real-time highway data to find the optimal battery exchange strategy [19]. Yang and Sun studied the location routing problem of the battery switching station of EVs with large capacity and optimized the routing plan and the selection of battery switching stations [20]. Dai et al. regarded the battery exchange strategy of EVs as the background and it provided reference for the determination of decision variables such as the number of backup batteries in AC power station and the charging selection of EVs [21]. Margaritis et al. analysed the advantages and disadvantages of battery exchange strategy to the government, users, and enterprises based on the EU [22]. This study combines the two charging strategies of fast charging and battery switching. The fast charging time is related to the remaining power, fixed battery replacement time, and the power replenishment method with less time is selected.

In the large-scale application of EVs in modern logistics, in addition to considering the plan to charge or replace batteries on the way, the delivery time is also extremely important for logistics companies, so we need to consider some important practical factors, such as customer time windows. In the actual distribution activities, more and more logistics enterprises begin to pay attention to the timeliness of package delivery. For customers, “punctuality” is one of the important factors affecting customer experience, so the vehicle routing problem with time windows (VRPTW) has also become an important part of the research. By adding time windows constraints to the basic VRP model and Solomon built VRPTW model, in which time window is a hard time window that must be observed [23]. Qureshi further expanded the concept of the hard time window, extended the problem to the category of the soft time windows, and determined the strictness of time windows by setting penalty function [24]. The soft time windows problem is widely used. Goeke considered the problem between time windows and EVs is pickup and delivery [25]. Keskin and Catay studied partial charging strategies for electric vehicles with time windows [26]. Desaulniers et al. studied the effective route optimization of battery electric commercial vehicle fleets, and they considered four variants of the route problem of electric vehicle with time windows [9]. Goeke studied the pickup and delivery of EVs with time windows (PDPTW-EV). In the PDPTW-EV, access location is limited by time windows [25]. Many scholars introduced charging stations and time windows for discussion [27, 28]. This study combines the two hot charging strategies of fast charging and battery switching. The fast charging time is related to the remaining power, fixed the switching time, and the power replenishment method with less time is selected. This paper not only considers the problem of charging stations, but also uses the broken line time windows to limit the distribution time based on the soft time windows.

In summary, compared with other similar studies, the main contributions of this paper are as follows: (1) in order to calculate the cost of logistics enterprises more accurately and save cost, this paper considers the cost of transportation as much as possible, that is to say, fixed cost, transportation cost, charging cost, and time penalty cost. And it establishes a mixed-integer linear programming model (MILP) with the goal of minimizing the total cost; (2) in order to save charging time, two commonly used charging methods are considered, and one with shorter charging time is selected; and (3) considering the customer’s time tolerance, the broken line soft time windows is adopted.

The rest of this paper is organized as follows: Section 2 describes the problem and identifications of the main assumptions. In Section 3, the MILP model is established and the description of the method of solving the model is provided. In Section 4, the test results of an example are given and the sensitivity analysis is carried out. Finally, the paper summarizes in Section 5.

2. Problem Description

This problem can be abstracted as that an enterprise uses EVs to provide distribution services for n customers with time windows after the distribution centre is fully charged. Each customer’s demand, service duration, good service time windows, and customer tolerance level are needed to be known. Finally, reasonable planning of the vehicle distribution route is necessary so that the total cost of distribution is small.

The soft time windows can relax the constraints of time windows, optimize resource allocation, and reduce energy consumption and road congestion, so the time windows studied in this paper mainly are soft time windows. As shown in Figure 1, in the traditional soft time windows, whether the vehicle arrives before or after l, the customer is allowed to serve, but they are required to pay the corresponding penalty fee, which is generally a simple linear relationship with the degree of time deviation. However, for the deviation of the best service time windows, customers have the difference between tolerance and intolerance. Therefore, based on the traditional soft time windows, considering the tolerance range of customers, this paper proposes a broken line time window.

According to the customer tolerance level () and service duration (), the tolerance time window can be obtained on the basis of the optimal time window , where . If the vehicle provides services in the best time window , there will be no penalty cost to be paid. If the vehicle provides services in the interval or , there will be only less penalty cost to be paid. If the vehicle starts service earlier than or later than , there will be more penalty cost to be paid. Compared with the traditional soft time windows, the broken line soft time windows take the actual feelings of customers into consideration, which will be conducive to better coordination between enterprises and customers, reasonable allocation, and optimization of resources.

In view of the above considerations, the problems and basic assumptions to be solved are as follows: (1) each vehicle can meet the needs of multiple customer points, and each customer point can only be served by one vehicle; after the completion of the distribution service, the vehicle must drive back to the distribution centre; (2) all vehicles are the same type, and the total transportation volume shall not exceed the capacity limit of EVs; (3) each customer’s location coordinates, demand quantity, and service duration are known, and there are optimal service time windows and tolerance time windows; (4) the time window penalty coefficient of each customer node is the same; (5) EVs can only be charged or their battery can be replaced in the distribution centre or power station; (6) each customer must be visited and can only be visited once; (7) the road is smooth, without considering traffic congestion and other special situations; (8) it is assumed that the transportation cost generated by the vehicle is linearly related to the route length, and the use cost of each vehicle is fixed; and (9) the objective function of this problem is to minimize the total distribution cost.

3. Materials and Method

In this part, according to the electric vehicle routing problem with time windows (EVRPTW), we establish a MILP model and determine the constraints.

3.1. Defining Variables

The parameters and decision variables used to describe the MILP model are shown in the following:N: set of all nodes n in networks.V: set of all nodes in networks.C: set of all nodes c in networks.D: network consisting of sets of nodes, .: set of customer nodes, where .: set of EV nodes, where .: set of charging station nodes, where .: set of distribution centre nodes.: fixed cost per vehicle.: electric vehicle unit distance transportation cost.: total electricity supplementary cost.: charging cost per unit time.: single battery replacement cost.: index of nodes, .: distance from the node i to the node j, .: demand of the customer node n, and .: rated load capacity of electric vehicles.: battery capacity of electric vehicles.: charge coefficient.: the residual power of EVs when reaches the node D.: residual electricity of the electric vehicle V leaving node D.: battery capacity of electric vehicles.: power consumption coefficient.: charge coefficient.: if i represents the customer point, represents the service time of electric vehicle at the node i; if i represents the charging stations, then represents the electric vehicle’s power replenishment time, : single battery change time, and .: waiting time of electric vehicles at the customer node i.: the time point when the vehicle arrives at the customer node i, where : the start time of the -car service customer node i.: time of electric vehicles from i to j.: driving speed of electric vehicles.: the lower limit of the best service time windows of the customer node i.: the upper limit of the best service window of the customer node i.: the lower limit of tolerance time windows of the customer node i.: upper limits of tolerance time windows of the customer node i.: unit time penalty cost of vehicles violating the time windows, m = (1, 2, 3, 4).: if the vehicle is from i to j, then , otherwise .: if the vehicle returns to the distribution centre after delivering a customer group, then , otherwise .: the task of the customer node i is completed by the vehicle , then , otherwise .

3.2. Model and Method

The objective function is to minimize the comprehensive cost, including transportation cost, vehicle use cost, electricity replenishment cost, and time window penalty cost. The formula of the MILP model is as follows:

Among them,subject to

In the model given above, Constraint (4) ensures that the vehicle starts from the distribution centre returns to the distribution centre and focuses on distribution centre. Constraint (5) ensures that each customer is served only once by one vehicle. Constraint (6) is a restraint on vehicle loading. Constraint (7) indicates that the number of EVs serving the customer is less than or equal to the total number of vehicles owned by the distribution centre. Constraint (8) requires that the number of customers served by each vehicle is less than or equal to the total number of customers. Constraint (9) requires that when the electric vehicle starts from the distribution centre, the time is 0. Constraint (10) indicates that the travel time of electric vehicles from the point i to the point j is the ratio of the distance between two points and the travel speed. Constraint (11) indicates that when the electric vehicle passes through the charging stations, the charge replenishment time is the minimum of the battery replacement time and fast charging time. Constraint (12) indicates that the time the electric vehicle leaves the customer node i is the sum of arriving at the customer node, waiting time at the customer node i, and servicing time. Constraint (13) shows the relationship between the starting service time and the arrival time of vehicles at the customer point. Constraint (14) indicates that the time the electric vehicle arrives at the node j is the accumulation of the previous time. Constraint (15) means that neither power consumption nor power replenishment occurs at the customer node i. Constraint (16) indicates that when the electric vehicle starts from the distribution centre, the state of charge is 100. Constraint (17) indicates that the remaining power to node j is equal to the remaining power to leave node i minus the power consumed on the way. Constraint (18) indicates that the state of charge of electric vehicles is nonnegative at any position. Constraint (19) indicates that the decision variable is constrained to 0-1.

In this paper, the ant colony algorithm is used to solve the approximate optimal solution of the NP hard problem. The ant colony algorithm has the characteristics of distributed computing, positive information feedback, and heuristic search. In essence, it is a heuristic global optimization algorithm in the evolutionary algorithm. The algorithm imitates the social behaviour of ants in order to find the shortest route from nest to food source. In the ant colony algorithm, each ant performs four basic activities in the process of route construction: (1) select the next customer based on the probable function of the distance from the current location to the customer and the route strength on the arc; (2) save the taboo list of the customers in the current route; (3) update the residual capacity of the vehicle; and (4) update the track intensity on the access arc, and use the method of local search to improve the quality of the solution. Finally, the taboo lists are deleted, and a new iteration is started. When the ant colony algorithm solves the MILP model, the specific steps are as follows:Step 1: importing data and setting basic parameters.Step 2: calculating the distance between customer nodes and the cost and time of distance between customer points.Step 3: initializing and iterating in order to find the best route.Step 4: terminating the algorithm and reporting the best solution.

Figure 2 shows the traversing process of a single ant in the iterative search for the best route.

The meanings of the mathematical symbols involved in Figure 2 are explained as follows:: the current location of ants.: the collection of client nodes that have not been accessed, initially including all client nodes.: the set of optional customer nodes when the electric vehicle is in i-node.: the collection of optional customer nodes for EV charging closest to i-node.

4. Calculation Experiment and Cost Analysis

In order to verify the proposed MILP model, the calculation experiments are carried out based on the known benchmark instances, and the ant colony algorithm is used to solve the model.

4.1. Test Examples

The experimental data are from Solomon’s VRPTW standard problem set, and the data number is R101 [29], which is characterized by uniform distribution of customer points and narrow time windows. In this case, a vehicle is generally only responsible for the distribution of several customer points, and the vehicle route cost is greatly affected by the time windows, so the data selection of the case is reasonable. In order to draw a clear road map, this paper only selects the first 26 data, including 1 distribution centre and 25 customer nodes.1 is the distribution centre, 2–26 is the customer node, 27–31 is the charging stations node. The specific parameters of the example are shown in Table 1, and the node information is shown in Table 2.

In this paper, according to the actual situation, we made assumptions about the required data in Table 1, and for this part of the program design, we reserved a data change area, which is malleable.

The MILP model is solved by MATLAB programming. In order to reduce the influence of random factors as much as possible, this paper repeatedly tests the example 10 times to get the total cost optimal solution (C), the number of vehicles (N), route length (L), and penalty cost (P) when the optimal solution is reached.

As can be seen from Table 3, the optimal solution of this example is 7283.08, including the route length when the optimal solution is reached at 270.61, and Table 4 shows that the optimal allocation scheme includes 4 routes; the route map is shown in Figure 3.

4.2. Cost Analysis

Based on the calculation experiment of the Solomon benchmark example, the sensitivity analysis of the cost affecting the electric vehicle route planning is carried out.

4.2.1. Use Cost and Transportation Cost

First, adjust the use cost from 1000 for each vehicle to 5000 for each vehicle, keep the other parameters unchanged, repeat the test for 10 times, and see Table 5 for the results when the optimal solution is reached.

It can be seen from Table 5 that after adjusting the use cost of vehicles from 1000 to 5000, after 10 times of operation, compared with Table 3, the number of vehicles is reduced from 4 to 2, which is 50%. It can be seen that the higher the use cost of vehicles is, the smaller the number of vehicles used is. When the use cost of vehicles is much higher than other costs, the vehicle route distribution scheme with the minimum number of vehicles will be preferred. At the same time, the route length is only increased by 3% compared with the result in Table 3, while the time window penalty is increased by 52%. This is understandable, because the proportion of vehicle use cost in the objective function increases, so the algorithm will tend to find the solution with the minimum vehicle use.

Keep the cost of using vehicles at 5000 per vehicle, and adjust the unit transportation cost from 2 to 10, while the penalty factor of time windows remains unchanged. Run the program 10 times, and see Table 6 for relevant results when the optimal solution is reached.

It can be seen from Table 6 that after adjusting vehicle use cost and unit transportation cost at the same time, the number of vehicles obtained is significantly reduced compared with Table 3. It can be seen that when vehicle transportation cost and use cost are much higher than other costs, the route distribution scheme with the least number of vehicles will be preferred. The route length in Table 6 is similar to that in Table 3, but the penalty cost of time windows is increased by 53%. By increasing the factors of vehicle use cost and unit freight in the objective function, the proportion of time window penalty cost is greatly reduced. Therefore, the length of the route and the number of vehicles are given priority in the result, so the time window penalty is greatly increased. This shows the effectiveness of the algorithm again in this paper.

4.2.2. Time Window Penalty Cost

Adjust the penalty coefficient of the time windows from to , keep other parameters unchanged, repeat the test 10 times, and see Table 7 for the results when the optimal solution is reached.

After the penalty cost coefficient increases 5 times, the calculation results are shown in Table 7. The route length is reduced by 0.3% compared with the result in Table 3, but the number of optimal vehicles has increased from 4 to 7, indicated an increase of 75%, and we can see that the number of vehicles has increased significantly. This is understandable, for the change of the penalty cost coefficient increases the penalty cost in the objective function, so the algorithm will tend to find more solutions for vehicles to serve customers. The increase in the number of vehicles will inevitably lead to a decrease in the average driving route length, which proves the effectiveness of the algorithm again. Therefore, the higher the cost of fines is, the more vehicles are required. This has led logistics companies to prepare more vehicles under strict time window conditions, making the customer’s total demand unchanged or even increased.

4.2.3. Electricity Replenishment Cost

The battery capacity is 60 kWh, the charging time needs 60 min, and the power change time is 31 min. The shortest power supply mode is selected. Therefore, when the supplementary power is not more than half, quick charging is preferred. Otherwise, choose the battery replacement strategy. The charging cost per unit time is 1 RMB/min, and the cost of single battery replacement is 30 RMB. Now, the cost of power supply is increasing. The charging cost per unit time is 50 RMB/min, and the cost of single battery replacement is 1500 RMB. The results are shown in Table 8, and the vehicle route, when the optimal solution is reached, is shown in Figure 4.

It can be seen from Table 8 that after the unit charge cost is adjusted from 1 to 50 and the single battery change cost is adjusted from 30 to 1500, after ten runs, compared with Table 3, the number of vehicles increased from 4 to 5 vehicles, indicated an increase of 25%. At the same time, it can be seen that the number of charging stations passed in Figure 3 is 3; however, the number of charging stations passed in Figure 4 is 2. Increased costs have drived companies to choose more vehicles to avoid charging. In addition, compared with Table 3, the route length is reduced by 0.6%, together with the penalty cost is reduced by 10.3%. And the increase in the number of vehicles serving customers leads to a reduction in the possibility of reducing time, penalties, and costs. This proves the effectiveness of the algorithm. Therefore, when the charging facilities are not perfect, together with the power replenishment cost is high, the logistics companies tend to use more vehicles to avoid charging as much as possible.

5. Conclusions

At present, most of the literature studies use a charging strategy, and the customer tolerance is not considered while studying the customer time windows. In this paper, the charging strategy of combining two charging ways is adopted, the broken line soft time windows is used considering the customer tolerance, and the MILP model of the EVRPTW is finally established. And through the calculation experiment of the Solomon benchmark example, the cost of affecting the route optimization of electric vehicle is analysed, the availability as well as effectiveness of data and algorithm are proved, and the management opinions on the practical application of MILP model are put forward.(1)The higher the use cost and freight of vehicles are, the less the number of vehicles used. When the use cost and freight of vehicles are much higher than other costs, the vehicle route distribution scheme with the least number of vehicles is preferred.(2)The higher the penalty cost of time windows is, the higher the number of vehicles used for vehicle distribution is. In the case of strict time windows, logistics companies need to prepare more vehicles than the total demand of customers.(3)Logistics companies tend to use more EVs to avoid charging as much as possible when charging facilities are not perfect and the cost of power supply is high.

The model can help the logistics enterprises provide some suggestions for the route optimization, help to promote the application of EVs in the field of logistics, and improve energy efficiency, energy conservation, and emission reduction. The proposed MILP model is helpful to reduce the logistics cost. However, the traditional shortcomings of VRP still exist in the EVRPTW model. For example, it is still a NP-hard, and it is difficult to solve large-scale problems. The focus of future research may be to developing more effective heuristic algorithm to solve large-scale problems, consider the real-time changes of traffic conditions, and expand the direction of the dynamic vehicle route.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This research was funded by the National Natural Science Foundation of China, grant no. 71471061, and the Fundamental Research Funds for the Central Universities, grant no. 2017MS171.