A hybrid ant colony algorithm based on multiple strategies for the vehicle routing problem with time windows

In this paper, we propose a vehicle routing problem with time windows (TWVRP). In this problem, we consider a hard time constraint that the fleet can only serve customers within a specific time window. To solve this problem, a hybrid ant colony (HACO) algorithm is proposed based on ant colony algorithm and mutation operation. The HACO algorithm proposed has three innovations: the first is to update pheromones with a new method; the second is the introduction of adaptive parameters; and the third is to add the mutation operation. A famous Solomon instance is used to evaluate the performance of the proposed algorithm. Experimental results show that HACO algorithm is effective against solving the problem of vehicle routing with time windows. Besides, the proposed algorithm also has practical implications for vehicle routing problem and the results show that it is applicable and effective in practical problems.


Introduction
The twenty-first century is an information age, information technology and scientific research promote the development of the world, the process of globalization continues to deepen, This 1 the rapid development of the economy cannot be separated from the public consumption, which makes the development of the service industry is faster and faster, and the problem of vehicle routing is also proposed. Vehicle routing problem (VRP) refers to the need for a group of vehicles to find an economical and effective route to meet the needs of different customers. It is a famous NP-hard combination problem in logistics management, vehicle scheduling, and traffic transportation [1]. The problem of vehicle routing was first mentioned in 1959 by Dantzig and Ramser. With the question raised, many variations on VRP have emerged. Such as VRP with capacity (CVRP) [2], VRP with time windows (TWVRP) [3,4], VRP with fleet size (FSVRP) [5], and VRP with uncertain requirements [6], these extended VRP also belongs to NP-hard combination problems.
The simplest routing problem is the traveling salesman problem (TSP); if we put limits to the carrying capacity, then this problem turns into the capacitated vehicle routing problem (CVRP) [2]. If we limit the distance between vehicles for CVRP, then it becomes VRP with distance constraint, namely DVRP [2]. In DVRP, if we consider the time of serving the demand of customer, the problem becomes TWVRP that we want to discuss [3].
Ombuki et al. [7] based on the Pareo sorting technique for the genetic algorithm to solve the TWVRP problem, they presented the TWVRP as a multi-objective problem.
The effectiveness of the proposed algorithm is verified by comparing with baseline data. Ghoseiri et al. [8] combined genetic algorithm with evolutionary search and Pareo technology to get an adaptive genetic algorithm for solving the TWVRP. They converted the TWVRP into a goal programming and got good results. Similar algorithms can also be used to solve such problems, such as the differential evolutionary integration algorithm based on mixed penalty function [9] and the differential evolutionary algorithm based on topology [10] proposed by Wang. Ho et al. [11] used tabu search algorithm when solving the TWVRP, and the experimental results showed that this problem could be solved by tabu search algorithm and satisfactory results were obtained. Belhaiza et al. [12] proposed a tabu search algorithm combined with variable neighborhood method to solve the TWVRP. The advantage of this algorithm is that the minimum waiting time and the minimum delay of customers can be recorded in the process of path generation, and then adjust the arrival times and departure times accordingly. Wang et al. [13] proposed a threshold tabu search algorithm to solve the TWVRP, which can make vehicle dispatchers respond to practical problems effectively and quickly.
Chiang et al. [14] proposed a hybrid simulated annealing algorithm to solve the TWVRP, and combined with tabu table to increase the annealing process of short-term memory function. Numerical experiments showed that this method is better than the previous research results. Deng et al. [15] improved the simulated annealing algorithm by adding memory function, and adopted the double termination principle to solve the TWVRP. The experimental results also confirmed that the new algorithm could obtain better solutions. Wang et al. [16] used the improved parallel simulated annealing algorithm based on residual capacity and radial additional insertion to solve the pick up and deliver at the same time within a specific time window (VRPSPDTW), and minimized the target with a mixed integer programming model.
Yu et al. [17] accumulated heuristic information using pheromone matrix method to obtain the IACO when solving the period vehicle routing problem with time windows (PTWVRP), and introduced double crossover operation in the algorithm to improve the performance of the algorithm. Ding et al. [18] proposed a hybrid ant colony optimization algorithm by introducing disaster operator and adjusting pheromone. Wang et al. [19] treated the TWVRP as a multi-objective problem and proposed a hybrid ant colony optimization algorithm, which is obtained by combining ant colony algorithm and simulated annealing. The performance of the improved algorithm was significantly improved. In addition, these algorithms can also be used to solve vehicle routing problems, such as particle swarm optimization algorithm [20][21][22][23], bee colony algorithm [24][25][26], whale optimization algorithm [27], Dijkstra algorithm [28], and so on.
Ant colony optimization (ACO) is an effective heuristic algorithm to solve the combination optimization problems, which provides a new idea about solving the VRP. Clolrni et al. [29] proposed ant colony algorithm, which was proposed on the basis of real ants and successfully applied to traveling salesman problem. Bulleneimer et al. [30] first proposed the ant system, they improved the algorithm and applied it to the VRP. Due to the complexity and extensiveness of reality, the basic ant colony algorithm has limitations on solving practical problems. Therefore, many researchers proposed new methods and new ideas to improve the ant colony algorithm and expand the application scope of the ant colony algorithm. Yu et al. [31] changed the pheromone update mode, introduced the mutation operation to obtain the IACO. Although the improved algorithm avoids the local optimization, it greatly increases the complexity of the algorithm. Mavrovouniotis et al. [32] combined ant colony algorithm with local search algorithm to solve the dynamic traveling salesman problem. This algorithm improves the quality of the solution, but its application effect on dynamic instances is poor. Ding et al. [18] proposed a hybrid ant colony algorithm and introduced the disaster operator. They studied the convergence speed of the proposed algorithm, but does not consider the complexity of the algorithm. Wang et al. [33] applied the hybrid ant colony algorithm to the model of emergency transportation after a disaster. Jabir et al. [34] combined ant colony algorithm with variable neighborhood search algorithm and applied it to multi-stage green vehicle routing problem (MDGVRP). Li et al. [35] applied the improved ant colony algorithm to multi-target vehicle routing problem (MVRP). He proposes a relatively simple model and only compares the proposed algorithm with the basic algorithm when evaluating its performance. Therefore, this paper proposes a HACO algorithm (HACO) based on multiple strategies to solve the TWVRP. The main work are to improve the updating method of pheromone , adjust the pheromone volatile factor adaptively, and introduce into swap operator and insert operator to avoid the algorithm falling into local optimal and improve the convergence rate of the algorithm. The framework of this paper is divided into six parts: the first part is the introduction; the second part is the problem modeling; the third part is the solution of the problem; the fourth part is the numerical experiment and the result analysis; the fifth part is an example application; the sixth part is the conclusion.

