Simplified Swarm Optimization for the Heterogeneous Fleet Vehicle Routing Problem with Time-Varying Continuous Speed Function

Transportation planning has been established as a key topic in the literature and practices of social production, especially in urban contexts. To consider traffic environment factors, more and more researchers are taking time-varying factors into account when scheduling their logistic activities. The time-dependent vehicle routing problem (TDVRP) is an extension of the classical Vehicle Routing Problem with Time Windows (VRPTW) by determining a set of optimal routes serving a set of customers within specific time windows. However, few of them use the continuous speed function to express the time-varying. In practice, many vehicle routing problems are addressed by a fleet of heterogeneous vehicles with different capacities and travel costs including fix costs and variable costs. In this study, a Heterogeneous Fleet Vehicle Routing Problem (HFPRP) Time-Varying Continuous Speed Function has been proposed. The objective is to minimize distribution costs, which contained fixed costs of acquiring and variable fuel costs. To address this problem, our research developed a mathematical model and proposed a Simplified Swarm Optimization (SSO) heuristic for HFVRP with Time-Varying Continuous Speed Function.


Introduction
Throughout recent decades, transportation planning has been established as a key topic in the literature and practices of social production. Especially in urban contexts, due to industrial strategies, urbanization, city design and unforeseen accidents, weather conditions, traffic congestion, logisticians and citizens face many challenges related to delivery delays [1]. The traffic environment is dynamically changing, which increases the complexity of the problem, the most obvious one being time-varying travel time. Travel velocity is significantly reduced during peak hours. Therefore, to achieve socioeconomic and environmental sustainability in city transportation, a major intervention on time-varying congestion is needed.
Problems related to the distribution of goods between the warehouse and the final customer are generally considered as the vehicle routing problem (VRP). The vehicle routing problem was first raised by Dantzig and Ramser [2]. Clarke and Wright [3] added more practical restrictions for the problems, in which the delivery of goods to each customer should have occurred in the bound. Such a problem model is called the Vehicle Routing Problem with Time Windows (VRPTW). The actual distribution process is much more complex, such as travel speeds on the road varying substantially during peak and off-peak hours in the urban areas. Consequently, Malandraki and Daskin [4] first took the existence of diversified conditions of traffic at different times of the day. They discussed the Time-Dependent Vehicle Routing Problem (TDVRP) where the travel time was based on "a step function distribution". Unfortunately, this model does not satisfy the First-In-First-Out (FIFO) property which ensures that if a vehicle leaves a node i for a node j at a given time, any other vehicle leaving a node i for a node j at an earlier time will arrive earlier at node j. Without the "FIFO" property, that is, a vehicle can depart later than another vehicle and arrive earlier at its destination, even if the same path is followed by the two vehicles. This situation is contrary to reality, but it happens in the assumptions of the model, for example, if one vehicle waits just a little before departing to catch a faster travel time associated with the next interval.
Previous studies tend to use different travel link times of node i and node j to guarantee the FIFO property. Ichoua et al. [5] presented a model based on time-dependent travel speeds that they proved to be better at modeling time-dependency, and the FIFO assumption is not necessarily satisfied either. The idea of time-varying speed is adopted in our problem as well. At the same time, the time-varying continuous speed model is closer to the actual distribution situation, the speed of vehicles changes smoothly, rather than a step-change at a certain moment [6,7].
Apart from the Time-Dependent VRPs, another variant of the VRPs is named the Heterogeneous Fleet Vehicle Routing Problem (HFVRP), where a heterogeneous fleet of vehicles is used for the distribution activities; see Baldacci et al. [8]. The HFVRP with a limited number of vehicles proposed by Taillard [9] involves optimizing the vehicle routes with the available fixed fleet. The idea is not only to consider the routing of the vehicles, but also the fleet composition. Relating to the type of costs (fixed and variable) to be minimized, two different objective functions have been considered.
In the case of just-in-time (JIT) production and urban logistics distribution, timevarying speed, time windows, and heterogeneous fleet settings naturally occur and are therefore more in line with the actual distribution situation. Logistics need to find a balance between costs and quality of service. This route construction problem has been encountered by the authors in several contexts: e.g., cold chain logistics [10], fresh logistics [11], milk run [12], automated guided vehicle (AGV) systems [13], freight distribution [14], JIT production [15], B2C e-commerce [16], inter-vehicle communication [17], vaccine distribution [18], and so on. Nonetheless, there are few cases involving optimization of vehicle type selection and route distribution under the minimizing of total cost based on a continuous time-varying speed model which are closer to the actual distribution situation.
Solving VRP is computationally expensive as it is categorized as NP-Hard; see Lenstra and Kan [19]. Metaheuristics approaches are necessary to solve this problem within considerable computational time. Compared to the classical heuristic, metaheuristics carry out a more thorough search of the solution space. Thus, they are notably capable of consistently producing high-quality solutions, despite the greater computational time than early heuristics; see Cordeau et al. [20]. They have been successfully applied for different combinatorial optimization problems. However, in the scientific literature, almost all existing memetic algorithms for solving different VRP variants follow the framework of genetic algorithms (GA) [21][22][23] or the Particle Swarm Optimization algorithm (PSO) [24,25] and very rarely, the framework of Simplified Swarm Optimization algorithms.
As one metaheuristic methodology, the Simplified Swarm Optimization (SSO) is often used to address both discrete and continuous optimization problems (Yeh [26]; Yeh [27]; Yeh and Chuang [28]). SSO has some attractive advantages such as its ability to deal with non-linear models, chaotic and noisy data, and many constraints.
The rest of this paper is organized as follows. In Section 2, the literature review is presented, and the problem statement is described in Section 3. Simplified Swarm Optimization is presented in Section 4. Details of the computational result and analysis about the problem are presented in Section 5. Section 6 draws conclusions and possible future research.