Problem description and formulation
The TWVRP requires a group of vehicles to start from the depot and complete customer service requirements within the time interval. And on this basis to find a shortest distance and effective route. The TWVRP is widely used in logistics management and the most common problem with transportation system.
We can use the graph theory to model TWVRP as a directed complete graph G = (V , E) [37], with a vertex set V = {0, 1, 2, ..., n} and an edge set E = {(i, j)|i, j ∈ V }. In TWVRP, each vertex represents the node (or customer), and each edge represents the distance between two nodes. In this problem, M = {1, 2, ..., m} represents a group of vehicles. We assume that the depot is vertex 0 and customers are introduces as nodes. The vehicle k {k ∈ M} needs to start from the depot and return to the depot after serving a certain number of node. For nodes that is requirements, only one vehicle can serve them and cannot exceed the maximum capacity of the vehicle. In addition, the vehicle needs to service within the time interval[a, b]; it is not earlier than the left time window a or later than the right time window b.
In this paper, we consider the constraints on vehicle capacity and time window to reduce vehicle use and travel distance and minimize the costs associated with it.
For the convenience of the following description, we define it as follows: Objectives: minimum cost Constraints The total demand cannot exceed the capacity of the vehicle.
Each node has a vehicle to serve and can only be served by one vehicle.
The vehicle must serve the node within the time interval.
The vehicle leaves the depot and finally returns to the depot.
According to the above-defined objectives, parameters, and decision variables, the problem can be represented as n j=1 n i=0 n j=0 x i jk = y ik , ∀i ∈ {1, 2, . . . , n} ∀k ∈ {1, 2, . . . , m} In the above model, objective (3) is to minimize the cost of the vehicle. Constraint (4) ensures that the total demand of nodes cannot exceed the capacity of the vehicle. Constraint (5) ensures that each node can only use one vehicle. Constraint (6) ensures that the vehicle starts and ends in the depot when serving the node. Constraints (7) and (8) ensure that each node always has one vehicle to serve them. Constraint (9) ensures that the service vehicle should arrive within the time period. Constraint (10) ensures that the vehicle finally arrives at the node j from the node i by passing service time and travel time.

Solution approach
The ant colony algorithm is evolved based on the foraging behavior of ants in nature. During the process of searching for food, ants leave secretions along the path they passed. An ant colony can always find a shortest path from its nest to food source through these secretions. Dorigo [38][39][40] proposed the concept of ACO after being inspired by the foraging behavior of ant colonies. The idea of ACO is to use the secretions left by the ants to exchange information, and then find the optimal path required by the problem. The secretions are called pheromones. In the foraging process, the ant determines the next step based on the distribution of pheromones. If more pheromones are found in a certain path, the probability of the ant choosing this path will be higher. If the ant leaves fewer pheromones, the probability of the ant choosing this path will be lower. So as more and more pheromones are accumulated in the path, it means that more and more ants will choose, and the ant can find the shortest way to find food. As a heuristic algorithm, the ACO is often used to solve various optimization problems, and has been successfully applied to practical cases, especially in VRP, TSP, and related extension problems.
The core of the ACO is to determine the node that the ant chooses to go next and design the pheromone update formula for how to guide the ant to find the shortest path more quickly. The improvement on ant colony algorithm in this paper is based on Dorigo (1992) [36] and Ding et al. (2012) [18], and mainly improves the updating formula of pheromone and adds adaptive parameters. The parameter ρ in pheromone updating formula is changed from constant to dynamic number to reduce the value of the bad path during the cycle, and increase the role of the good path in the optimization process.

The improvement of ACO
When using HACO to solve the TWVRP, each ant needs to build a path from the depot that satisfies the constraints. If it is found that the next node selected in the current path does not satisfy the condition, then the ant needs to return the depot and rebuild the new path with the remaining nodes, and this process stops until all nodes are selected. Each ant through a certain probability to select the next node. Therefore, the formula for the node i to select the next node j is In the formula (11), N k i represents the set of node that the vehicle can access after it leaves the node i; τ i j represents the number of pheromone on the path between the current node i and possible node j; η i j represents the intensity, its expression is η i j = 1 c i j , and it is the reciprocal of the distance between the node i and possible node j; width i represents the width of the time window or the urgency of the node's requirements, and is expressed as follows: width i = b i − a i ; α is a pheromone factor that determines the ant's trajectory; β is the expectation factor, which reflects the importance of external information to the trajectory; γ represents the importance of the urgency of the service node to trajectory selection. The node j selected is the more urgent, the greater the pheromone concentration and the smaller the distance when q ≤ q 0 ; and it is according to the probability formula P k i j and roulette method to choose node j when q > q 0 ; q ∈ rand(0, 1) is the random number; q 0 is a parameter that controls the exploitation against the exploration of ant during the search progress.
When determining which node the ant wants to go next, and the equivalent of determining the direction. They leave pheromone on the path to communicate information about their companions. The pheromone left by the former will influence the path chosen by the ants later, and in other words, the pheromone concentration decides the choice of the path. According to the principle of ACO, the shorter the path, the higher the pheromone concentration; the longer the path, the smaller the pheromone concentration. To speed up the search process of ants, the updating formula for pheromone is improved, which is as follows: In the above formula, ρ is the pheromone volatility coefficient; τ u i j represents the number of pheromones on the path of the ant u in the current cycle; Q is a constant related to the amount of pheromone deposited by the ants; L u represents the length of the ant u path in the current cycle.
The pheromone volatility coefficient ρ is a dynamic value. If the value of ρ is small, the pheromones in the path evaporate more slowly, and the pheromone concentration remaining on the path will be large, which will have a great influence on the subsequent ant's path selection, thus reducing the ant's random search ability; when the value of ρ is large, the pheromone on the path will evaporate quickly, while the concentration of pheromone remaining on the path will be small, which increases the ant's global searching ability in the search process and makes it easier to explore other paths. In the ant search process, to reduce the interference with poor path to the ant's search for new path, the parameters ρ in this paper is adjusted adaptively, when the optimal solution is not significantly improved in the sub-cycle, the values are adjusted according to the following formula: In formula (15), to ensure that the opportunity for selecting nodes can be found under smaller circumstances, ρ min is the minimum defined in the ant search process.