Literature Review
Vehicle Routing Problems (VRP) are essential elements of distribution systems for delivering goods and services. The effective management of these vehicles could improve As the Time Dependent VRP (TDVRP) was proposed, since its assumption was more in line with the realistic world, the TDVRP has attracted the attention of many researchers. However, literature on the speed model remains scarce. The pioneering work has been done by Malandraki and Daskin [4] and Malandraki and Dial [29]. In these papers, mixed-integer linear programs (MILP) and several heuristics to solve the problem are proposed. However, these models may potentially violate the First-In-First-Out (FIFO) property, which implies that for every arc, a later departure time results in a later (or equal) arrival time.
As opposed to Malandraki and Daskin [4], Ichoua, Gendreau, and Potvin [5] proposed an alternative approach model; a stepwise speed function was proposed, resulting in a piecewise linear travel time function, like the one illustrated in Figure 1a, where the day is divided into several time periods and a speed is associated with each period. For a given arc, a stepwise speed function can easily be translated into a corresponding piecewise linear travel time function, as shown in Figure 1b.

Literature Review
Vehicle Routing Problems (VRP) are essential elements of distribution systems for delivering goods and services. The effective management of these vehicles could improve customers' experience of delivery and minimize the total routing costs. Due to the wide application of logistics distribution scenarios, there is more and more research on VRPs, so there are a lot of different objective types and limit types of VRPs.
Hence, we have briefly reviewed two different types of VRPs: (1) those that model Time-Dependent travel time VRP with a speed model, (2)