Introduce mutation operation
In this paper, we introduce two kinds of mutation operators in ACO: swap operator and insert operator. The introduction to mutation operators not only increases the diversity of optimal solutions, but also avoids the convergence of the algorithm to local optima. We first briefly describe the mutation operator used in this paper.
Swap operator: The random exchange of gene positions within a gene sequence. In Fig. 1, the positions of genes 2 and 6, 8 and 11 are swapped.
Insert operator: The position in a gene sequence where a gene is randomly inserted into another gene. In Fig. 2, gene 7 was removed and inserted into the position of gene 4.
An example solution of TWVRP is given in Fig. 3, which is transformed into gene sequence, as shown in Fig. 4a. The gene sequence 4(a) was swapped to obtain Fig. 4b. The gene sequence represented in Fig.4b was inserted to obtain Fig. 4c. Where 0 is inserted into the gene sequence to represent the path of solution formation that meets the constraints.

Steps of the solution
The steps of solving TWVRP model with HACO are as follows: Step 1: Initialization of parameters, including the maximum number of iterative NC, the number of ants V, the limited capacity Cap k ; the demand of node d i for all i ∈ {1, 2, . . . , n}. Step 2: Put ant l = 1, 2, . . . , v into the depot, and create an optional table Cand l = {1, 2, . . . , n} to record all not visited nodes. After the ants pass through the nodes, they should record the nodes in the corresponding path record table tabu l = ∅.
Step 3: Find the not visited node in the table Cand l = {1, 2, . . . , n}, and select the next node j to be accessed according to formula (11).
Step 4: Whether the ant l meets the constraints of vehicle capacity, time and node demand at the node j, if it meets the constraints, go to Step 5; otherwise, go to step 3.
Step 5: Put the selected node j into the table tabu l ,save the current result, and update the table tabu l .
Step 6: Whether the ant l has traversed all the nodes, if so, go to Step 7; otherwise, go to step 2.
Step 7: Calculate the length of the path traveled by the ant, and conduct mutation operation on the path found this time.
If the path after mutation operation meets the constraint conditions, record the optimal path and update the path records table.
Step 8: Update the pheromone according to Formula (12); Step 9: To search the solution space comprehensively, parameter ρ needs to be adjusted adaptively according to formula (15); Step 10: Is the current cycle number greater than the maximum iteration number. If so, the cycle will stop and output the result; if not, go to step 2.

Numerical analysis
To verify the performance of the proposed HACO, we apply it to Solomon's TWVRP standard instances, which has 56 data sets, each data set contains 100 data, and the data can be obtained from Solomon website. 1 Solomon standard instances can be divided into six categories: C1, C2, R1, R2, RC1, and RC2. It can be divided into three types based on the geographic distribution of the customers, and the first type is the set C1 and C2, because the instance customers in these two sets are geographically concentrated; the second type is the set R1 and R2, because the instance customers in these two sets are randomly distributed in geographical locations, which are relatively discrete; the third type is the set RC1 and RC2, which are between two classes, both concentration and dispersal. Solomon standard instances can be further divided into two categories according to vehicle capacity fleet size and time window. The first category is C1, R1, and RC1, and these three sets have a smaller vehicle capacity, a smaller fleet size, and a narrower time window, so there are fewer customers served by vehicle; the second category is C2, R2, and RC2, and these three sets are opposite to the three sets in the first category, so there are more customers served by vehicle. In the numerical experiment, the standard instances are classified according to the second method above and divided into two categories to test and evaluate the algorithm.