Time Dependent Vehicle Routing Problem with Time-Varying Speeds
As the Time Dependent VRP (TDVRP) was proposed, since its assumption was more in line with the realistic world, the TDVRP has attracted the attention of many researchers. However, literature on the speed model remains scarce. The pioneering work has been done by Malandraki and Daskin [4] and Malandraki and Dial [29]. In these papers, mixedinteger linear programs (MILP) and several heuristics to solve the problem are proposed. However, these models may potentially violate the First-In-First-Out (FIFO) property, which implies that for every arc, a later departure time results in a later (or equal) arrival time.
As opposed to Malandraki and Daskin [4], Ichoua, Gendreau, and Potvin [5] proposed an alternative approach model; a stepwise speed function was proposed, resulting in a piecewise linear travel time function, like the one illustrated in Figure 1a., where the day is divided into several time periods and a speed is associated with each period. For a given arc, a stepwise speed function can easily be translated into a corresponding piecewise linear travel time function, as shown in Figure 1b. This new travel time model satisfies the FIFO principle since a vehicle can only arrive later at the destination if it departs later. The time-dependent speed model is commonly adopted in later publications on VRP variants with time-dependent travel times Çimen and Soysal [30] addressed a TDVRP with stochastic vehicle speeds and environmental concerns and formulated the problem as a Markovian Decision Process. Soysal and Çimen [31] also proposed a GTDVRP that accounts for transportation emissions, and the problem has been formulated and solved using the Dynamic Programming approach. Sun et al. [32] introduced a time-dependent capacitated profitable tour problem with the object to maximize the profit and developed a tailored labeling algorithm to find the optimal tour. Wang, Assogba, Fan, Xu, Liu, and Wang [14] presented a bi-objective model This new travel time model satisfies the FIFO principle since a vehicle can only arrive later at the destination if it departs later. The time-dependent speed model is commonly adopted in later publications on VRP variants with time-dependent travel times Çimen and Soysal [30] addressed a TDVRP with stochastic vehicle speeds and environmental concerns and formulated the problem as a Markovian Decision Process. Soysal and Çimen [31] also proposed a GTDVRP that accounts for transportation emissions, and the problem has been formulated and solved using the Dynamic Programming approach. Sun et al. [32] introduced a time-dependent capacitated profitable tour problem with the object to maximize the profit and developed a tailored labeling algorithm to find the optimal tour. Wang, Assogba, Fan, Xu, Liu, and Wang [14] presented a bi-objective model which focused on freight distribution to minimize total carbon emission and operating cost. Adriano, Montez, Novaes, and Wangham [12] also proposed a dynamic model to simulate the milk-run tours with time windows, using the auxiliary vehicle to deal with traffic jams. Liu et al. [33] proposed TDVRPTW to minimize the sum of the fixed costs of the vehicle used, as well as the costs of drivers, fuel consumption, and carbon emissions. Pan et al. [34] studied  [35] also proposed a multi-trip time-dependent vehicle routing problem with time windows (MT-TDVRPTW) and formulated the timedependent ready time function and duration function for any segment of consecutive nodes as piecewise linear functions. Gmira et al. [36] proposed a time-dependent vehicle routing problem with time windows in which travel speeds are associated with road segments in the road network.
Few papers use the time-varying speed of continuous function. Xiao and Konak [37] defined GVRSP which considers heterogeneous vehicles and time-varying traffic congestion where the speed of smooth period is variable. Huang et al. [38] proposed the time-varying speed of the linear continuous function model, but without detailed specification, and their research only studied two types of vehicles with a fixed cost. Xu, Elomri, Pokharel, and Mutlu [21] extended the period-based speed pattern to be a time-varying speed pattern. The approximate corresponding function denoting the relationship between the departure time t and the vehicle speed v(t) can be characterized by the trigonometric function. Fan, Zhang, Tian, Lv, and Fan [23] continued the assumption in which speed is a trigonometric function of the departure time and applied it in time-dependent multi-depot GVRP. We should still express the time-varying speed as a linear continuous function, without loss of generality, and amplify the speed transformation time to illustrate the time-varying speed of continuous function.

Heterogeneous Fixed Fleet Vehicle Routing Problem
In practice, many vehicle routing problems are addressed by a non-homogeneous vehicle fleet where vehicles of different capacities are used. Heterogeneous fleets VRPs (HFVRPs) are consider a limited or an unlimited fleet of capacitated vehicles, with a problem consisting of determining the fleet composition and vehicle routes [39].
There are two major HVRPs: the Heterogeneous Fixed Fleet Vehicle Routing Problem (HFFVRP) and the Fleet Size and Mix Vehicle Routing Problem (FSMVRP). HFFVRP was proposed by [9] in which the fleet is predetermined. FSMVRP considers an infinite availability of vehicles of different type, proposed by [40]. In HFFVRP, the number of vehicles is a constraint but in the presence of a large number of vehicles, not all of them may be used. In FSMVRP, part of the decision is to determine the composition of the fleet. FSMVRP can be treated as a particular HFFVRP [9].
Since HFFVRP models can better simulate the actual distribution situation and achieve a better balance of economic and environmental sustainability simultaneously (Micheli and Mantella [41]), HFFVRP has been extensively studied. Afshar-Nadjafi and Afshar-Nadjafi [42] introduced a time-dependent multi-depot vehicle routing problem to minimize total cost and formulated the problem as mixed-integer programming. Vincent et al. [43] developed a Heterogeneous Fleet Pollution Routing Problem (HFPRP) to minimize the total costs of fuel which contain vehicle variable cost and greenhouse gas emissions. Wang et al. [44] proposed a heterogeneous fleet to provide services for a very large transportation network, which also determined the number of vehicles of different types that facilitated on each service link, to better reflect real applications. The proposed methodology is applied to a real-world network, which shows the necessity of considering a heterogeneous fleet. De and Giri [45] studied a closed-loop supply chain with a heterogeneous fleet to minimize carbon emissions. Soman and Patil [46] introduced a heterogeneous fleet vehicle routing problem with release and due dates in the presence of consolidation of customer orders and limited warehousing capacity. Cao, Liao, and Huang [22] addressed a vehicle routing problem considering an electric heterogeneous fleet for a two-echelon recycling network, recycling stations, and recycling centers: with the goal of minimizing the total cost, a recycling heterogeneous fleet electric vehicle routing model with time windows.
The case we proposed is associated with the Heterogeneous Fixed Fleet Vehicle Routing Problem, since the size of the fleet is known for each type of the vehicle, but  Table 1.

Time Dependent Vehicle Routing Problem with Time-Varying Speeds of Continuous Function
The classic Time Dependent Vehicle Routing Problem with Time-Varying Speeds can be described as follow.
is the arcs set (subscript means sequence), link node i, and node j with its distance d ij . The time horizon is divided into b time intervals T = {T 1 , T 2 , . . . , T b }. The travel speed for an arc remains constant within each time zone T b but changes at the end of the time zones and without loss of generality, and the time zones are set to be the same for all the arcs. The travel time on a given arc v i , v j is then derived based on its distance d i,j and its speed profile.
Even though many works in TDVRP have been carried out with time-varying speeds, the investigation carried out by the Texas A&M Transportation Institute Jha and Eisele [7] mentioned that the traveling speed increases or decreases smoothly, rather than treating it as a stepwise function. The drawbacks of this model are very obvious and, as shown in the Figure 2, will lead to breakpoints; although it can be said that the change in speed takes much less time than delivery at a constant speed. Hence, we present a time-varying speed model of a continuous function, as shown in the Figure 3a. Even though many works in TDVRP have been carried out with time-varying speeds, the investigation carried out by the Texas A&M Transportation Institute Jha and Eisele [7] mentioned that the traveling speed increases or decreases smoothly, rather than treating it as a stepwise function. The drawbacks of this model are very obvious and, as shown in the Figure 2, will lead to breakpoints; although it can be said that the change in speed takes much less time than delivery at a constant speed. Hence, we present a time-varying speed model of a continuous function, as shown in the Figure 3a.

Proposition 2.
Since travel distance corresponds to travel time one-to-one, then the time-dependent travel time function is the inverse function of travel distance. Using this one-to-one correspondence relationship, when the departure time and travel distance are known, the travel time can be calculated.