Parameter setting
When the ACO is looking for the solution of the TWVRP, the parameters in the algorithm can affect the quality of the solution. There are usually two methods to select parameter values [41]. The first method is to set the parameters before the algorithm running, so that the parameters will not change into the running process. The second method is to set parameters during the running of the algorithm, but an initial value needs to be set before the running, and such parameters are constantly changing during the running process. Three sets of instances C101, R101, and RC01 are selected to analyze the parameters. When analyzing one of the parameters, the other parameters remained unchanged. The following numerical analysis using HACO and studying the parameters based on 1 http://w.cba.neu.edu/solomon/problems.htm. g k = 500, h k = 1000. By analyzing the optimal solution, the influence of parameters on the solution quality is explained, then the influence of parameters on the overall performance of the algorithm is explained.

Parameter α
It can be seen from Fig. 5 that the approximate optimal objective values obtained using different parameters α.
When the value of parameter α is around 1, we get a good value. Therefore, in the experiment, the best value we can get for the parameter α is equal to 1.

Parameter β
As can be seen from Fig. 6, when the value of parameter β is between the interval [3,5], we get relatively good values. Therefore, the range of values for parameter β is [3,5].

Parameter γ
As can be seen from Fig. 7, when the value of parameter γ is between the interval [2,4], the approximate optimal objective value obtained is relatively good. Therefore, the range of values for parameter γ is [2,4]. 4. Parameter q 0 As can be seen from Fig. 8, when the value of parameter q 0 is between the interval [0.3, 0.6], we get a better approximate optimal objective value. Therefore, the range of values for parameter q 0 is [0.3, 0.6].

Parameter ρ
As can be seen from Fig. 9, when the value of parameter ρ is between the interval [0.3, 0.7], we get a relatively good approximate optimal objective value. The smaller are the value of ρ, the more pheromones are left on the path, so it is not easy to distinguish the better path, and the optimal solution is difficult to get. However, when ρ is large, because there are fewer pheromones on the poor path, the algorithm may converge on the local optimal. Therefore, the range of values for parameter ρ is [0.3, 0.7].

Experimental results
To illustrate the advantages and disadvantages of the proposed HACO, we analyze the experimental results from two aspects: first, the results obtained by HACO are compared with ACO; second, the results obtained by HACO are compared with other intelligent algorithms.

Comparison with the ACO
The Solomon standard instances are used as a test function to test the performance of HACO and evaluate the optimal solution quality. Tables 1 and 2 show the results for ACO and HACO. In Tables 1 and 2, ACO and HACO run ten times and choose the best result. Where Veh represents the number of vehicles; Dis is the distance traveled by vehicle; Cost represents the cost of the vehicle; Gap Dis (%)represents the difference between the distance obtained by HACO and the distance obtained by ACO, and the expression is Gap Cost (%) represents the difference between the cost of HACO and the cost of ACO, and the expression is As shown in Table 1, when the number of vehicles is the same, the HACO results is better than ACO results, which shorten the distance and reduce the cost. However, there are six instances in Table 1 with poor effect, in which instance C102, C104, and C107 increase the driving distance while reducing the cost; instance R104 and R105 increase costs while reducing distances; RC106 not only increases the driving distance but also increases the cost. Except for the six instances that did not work well, the other instances did significantly better.
It can also be seen from Table 2 that compared with ACO, HACO has a better effect in most instances, which not only reduces the driving distance but also reduces the cost. Similarly, there are seven instances with poor effect in Table 7, among which the driving distance of instances R203, R210, RC202, and RC206 is increased and the cost is also increased; instance C203 and RC207 increase the cost while shortening the distance;instance R211 reduces cost but increases distance.

Comparisons between the other intelligent algorithms (node numbers are the same)
Each instance of Solomon's standard instance has 100 customers that are geographically distributed differently. Tables 3 and 4 compare HACO with other intelligent algorithms for the same number of customers. The boldface indicates that HACO gets better results than the comparison algorithm. Tabu search algorithm and genetic algorithm are used as comparison algorithms in Tables 3 and 4. The Veh, Dis, and Cost are consistent with above meanings. Table 3 shows that when the number of customers is the same, the HACO has 62.07% better results than the comparison algorithm. Among them, when customers are concentrated on geography (set C1), the HACO has 88.89% better results than the comparison algorithm; when the customer distribution in the geographical location is dispersed (set R1), the HACO only has 41.67% better results, and the HACO is not very good. The HACO is also feasible when customers are geographically dispersed and concentrated, with 62.50% better results.
Similarly, Table 4 shows that when the number of customers is the same, the HACO has 60.71% better results than the comparison algorithm. Among them, the HACO has 75% better results than the comparison algorithm when customers are relatively concentrated (set C2); when customers are scattered (set R2), the HACO has only 54.55% better results, and the result obtained by the comparison algorithm is better. When customers are concentrated and dispersed, the HACO has 62.50% better results than the comparison algorithm.

Comparisons between the other intelligent algorithms (customer needs are the same)
In standard instances of Solomon, each instance has 100 customers with different needs, some with more and some with less. We classify the same or similar customer requirements in each instance, and the performance and convergence of the proposed algorithm are evaluated from the perspective of customer demand. To fully analyze the performance of  the proposed algorithm, we randomly selected six Solomon standard instances as test functions, and these six test functions are C101, R101, RC101, C201, R201, and RC101. To prove the effectiveness of mutation operation and adaptive strategy added to ant colony algorithm in this paper, we compared it with the improved ant colony algorithm in reference [18,35,42] as well as other algorithms GA, SA. Among them, reference [18] added local search method on the basis of ant colony algorithm, reference [35] proposed a new pheromone update formula, and reference [42] introduced adaptive strategy and exchange mechanism. Tables 5, 6, 7, 8, 9, and 10 compare the HACO with the comparison algorithms in different sized instances with the same customer requirements. Where, Demand represents the demand of customers; N is the number of customers; Veh is the number of vehicles; Dis is the total distance traveled; Cost represents the total Cost of the vehicle; Time represents the running time of the algorithm. In addition, boldface indicates that HACO gets better results than the comparison algorithm.
Tables 5, 6, and 7 calculate the optimal results of different small instances (C101, R101, and RC101) with the proposed HACO and the comparison algorithm, respectively, and analyze the calculation results and the performance of the algorithm. Tables 5, 6, and 7 show that the HACO obtains at least 8 better results out of 15 comparisons when the number of vehicles used is the same or similar, which not only shorten the driving distance but also reduce the total cost of vehicles. When the number of vehicles and the total cost are the same, HACO takes less time to compute the optimal result than the comparison algorithm. In addition, these three tables also show that when solving small instances, no matter how customers are distributed among geography, the HACO results are better than the comparison algorithm. Tables 8, 9, and 10 calculate the optimal results of medium instance (C201) and large instance (R201 and RC201), respectively, using the proposed HACO and the comparison algorithm, and further illustrate the performance of the proposed HACO by analyzing the results. As shown in Table 8, the proposed HACO does not get good results when solving medium instance, and only gets better results when customer demands are 20. However, HACO gets at least 8 better results out of 15 comparison results when solving the large-instance model. For the same number of vehicles, HACO gets better or similar results for total distance and total cost than the comparison algorithm, and the running time is also less than the other intelligent algorithms.
From Tables 5,6,7,8,9, and 10, it can be seen that when the customer demand is 10-30, except for medium instance C201, HACO gets better results for small and large instances than other intelligent algorithms. The hybrid algorithm proposed in reference [43] is also suitable for solving large instances problems, and it combines greedy algorithm with variable neighborhood search. Although the accuracy of the initial solution is improved, the convergence of the algorithm is not compared with other intelligent algorithms. The algorithm proposed in reference [44,45] can solve practical  problems. However, on the basis of improving the solution quality, the convergence of the proposed hybrid algorithm in this paper is also analyzed, as shown in Fig. 10. Figure 10 shows the convergence of the optimal path; subgraphs (a), (b), respectively, represent the convergence curves of different comparison algorithms when solving TWVRP.