Heterogeneous Fixed Fleet Vehicle Routing Problem
Heterogeneous fleets VRPs (HVRPs) are considered a limited or unlimited fleet of capacitated vehicles, with problems, which consist of determining the fleet composition and vehicle routes (Koç, Bektaş, Jabali, and Laporte [39]). Let be the set of vehicles with m types, each type vehicle max available number be ℎ , and subscript m be the type of vehicle (which will be used in the following text). The maximum load capacity of m type vehicle is , the time-varying speed function of m type vehicle is fun − speed ( , ), where , is the departure time from node i to node j, the timevarying travel time function is fun − time ( , , ), and is the distance linking node i and node j, as mentioned before. Every type of car has a fixed cost , which is referred to as the cost of buying or renting, and a variable cost , used to express the cost per kilometer per kilogram of the weight of goods. Assumptions 1. The depot has a demand equal to zero 2. Each customer location is serviced from only one vehicle 3. Each customer's delivery must arrive within the time window 4. The number of each type of vehicle in routing cannot exceed each type of vehicle; the maximum available number is ℎ 5. Each vehicle shall not exceed its maximum load capacity 6. The total delivery time of each vehicle shall not exceed 9 h

Heterogeneous Fixed Fleet Vehicle Routing Problem
Heterogeneous fleets VRPs (HVRPs) are considered a limited or unlimited fleet of capacitated vehicles, with problems, which consist of determining the fleet composition and vehicle routes (Koç, Bektaş, Jabali, and Laporte [39]). Let M m be the set of vehicles with m types, each type vehicle max available number be veh m , and subscript m be the type of vehicle (which will be used in the following text). The maximum load capacity of m type vehicle is cap m , the time-varying speed function of m type vehicle is fun − speed m t dep,ij , where t dep,i is the departure time from node i to node j, the time-varying travel time function is fun − time m t dep,ij , d ij , and d ij is the distance linking node i and node j, as mentioned before. Every type of car has a fixed cost f c m , which is referred to as the cost of buying or renting, and a variable cost vc m , used to express the cost per kilometer per kilogram of the weight of goods. Assumptions

1.
The depot has a demand equal to zero 2.
Each customer location is serviced from only one vehicle 3.
Each customer's delivery must arrive within the time window 4.
The number of each type of vehicle in routing cannot exceed each type of vehicle; the maximum available number is veh m 5.
Each vehicle shall not exceed its maximum load capacity cap m 6.
The total delivery time of each vehicle shall not exceed 9 h Notations used in problem statement are defined as follows. Detail model sets, indices, and parameters are shown in Table 2. Table 2. Sets, indices, and parameters.

Fitness Function and Mathematical Model
The traditional logistics model is concerned with minimizing total cost in a network. This is where the concept of Vehicle Routing Problem (VRP) is best applied. We follow this concept and add the fixed cost f c m of each type of vehicle into the total cost to minimize the total number of vehicles. We also include the variable cost vc m of delivery of each type of vehicle to optimize the vehicle scheduling. Other constraints appear in the target calculation in the form of penalty functions to enforce the constraints of the limit. The objective of minimizing the total cost is as follows: Subject to Routing Demand and Capacities Time Windows The objective function (1) is total cost including fixed cost and variable cost. Constraint (2) defines that each vehicle should back to the Depot that subscript stands for 0. Constraint (3) ensures that each node can only be visited once in a route. Constraint (4) states that if a vehicle arrives at a node, it must leave it, and by this way, the route continuity is ensured. Constraints (10) and (11) state the restrictions for the amount of demand and capacities. Constraint (7) defines the maximum number of available vehicles veh m . Constraints (8) and (9) are the time window restrictions. Constraint (11) ensures that each vehicle cannot delivery over 9 h.

Simplified Swarm Optimization
As a generalization of VRP, the TDVRP and HFFVRP are also NP-hard and require intentional investigation for problem modeling and algorithmic design.

Simplified Swarm Optimization
SSO is one of the simplest machine-learning methods (Wang et al. [54][55][56] Yeh, et al. [57]) in terms of its update mechanism. It was first proposed by Yeh [27], and has been tested to be a very useful and efficient algorithm for optimization problems, including network reliability (Yeh [58] Yeh, et al. [59]), deep learning training (Yeh [60] Yeh, Lin, Liang and Lai [57]), disassembly sequencing problems (Yeh [61] Yeh [62]), energy problems (Lin et al. [63]), and so on. Owing to its simplicity and efficiency, SSO is used here to find the best values in vehicle routing of the proposed HFVRP with Time-Varying Continuous Speed Function.
The basic idea of SSO is that each variable, such as the jth variable in the ith solution x i,j , needs to be updated based on the following stepwise function (Yeh [55,62]): where the value ρ [0,1] ∈ [0,1] is generated randomly, the parameters C g , C p − C g , C w − C p , 1 − C w are all in [0,1] and are the probabilities of the current variable that are copied and pasted from the best of all solutions, the best ith solution, the current solution, and a random generated feasible value, respectively. There are different variants of the traditional SSO that are customized to different problems from the no free lunch theorem; for example, the four items in Equation (11) are also reduced to three items to increase the efficiency; parameters C g , C p , and C w are all self-adapted; special values or equations are implemented to replace g j , p i,j , x i,j , and x; or only a certain number of variables is selected to be updated, etc. However, the SSO update mechanism is always based on the stepwise function.

Example for Code and Decode
To explain how the model works, a small instance from Vincent, Redi, Jewpanya, Lathifah, Maghfiroh, and Masruroh [43] was used for testing with 1 depot, 5 customers, and 3 types of vehicles. Table 1 shows the part of parameters for each vehicle from Vincent, Redi, Jewpanya, Lathifah, Maghfiroh, and Masruroh [43], since our research focus on the total cost which included fixed cost and variable cost, instead of the pollution cost in Vincent, Redi, Jewpanya, Lathifah, Maghfiroh, and Masruroh [43] study, some of the parameter settings have been omitted which can be known in detail in the Vincent, Redi, Jewpanya, Lathifah, Maghfiroh, and Masruroh [43] paper. Tables 3 and 4 present the corresponding values for the distance matrix (in meters), demand, time window, and service time.  The route result given by the Vincent, Redi, et al. study is shown as follow Route is 0-5-4-3-0, total distance is 95,500, vehicle type is type 2; Route II is 0-1-0, total distance is 81,810, vehicle type is type 1; Route III is 0-2-0, total distance is 50,690, vehicle type is type 1. Total distance of Route I, Route II, and Route III is 228,000, and total variable cost is 27.575 If code, this route result using SSO, first, should give each vehicle type the maximum available number veh m . Assume that each type of vehicle can complete the distribution task separately; since the total demand of customers is 3607, which requires veh 1 = 4, veh 2 = 2, veh 3 = 1. According to the HFFVRP problem mentioned above, now, we need to decide the routing problem of 7 cars for 3 types of vehicles. And the representation using SSO is shown in Table 5. Table 5. Representation using SSO.
The integer part of each number stands for the vehicle that will service, the same integer parts represent the same vehicle for serving the customers, and the order depends on value. For example, V 3 , V 4 , V 5 have the same integer parts, which means they are all delivered by vehicle 5 belong to type 2. The route is dependent on the value, since 5.1 < 5.2 < 5.3, so the route of vehicle 5 is 0-5-4-3-0.
After an iterative update of SSO, the final solution is shown in the Table 6. The route is 0-2-5-1-4-3-0, service is by vehicle type 3, and the total distance is 146,680, which is much smaller than Vincent and Redi's result. More importantly, the variable cost of Vincent and Redi's model does not reflect the distribution cost caused by the load of the delivered goods, which is inconsistent with the actual distribution process In practice, logistics companies will buy or rent vehicles with large volume ratings because the average variable cost per kilogram and per meter is lower due to the scale effect. For example, the average demand is 721.4, the average distance is 24,446.7 (take the best solution as an example), the variable cost will be a thousand, so we present a new parameters setting, as shown in Table 7, which will be used in the subsequent test indices, and new optimum route results as Table 8. New optimum route is shown as follow Route I 0-5-0, delivery by vehicle type 1; Route II 0-2-0, delivery by vehicle type 2; Route III 0-4-0, delivery by vehicle type; Route IV 0-3-1-0, delivery by vehicle type 3.