Practical application
To test the effectiveness and practicability of the proposed HACO, we apply it to an actual example. Take the logistics of fresh fruits and vegetables in Xingqing District, Yinchuan, Ningxia as an example. We need to send fruits and vegetables from the warehouse (Xianfeng fruit and vegetable distribution center) to 13 distribution points (13 supermarkets in Xingqing District). Figure 11 shows the location of the warehouse (0) and 13 supermarkets on the map. 2 And the distance between each two point is shown in Table 11.
When delivering goods from the distribution center to each distribution point, the transport vehicle is composed of sev- Table 11 Distance between any two distribution points and warehouses (m)

Fig. 11
Geographical location of distribution center and distribution point eral trucks of the same type. The maximum carrying capacity of the truck is 40 tons, and the average speed is 60 km per hour. The fixed cost of transportation for each truck is 600 yuan per kilometer, and the transportation cost is 5 yuan per kilometer. Table 12 gives the specific situation of distribution centers and supermarkets according to the marking sequence in Fig. 11. It can be seen from Table 12 that supermarkets try to avoid the rush hours of traffic sections when purchasing goods, and the time window of supermarkets is almost between 9:40 and 11:40. Therefore, the study of this paper does not consider the traffic congestion, and the vehicle can deliver the goods within the time window specified by the supermarket.
The specific conditions of the actual problem can be known through Tables 11 and 12. The goal is to reduce the  total cost of the distribution center by minimizing the number of vehicles and reducing the total driving distance of vehicles. Therefore, we apply ACO and HACO to solve the TWVRP instance. The practicability and effectiveness of the proposed HACO is analyzed and verified by comparing the results of the two algorithms, and the results are shown in Tables 13  and 14.
It can be seen from Table 13 that six vehicles are needed to solve the TWVRP instance using ACO, but these six vehicles are not fully utilized. According to the last line, the total distance is 58003.82 m and the fleet needs to spend 3890.02 yuan to complete all the deliveries. However, five vehicles are needed when HACO is used to solve the TWVRP example in Table 14, and these five vehicles are almost fully utilized compared with the six vehicles for Table 13. The total distance are 55375.08 m, which is 2628.74 m less than the total distance in Table 13. The cost of the fleet to complete all deliveries is 3276.88 yuan and decreases from 613.14 yuan. Therefore, through the application and analysis of examples, it can be shown that the proposed HACO is effective and has practical significance.

Conclusion
This paper mainly discusses the problem of vehicle routing with time window, to reduce the transportation distance and the transportation cost of vehicles, so a hybrid ant colony algorithm is proposed in this paper. Compared with the basic ant colony algorithm, the HACO changes the pheromone volatile factor from a fixed constant to a dynamic value, and this means that the optimal solution to the problem can be found by constantly adjusting the numerical values during the operation of the algorithm to improve the convergence of the algorithm. The pheromone updating formula for the ACO is improved, and with the participation of adaptive volatile factors, the pheromone concentration can increase or decrease according to the advantages and disadvantages of the path. To test the performance of HACO, we apply it to Solomon instances and the results showed that the proposed algorithm has good performance. The future research direction will consider the multi-objective green vehicle routing problem, not only to optimize the vehicle distance and cost, but also to take customer satisfaction on the service as the optimization goal. In addition, reducing vehicle exhausted emissions has been a new idea in the research of vehicle routing problems in recent years, so carbon dioxide emissions should also be taken as an optimization goal.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.