SSO Algorithm Pseudo Code
In order to increase the speed of searching for the best solution, the part of inheriting the solution from the previous generation is cancelled, and the update mechanism is changed to If Gbest t > min Pbest t m Gbest t = min Pbest t m , GbestS t = min PbestS t m Otherwise Gbest t = Gbest t , GbestS t = GbestS t STEP 3.

Computational Experiments
In this section, the experimental results are reported. First, the details for the results of the case study are presented. Next, the current solution obtained by the GA and PSO is used to compare with the results obtained by both the mathematical model and the algorithm. The benchmark instance is based on the Pollution Routing Problem dataset. The datasets are taken from http://www.apollo.management.soton.ac.uk/prplib.htm, accessed on 1 June 2021 (operating environment: Intel(R) Core(TM) i-74770K CPU@3.50 GHz 3.50 GHz, memory 16.0 GB).
Vehicle setting as mentioned before, vc m ; unit change to (£/kg·km) as shown in Table 7. Vehicle type 1 belongs to "slow vehicle, travel speed type 1"; vehicle type 2, 3 belong to "quick vehicle, travel speed type 2"; the time-varying continuous travel speed function and time-varying travel time function are as in Figures 4-6.       Take UK10_01, for example, to illustrate the calculation; the units are adjusted to kilometers and hours. After the adjustment, the service time can be ignored and is not considered in this study. The parameters after adjusted as show in the Table 9.The result comparison is shown is Table 10. Parameter setting of GA algorithm, the crossover rate and mutation rate are 0.6 and 0.4 Parameter setting of PSO algorithm, w = 0.5, 1 = 2 = 2 Parameter setting of SSO algorithm, = 0.5, = = 0.75, Take UK10_01, for example, to illustrate the calculation; the units are adjusted to kilometers and hours. After the adjustment, the service time can be ignored and is not considered in this study. The parameters after adjusted as show in the Table 9. The result comparison is shown is Table 10. Table 9. Parameters for the UK10_01. Parameter setting of GA algorithm, the crossover rate and mutation rate are 0.6 and 0.4 Parameter setting of PSO algorithm, w = 0.5, C 1 = C 2 = 2 Parameter setting of SSO algorithm, C g = 0.5, C p = C w = 0.75, More detailed information can be found in Appendix A. From the result, bold is a better solution, shows that the SSO outperforms the original GA and PSO with respect to the average cost (run 5 times independently to take the average value) and runtime. In terms of runtime, SSO and PSO are close, slightly better than PSO. The objective value of the GA is also good, but it takes longer to run, due to the update mechanism of the GA.

Conclusions
In urban areas, traffic conditions show a discrepancy throughout the day and the travel time between two locations depends on the time of the day. Even though there are many discussions about the time-dependent model, few adopted the time-varying speed model which can better reflect different road time conditions and naturally satisfy the FIFO property. Thus, we present a novel model using the Time-Varying Continuous Speed Function to explain the time-varying traffic condition effect on delivery.
Moreover, in real conditions, a logistics company can choose a different vehicle to deliver the goods to minimize the total cost including fixed cost and variable cost. In our research, we proposed three types of vehicles with different capacities and costs. By comparing with [43], it is proved that our model can better reflect the actual distribution process and optimize vehicle selection and vehicle routing in the process of minimizing the total cost.
Owing to the complexity of the problem, we use SSO to address the proposed problem and use a Pollution Routing Problem dataset to validate it and compare the result with GA and PSO, which have been widely used in solving VRP problems. The results obtained from the analysis show that the SSO outperforms the original GA and PSO with respect to the total cost and runtime. We acknowledge some limitations in the current study, but these limitations also provide opportunities for further research: for example, applying the SSO to solve larger-scale problems. For the problem of the wide interval time window, path planning is not obviously constrained by the time window, and service time has little impact on distribution planning. Therefore, the problem of a narrow time window can be considered in the future.

Conflicts of Interest:
The authors declare no conflict of interest.