# An Effective Heuristic for Multidepot Low-Carbon Vehicle Routing Problem

Authors: LiLing Liu; LiFang Lai
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Low-carbon economy has been a hot research topic in recent years. This paper firstly considers the vehicle load weight, the key factors affecting the fuel consumption, to establish the fuel consumption model, and then constructs the vehicle routing planning model in the last mile delivery with multiple depots within time windows. In order to solve this problem, we improve the classical fruit fly algorithm which is easy to fall into the local optimum, and the improved fruit fly optimization algorithm is designed and integrated with genetic algorithm. Computational results show that our solution approach is capable of solving instances with up to 48 customers and 4 different depots. The effectiveness and efficiency of the model and multigroup fruit fly algorithm are verified through case study.


---

## Body

## 1. Introduction

In recent years, the scale of online retail market continues to expand in China, accounting for a large proportion of the total retail sales of social consumer goods. In 2018, the national online retail sales exceeded 9 trillion yuan, of which the online retail sales of physical goods reached 7 trillion yuan in China. At the same time, the rapid development of online shopping industry also puts forward higher requirements for the construction of e-commerce logistics distribution system. In the distribution process of online shopping goods, the “last mile” distribution speed directly affects the user experience of consumers [1]. Therefore, e-commerce enterprises strive to deliver products to consumers in the shortest time and are committed to the innovation and competition of terminal distribution mode. For example, Jingdong has set up 300000 terminal service outlets nationwide, launched various time effective distribution services such as “the next day delivery” and “the same day delivery”, and upgraded the delivery time to half an hour through “jingzhunda” service; Suning has established 19 large-scale logistics centers and 60 regional logistics distribution centers nationwide, providing consumers with various services such as second delivery, half day delivery, on-time delivery, and next day delivery “Last mile” distribution service.“Last mile” terminal distribution is essentially a multidepot vehicle routing problem (MDVRP). At present, MDVRP is becoming a research hotspot in academic circles. In order to minimize the total logistics cost, Renaud et al. [2] proposed MDVRP with vehicle capacity and mileage as constraints and designed tabu search algorithm to solve the problem. Mirabi et al. [3] studied MDVRP with the goal of minimum delivery time and proposed a random hybrid heuristic algorithm. Kuo et al. [4] designed a three-stage variable neighborhood search algorithm for MDVRP with loading cost. Liu et al. [5] studied MDVRP in the case of multicarrier cooperation and proposed a two-stage greedy heuristic algorithm. Salhi et al. [6] established the MDVRP model of heterogeneous vehicles and extended it on whether the stations are shared, the number limit of each type of vehicles, and the capacity limit of each depot. Oliveira et al. [7] transformed MDVRP into multiple VRPs for solving and designed a coevolutionary algorithm for solving.With the rapid development of e-commerce logistics, the carbon emissions in distribution activities are also increasing, especially the high energy consumption and pollution. According to the International Energy Association report released in 2016, transportation is the second largest industry causing CO2 emissions [8]. In February 2018, the general office of the State Council issued the opinions on promoting the collaborative development of e-commerce and express logistics, which advocated the construction of a low-carbon green logistics system. Therefore, well-known e-commerce enterprises such as Jingdong and Alibaba are also publishing their own green logistics plans. Bektas et al.’s [9] research shows that the carbon emission of distribution vehicles is mainly proportional to the fuel consumption, so the carbon emission can be reduced by optimizing the fuel consumption. Therefore, the author studies many factors affecting the fuel consumption of distribution vehicles and finds that the driving speed and driving distance of distribution vehicles will have a significant impact on the fuel consumption. Klapp et al. [1] proposed that vehicle load, engine type and size, road slope, and other factors have a certain relationship with fuel consumption of distribution vehicles and further affect carbon emissions. Considering the proportional relationship between fuel consumption and carbon emissions, Demir et al. [10] proposed that the fuel consumption can be effectively reduced by reasonably scheduling distribution vehicles and optimizing distribution routes, so as to reduce the fuel cost and carbon emissions in logistics distribution, ultimately reduce the logistics cost of distribution companies, and improve social benefits. Therefore, this paper attempts to consider the impact of fuel consumption on the distribution route in the “last mile” distribution and strive to achieve the purpose of reducing fuel consumption and carbon emissions by optimizing the distribution route.In the e-commerce shopping environment, there is a lack of direct contact between customers and products, so consumers will have the insecurity of online shopping [11]. Funches’s [12] research shows that when the waiting time of online shopping consumers exceeds the expected waiting time, customers tend to think that e-commerce does not keep its promise, resulting in lower consumption experience. Therefore, the timeliness of distribution has become the key to the logistics service quality of online shopping industry and the biggest problem faced by the development of e-commerce enterprises. When consumers place orders, e-commerce enterprises often promise to deliver goods to customers within a certain deadline. In this situation, the promised delivery mechanism of logistics distribution can provide psychological expectation of delivery time for consumers and enhance the security of online shopping. McNabb et al. [13] considered the limitation of delivery time window and established a distribution vehicle scheduling model based on ant colony algorithm, in order to reduce customer waiting time. Qureshi et al. [14] established a mixed-integer programming model considering the latest receiving time limit of customers.So, how will the policy requirements of low-carbon emission affect the operation of terminal distribution? Considering the latest receiving time limit of consumers, how should e-commerce enterprises optimize the terminal distribution path? In order to deeply analyze and answer the above questions, this paper attempts to propose an MDVRP considering the consumers’ overtime payment penalty and fuel consumption optimization under the condition of consumers’ latest receiving time and designs a multipopulation fruit fly algorithm to solve the problem.


## 2. Formulation

### 2.1. Fuel Consumption Model

Sahin et al. found that the fuel consumption cost accounts for 60% of total logistics cost with the full load of 20 t per 1000 km. In addition, the reduction of the fuel consumption is good for the environment [15]. Xiao et al. [16] and Suzuk [17] established the fuel consumption model considering travel distance and load which is two main factors affecting the fuel consumption through investigation, and the fuel consumption can reduce by optimizing the vehicle routing. Based on the above research, ρ∗ and ρ0 represent the fuel consumption rate with full load and empty load, respectively, Q stands for maximum loading capacity, and ρQ1 stands for fuel consumption per km with a load of Q1 (kg):(1)ρQ1=ρ0+ρ∗−ρ0QQ1.


### 2.2. Problem Description and Formulation

A city logistics distribution system has distribution centers and customers. In order to minimize the logistics cost and driving distance, it is required to arrange the distribution vehicles and their driving routes reasonably under the constraints of vehicle load and driving distance. In order to establish the mathematical model of the problem, the symbol is defined as follows.


#### 2.2.1. Symbol Description

C: Set of consumers C=v1,v2,…,vn, representing a consumerD: Set of distribution centers, D=vn+1,vn+2,…,vn+mN: Set of consumers and distribution centers, N=C∪DA: Path set, A=i,j|i,j∈N,i≠jK: Set of distribution vehicles, K=k1,k2,…,kS, representing the total number of vehiclesω: The empty net weight of the delivery vehicleQk: The maximum loading capacity of distribution vehiclesLk: The maximum driving distance of distribution vehicles kk∈Kqi: Consumer demand 0≤qi≤Q,i∈Csi: The service time of distribution vehicles in providing distribution services for consumersTi: The latest delivery time promised by e-commerce platform to consumersdij: The Euclidean distance between any two points, dij=dji,i,j∈N, indicating the symmetric pathChc: Rental cost per vehicleCvc: Variable cost of vehicle unit mileage (mainly including variable cost such as driver’s salary cost)Cfe: Unit fuel consumption costCpi: The delay penalty coefficient to be paid to consumers when delivery is delayedV: Average speed of delivery vehiclesρij: Fuel consumption rate of vehicles on and between Routes i,jxijk: 0–1 variable, if the vehicle passes by a route value of 1; otherwise it is zerogijk: The amount of goods to be transported when the delivery vehicle passes the route i,jai: Ready time of consumer i, i∈Cli: Delivery vehicle departure time from consumer i to next consumer j, i,j∈CPi: Delayed service time for consumer i, i∈C


#### 2.2.2. Model considering Fuel Consumption

The model built in this paper is as follows:(2)MinChc∑k∈K∑i∈D∑j∈Cxijk+Cvc∑k∈K∑i∈N∑j∈Ndijxijk+Cfc∑k∈K∑i∈N∑j∈Nρ0+ρ∗−ρ0Qfijkdijxijk+Cpi∑i∈CPi,(3)s.t.∑k∈K∑j∈Nxijk=∑k∈K∑i∈Nxijk=1,∀i,j∈C,(4)∑i∈Nxihk−∑j∈Nxhjk=0,∀k∈K;h∈N,(5)∑i∈Nqi∑j∈Nxijk≤Qk,∀k∈K,(6)∑i∈N∑j∈Ndijxijk≤Tk,∀k∈K,(7)qjxijk≤gijk≤Q−qixijk,∀i,j∈A,k∈K,(8)aj≥lj+∑k∈K∑i∈NxijkdijV,∀j∈C,(9)ai+si≤li,∀i∈C,(10)Pi≥ai−Ti,∀i∈C,(11)xijk∈0,1,∀i,j∈N,k∈K,(12)ai,pi,li,fijk≥0,∀i,j∈C;k∈K.Formula (2) denotes the minimization objective function; formula (3) denotes that every consumer is served only once by a vehicle; formula (4) ensures the continuity of the vehicle’s driving path; formulas (5) and (6) denote the capacity constraints and travel time constraints of the vehicle; formula (7) denotes the weight constraints on each segment of the driving path during the vehicle's driving process; formulas (8) and (9) indicate the actual delivery time limit; formula (10) indicates the delay delivery time limit of a consumer; formula (11) indicates the 0–1 variable constraint; formula (12) indicates the nonnegative limit of a variable.


## 2.1. Fuel Consumption Model

Sahin et al. found that the fuel consumption cost accounts for 60% of total logistics cost with the full load of 20 t per 1000 km. In addition, the reduction of the fuel consumption is good for the environment [15]. Xiao et al. [16] and Suzuk [17] established the fuel consumption model considering travel distance and load which is two main factors affecting the fuel consumption through investigation, and the fuel consumption can reduce by optimizing the vehicle routing. Based on the above research, ρ∗ and ρ0 represent the fuel consumption rate with full load and empty load, respectively, Q stands for maximum loading capacity, and ρQ1 stands for fuel consumption per km with a load of Q1 (kg):(1)ρQ1=ρ0+ρ∗−ρ0QQ1.


## 2.2. Problem Description and Formulation

A city logistics distribution system has distribution centers and customers. In order to minimize the logistics cost and driving distance, it is required to arrange the distribution vehicles and their driving routes reasonably under the constraints of vehicle load and driving distance. In order to establish the mathematical model of the problem, the symbol is defined as follows.


### 2.2.1. Symbol Description

C: Set of consumers C=v1,v2,…,vn, representing a consumerD: Set of distribution centers, D=vn+1,vn+2,…,vn+mN: Set of consumers and distribution centers, N=C∪DA: Path set, A=i,j|i,j∈N,i≠jK: Set of distribution vehicles, K=k1,k2,…,kS, representing the total number of vehiclesω: The empty net weight of the delivery vehicleQk: The maximum loading capacity of distribution vehiclesLk: The maximum driving distance of distribution vehicles kk∈Kqi: Consumer demand 0≤qi≤Q,i∈Csi: The service time of distribution vehicles in providing distribution services for consumersTi: The latest delivery time promised by e-commerce platform to consumersdij: The Euclidean distance between any two points, dij=dji,i,j∈N, indicating the symmetric pathChc: Rental cost per vehicleCvc: Variable cost of vehicle unit mileage (mainly including variable cost such as driver’s salary cost)Cfe: Unit fuel consumption costCpi: The delay penalty coefficient to be paid to consumers when delivery is delayedV: Average speed of delivery vehiclesρij: Fuel consumption rate of vehicles on and between Routes i,jxijk: 0–1 variable, if the vehicle passes by a route value of 1; otherwise it is zerogijk: The amount of goods to be transported when the delivery vehicle passes the route i,jai: Ready time of consumer i, i∈Cli: Delivery vehicle departure time from consumer i to next consumer j, i,j∈CPi: Delayed service time for consumer i, i∈C


### 2.2.2. Model considering Fuel Consumption

The model built in this paper is as follows:(2)MinChc∑k∈K∑i∈D∑j∈Cxijk+Cvc∑k∈K∑i∈N∑j∈Ndijxijk+Cfc∑k∈K∑i∈N∑j∈Nρ0+ρ∗−ρ0Qfijkdijxijk+Cpi∑i∈CPi,(3)s.t.∑k∈K∑j∈Nxijk=∑k∈K∑i∈Nxijk=1,∀i,j∈C,(4)∑i∈Nxihk−∑j∈Nxhjk=0,∀k∈K;h∈N,(5)∑i∈Nqi∑j∈Nxijk≤Qk,∀k∈K,(6)∑i∈N∑j∈Ndijxijk≤Tk,∀k∈K,(7)qjxijk≤gijk≤Q−qixijk,∀i,j∈A,k∈K,(8)aj≥lj+∑k∈K∑i∈NxijkdijV,∀j∈C,(9)ai+si≤li,∀i∈C,(10)Pi≥ai−Ti,∀i∈C,(11)xijk∈0,1,∀i,j∈N,k∈K,(12)ai,pi,li,fijk≥0,∀i,j∈C;k∈K.Formula (2) denotes the minimization objective function; formula (3) denotes that every consumer is served only once by a vehicle; formula (4) ensures the continuity of the vehicle’s driving path; formulas (5) and (6) denote the capacity constraints and travel time constraints of the vehicle; formula (7) denotes the weight constraints on each segment of the driving path during the vehicle's driving process; formulas (8) and (9) indicate the actual delivery time limit; formula (10) indicates the delay delivery time limit of a consumer; formula (11) indicates the 0–1 variable constraint; formula (12) indicates the nonnegative limit of a variable.


## 2.2.1. Symbol Description

C: Set of consumers C=v1,v2,…,vn, representing a consumerD: Set of distribution centers, D=vn+1,vn+2,…,vn+mN: Set of consumers and distribution centers, N=C∪DA: Path set, A=i,j|i,j∈N,i≠jK: Set of distribution vehicles, K=k1,k2,…,kS, representing the total number of vehiclesω: The empty net weight of the delivery vehicleQk: The maximum loading capacity of distribution vehiclesLk: The maximum driving distance of distribution vehicles kk∈Kqi: Consumer demand 0≤qi≤Q,i∈Csi: The service time of distribution vehicles in providing distribution services for consumersTi: The latest delivery time promised by e-commerce platform to consumersdij: The Euclidean distance between any two points, dij=dji,i,j∈N, indicating the symmetric pathChc: Rental cost per vehicleCvc: Variable cost of vehicle unit mileage (mainly including variable cost such as driver’s salary cost)Cfe: Unit fuel consumption costCpi: The delay penalty coefficient to be paid to consumers when delivery is delayedV: Average speed of delivery vehiclesρij: Fuel consumption rate of vehicles on and between Routes i,jxijk: 0–1 variable, if the vehicle passes by a route value of 1; otherwise it is zerogijk: The amount of goods to be transported when the delivery vehicle passes the route i,jai: Ready time of consumer i, i∈Cli: Delivery vehicle departure time from consumer i to next consumer j, i,j∈CPi: Delayed service time for consumer i, i∈C


## 2.2.2. Model considering Fuel Consumption

The model built in this paper is as follows:(2)MinChc∑k∈K∑i∈D∑j∈Cxijk+Cvc∑k∈K∑i∈N∑j∈Ndijxijk+Cfc∑k∈K∑i∈N∑j∈Nρ0+ρ∗−ρ0Qfijkdijxijk+Cpi∑i∈CPi,(3)s.t.∑k∈K∑j∈Nxijk=∑k∈K∑i∈Nxijk=1,∀i,j∈C,(4)∑i∈Nxihk−∑j∈Nxhjk=0,∀k∈K;h∈N,(5)∑i∈Nqi∑j∈Nxijk≤Qk,∀k∈K,(6)∑i∈N∑j∈Ndijxijk≤Tk,∀k∈K,(7)qjxijk≤gijk≤Q−qixijk,∀i,j∈A,k∈K,(8)aj≥lj+∑k∈K∑i∈NxijkdijV,∀j∈C,(9)ai+si≤li,∀i∈C,(10)Pi≥ai−Ti,∀i∈C,(11)xijk∈0,1,∀i,j∈N,k∈K,(12)ai,pi,li,fijk≥0,∀i,j∈C;k∈K.Formula (2) denotes the minimization objective function; formula (3) denotes that every consumer is served only once by a vehicle; formula (4) ensures the continuity of the vehicle’s driving path; formulas (5) and (6) denote the capacity constraints and travel time constraints of the vehicle; formula (7) denotes the weight constraints on each segment of the driving path during the vehicle's driving process; formulas (8) and (9) indicate the actual delivery time limit; formula (10) indicates the delay delivery time limit of a consumer; formula (11) indicates the 0–1 variable constraint; formula (12) indicates the nonnegative limit of a variable.


## 3. Improved Fruit Fly Algorithm Based on Multiple Populations

VRP is a NP-hard problem. Researchers usually use heuristic or metaheuristic algorithms to solve [18–20]. This model involves multiple distribution centers and fuel consumption optimization, which make the solution more difficult [21]. Pan [22] proposed a fruit fly optimization (FFO) algorithm inspired by fruit fly feeding behavior. Because of its few parameters and fast convergence, it has become an important method to solve optimization problems [23, 24], which makes it possible to solve this model effectively.FFO simulated the process of fruit fly using sensitive olfactory and visual search for food, including three phases: population initialization, olfactory foraging, and visual foraging. Firstly, the algorithm parameters, the number of populations, and the initialization location of fruit fly are initialized; second, a new fruit fly individual is obtained by simulating its olfactory feeding behavior; then, the optimal fruit fly individual location is updated by simulating the behavior of fruit fly through visual feeding; finally, when the iteration process reaches certain criteria, the output algorithm solves the result. However, fruit fly population has the disadvantage of easily falling into local optimum [25], so this paper tries to improve it. Based on the basic FFA, an improved fruit fly optimization algorithm (IFFO) based on multiple populations is designed to solve this model.


### 3.1. Coding

Considering that MDVRP is a typical discrete optimization problem, this paper uses natural number encoding to represent the scheduling scheme and sets up a scheduling schemeX=x1T,x2T,…,xkTT, where k represents the number of vehicles, xk=0,r1,r2,…,rs,0 represents the route of the first vehicle, and 0 represents the subscript of the depot. In the specific encoding phase, MDVRP is first converted into multiple VRPs to solve in parallel, then each customer is assigned a distribution vehicle, and the driving route of the distribution vehicle is designed. Assuming that there are three depots, you can see that the number of distribution vehicles is not the same at each depot; that is, the number of distribution routes is also different. For example, there are two vehicles participating in the distribution, one of which provides distribution services for consumer 3, consumer 1, and consumer 7, and the distribution routes are Depot 1 ⟶ Consumer 3 ⟶Consumer 1 ⟶ Consumer 7 ⟶ Depot 1, or if there is only one vehicle at depot 2 participating in the distribution, the distribution routes are Depot 2 ⟶ Consumer 8 ⟶ Consumer 9 ⟶ Consumer 11 ⟶ Depot 2 (as shown in Figure 1).Figure 1
Coding diagram.


### 3.2. Multiple-Population Methods

The multipopulation method, which enables the algorithm to obtain more than one optimal solution in one run, has been widely used in NP-hard problem such as flow shop scheduling [26, 27]. In order to overcome the disadvantage of local optimum in the process of solving fruit fly algorithm, this paper divides the individuals in fruit fly population into several subpopulations by using the strategy of simultaneous evolution of multiple populations. At the same time, in order to effectively utilize the advantageous information of the dominant solution in each subpopulation and strengthen the communication and cooperation among subpopulations, interactive strategies between subpopulations are designed during the iteration process of fruit fly algorithm. Slightly, the search efficiency and accuracy of the optimal solution are enhanced by information interaction between the optimal individuals in the subpopulation. Figure 2 shows the strategy for information exchange between subpopulations. In subpopulation 1, a fruit fly individual is randomly selected, such as one in neutron population 1, as parent 1, and then probability, and selecting individuals in the same population, individuals in other subpopulations, and globally optimal individuals to perform crossover operations. This way of information interaction between subpopulations improves the ability to search for the optimal solution to the problem. At the same time, the excellent genes of the best individuals in the population are transferred to the current individuals with a certain probability to achieve rapid convergence.Figure 2
Information exchange between subpopulations.


### 3.3. Genetic Evolution Strategies in Fruit Fly Individuals

In the original fruit fly algorithm, individual updates are obtained by constant comparisons of old and new optimal values, which can easily lead to premature convergence. In the IFFO designed in this paper, a crossover operation in the genetic algorithm is introduced to obtain new fruit fly individuals. For this reason, in order to improve the search ability of the solution, a crossover strategy for fruit fly individuals was designed according to their coding style. As shown in Figure3, a gene was randomly selected from parent 1 and parent 2, the selected parent 1 gene was deleted from parent 2, and then the selected gene from parent 1 was inserted into parent 2, where the insertion position was the position where the function value of parent 2 was lowered the most, resulting in offspring 1. Similarly, progeny 2 can be obtained.Figure 3
Crossover operation.At the same time, in order to improve the diversity among fruit fly individuals, swap, insert, and invert mutators were used in IFFO. The three mutators are shown in Figure4. The swap mutation is to randomly select two different locations and then swap the consumers at two locations. The shift mutation is to randomly select the consumers at one location and insert them into another random location. According to the encoding method in this paper, the two locations selected by the swap mutation operation and the shift mutation operation can be both locations on the same subpath. It can also be two locations on different subpaths, which enables different paths to smoothly achieve “information exchange” and increase the search scope of solution space. Inverted mutation first randomly selects a subpath (that is, a distribution route), then randomly selects two different locations on the subpath, and flips the order of consumers between the two locations.Figure 4
Exchange, inversion, and random insertion operation.New fruit fly individuals generated by crossover and mutation are placed in the corresponding population, and better individuals with this subproblem are inherited to the next generation at the selection stage based on elite retention strategies.


### 3.4. Improved Fruit Fly Algorithm Steps

#### 3.4.1. Initialization

The initialization stage is mainly divided into two steps: the initialization of algorithm parameters and the initialization of the individual population.Step 1: the main parameters of the algorithm are as follows: the number of fruit fly subpopulations (N), the number of fruit fly individuals of subpopulations (popsize), the number of iterations of the algorithm (MaxIter), and the interaction criteria of subpopulations (Interaction).Step 2: in order to expand the search scope of the solution, this paper adopts the method of random initialization. Specifically, when distributing distribution vehicles to consumers, a distribution vehicle is randomly selected. If a distribution vehicle is selected, the consumer is assigned to the distribution vehicle, and the distribution vehicle is assigned to the distribution vehicle. When the capacity and driving path of the distribution vehicle exceed the maximum constraints, another vehicle is randomly selected again until all consumers get the distribution vehicle to perform the distribution task, and then the initialization phase of the individual population is completed.


#### 3.4.2. Olfactory Search and Visual Search Stage

In the olfactory search phase, for each subpopulation,popsize new fruit fly individuals are generated by the genetic evolution strategy described in Section 3.3. If the new fruit fly individual r generated by the genetic evolution strategy at the current position (Xcurrtr) of the subpopulation is set as X1r,X2r,…,Xpopszier, and the optimal individual in the new individuals is Xbestr, then the updating of fruit fly individuals is performed in the visual search stage. If the objective function value is fXbestr<fXcurrtr, the current position Xcurrtr is replaced by the optimal position Xbestr; that is Xcurrtr=Xbestr.


#### 3.4.3. The Stage of Interaction between Subpopulations

For the population-based intelligent optimization algorithm, the communication and cooperation among individuals in the population can expand the search space of the solution, accelerate the convergence speed, and improve the efficiency and accuracy of the algorithm. The multipopulation fruit fly algorithm designed in this paper has multiple subpopulations. Each subpopulation updates the solution of the population, respectively, which is a lack of communication between the populations. So, it is proposed to use the subpopulation communication mechanism shown in Figure2. In the iterative process of the fruit fly algorithm, after Interaction, the interaction between the populations is performed once. Selectively introducing the excellent genes of the external population or the optimal individual for the subpopulation can improve the searchability for the optimal solution of the problem.


## 3.1. Coding

Considering that MDVRP is a typical discrete optimization problem, this paper uses natural number encoding to represent the scheduling scheme and sets up a scheduling schemeX=x1T,x2T,…,xkTT, where k represents the number of vehicles, xk=0,r1,r2,…,rs,0 represents the route of the first vehicle, and 0 represents the subscript of the depot. In the specific encoding phase, MDVRP is first converted into multiple VRPs to solve in parallel, then each customer is assigned a distribution vehicle, and the driving route of the distribution vehicle is designed. Assuming that there are three depots, you can see that the number of distribution vehicles is not the same at each depot; that is, the number of distribution routes is also different. For example, there are two vehicles participating in the distribution, one of which provides distribution services for consumer 3, consumer 1, and consumer 7, and the distribution routes are Depot 1 ⟶ Consumer 3 ⟶Consumer 1 ⟶ Consumer 7 ⟶ Depot 1, or if there is only one vehicle at depot 2 participating in the distribution, the distribution routes are Depot 2 ⟶ Consumer 8 ⟶ Consumer 9 ⟶ Consumer 11 ⟶ Depot 2 (as shown in Figure 1).Figure 1
Coding diagram.


## 3.2. Multiple-Population Methods

The multipopulation method, which enables the algorithm to obtain more than one optimal solution in one run, has been widely used in NP-hard problem such as flow shop scheduling [26, 27]. In order to overcome the disadvantage of local optimum in the process of solving fruit fly algorithm, this paper divides the individuals in fruit fly population into several subpopulations by using the strategy of simultaneous evolution of multiple populations. At the same time, in order to effectively utilize the advantageous information of the dominant solution in each subpopulation and strengthen the communication and cooperation among subpopulations, interactive strategies between subpopulations are designed during the iteration process of fruit fly algorithm. Slightly, the search efficiency and accuracy of the optimal solution are enhanced by information interaction between the optimal individuals in the subpopulation. Figure 2 shows the strategy for information exchange between subpopulations. In subpopulation 1, a fruit fly individual is randomly selected, such as one in neutron population 1, as parent 1, and then probability, and selecting individuals in the same population, individuals in other subpopulations, and globally optimal individuals to perform crossover operations. This way of information interaction between subpopulations improves the ability to search for the optimal solution to the problem. At the same time, the excellent genes of the best individuals in the population are transferred to the current individuals with a certain probability to achieve rapid convergence.Figure 2
Information exchange between subpopulations.


## 3.3. Genetic Evolution Strategies in Fruit Fly Individuals

In the original fruit fly algorithm, individual updates are obtained by constant comparisons of old and new optimal values, which can easily lead to premature convergence. In the IFFO designed in this paper, a crossover operation in the genetic algorithm is introduced to obtain new fruit fly individuals. For this reason, in order to improve the search ability of the solution, a crossover strategy for fruit fly individuals was designed according to their coding style. As shown in Figure3, a gene was randomly selected from parent 1 and parent 2, the selected parent 1 gene was deleted from parent 2, and then the selected gene from parent 1 was inserted into parent 2, where the insertion position was the position where the function value of parent 2 was lowered the most, resulting in offspring 1. Similarly, progeny 2 can be obtained.Figure 3
Crossover operation.At the same time, in order to improve the diversity among fruit fly individuals, swap, insert, and invert mutators were used in IFFO. The three mutators are shown in Figure4. The swap mutation is to randomly select two different locations and then swap the consumers at two locations. The shift mutation is to randomly select the consumers at one location and insert them into another random location. According to the encoding method in this paper, the two locations selected by the swap mutation operation and the shift mutation operation can be both locations on the same subpath. It can also be two locations on different subpaths, which enables different paths to smoothly achieve “information exchange” and increase the search scope of solution space. Inverted mutation first randomly selects a subpath (that is, a distribution route), then randomly selects two different locations on the subpath, and flips the order of consumers between the two locations.Figure 4
Exchange, inversion, and random insertion operation.New fruit fly individuals generated by crossover and mutation are placed in the corresponding population, and better individuals with this subproblem are inherited to the next generation at the selection stage based on elite retention strategies.


## 3.4. Improved Fruit Fly Algorithm Steps

### 3.4.1. Initialization

The initialization stage is mainly divided into two steps: the initialization of algorithm parameters and the initialization of the individual population.Step 1: the main parameters of the algorithm are as follows: the number of fruit fly subpopulations (N), the number of fruit fly individuals of subpopulations (popsize), the number of iterations of the algorithm (MaxIter), and the interaction criteria of subpopulations (Interaction).Step 2: in order to expand the search scope of the solution, this paper adopts the method of random initialization. Specifically, when distributing distribution vehicles to consumers, a distribution vehicle is randomly selected. If a distribution vehicle is selected, the consumer is assigned to the distribution vehicle, and the distribution vehicle is assigned to the distribution vehicle. When the capacity and driving path of the distribution vehicle exceed the maximum constraints, another vehicle is randomly selected again until all consumers get the distribution vehicle to perform the distribution task, and then the initialization phase of the individual population is completed.


### 3.4.2. Olfactory Search and Visual Search Stage

In the olfactory search phase, for each subpopulation,popsize new fruit fly individuals are generated by the genetic evolution strategy described in Section 3.3. If the new fruit fly individual r generated by the genetic evolution strategy at the current position (Xcurrtr) of the subpopulation is set as X1r,X2r,…,Xpopszier, and the optimal individual in the new individuals is Xbestr, then the updating of fruit fly individuals is performed in the visual search stage. If the objective function value is fXbestr<fXcurrtr, the current position Xcurrtr is replaced by the optimal position Xbestr; that is Xcurrtr=Xbestr.


### 3.4.3. The Stage of Interaction between Subpopulations

For the population-based intelligent optimization algorithm, the communication and cooperation among individuals in the population can expand the search space of the solution, accelerate the convergence speed, and improve the efficiency and accuracy of the algorithm. The multipopulation fruit fly algorithm designed in this paper has multiple subpopulations. Each subpopulation updates the solution of the population, respectively, which is a lack of communication between the populations. So, it is proposed to use the subpopulation communication mechanism shown in Figure2. In the iterative process of the fruit fly algorithm, after Interaction, the interaction between the populations is performed once. Selectively introducing the excellent genes of the external population or the optimal individual for the subpopulation can improve the searchability for the optimal solution of the problem.


## 3.4.1. Initialization

The initialization stage is mainly divided into two steps: the initialization of algorithm parameters and the initialization of the individual population.Step 1: the main parameters of the algorithm are as follows: the number of fruit fly subpopulations (N), the number of fruit fly individuals of subpopulations (popsize), the number of iterations of the algorithm (MaxIter), and the interaction criteria of subpopulations (Interaction).Step 2: in order to expand the search scope of the solution, this paper adopts the method of random initialization. Specifically, when distributing distribution vehicles to consumers, a distribution vehicle is randomly selected. If a distribution vehicle is selected, the consumer is assigned to the distribution vehicle, and the distribution vehicle is assigned to the distribution vehicle. When the capacity and driving path of the distribution vehicle exceed the maximum constraints, another vehicle is randomly selected again until all consumers get the distribution vehicle to perform the distribution task, and then the initialization phase of the individual population is completed.


## 3.4.2. Olfactory Search and Visual Search Stage

In the olfactory search phase, for each subpopulation,popsize new fruit fly individuals are generated by the genetic evolution strategy described in Section 3.3. If the new fruit fly individual r generated by the genetic evolution strategy at the current position (Xcurrtr) of the subpopulation is set as X1r,X2r,…,Xpopszier, and the optimal individual in the new individuals is Xbestr, then the updating of fruit fly individuals is performed in the visual search stage. If the objective function value is fXbestr<fXcurrtr, the current position Xcurrtr is replaced by the optimal position Xbestr; that is Xcurrtr=Xbestr.


## 3.4.3. The Stage of Interaction between Subpopulations

For the population-based intelligent optimization algorithm, the communication and cooperation among individuals in the population can expand the search space of the solution, accelerate the convergence speed, and improve the efficiency and accuracy of the algorithm. The multipopulation fruit fly algorithm designed in this paper has multiple subpopulations. Each subpopulation updates the solution of the population, respectively, which is a lack of communication between the populations. So, it is proposed to use the subpopulation communication mechanism shown in Figure2. In the iterative process of the fruit fly algorithm, after Interaction, the interaction between the populations is performed once. Selectively introducing the excellent genes of the external population or the optimal individual for the subpopulation can improve the searchability for the optimal solution of the problem.


## 4. Case Study

In order to verify the effectiveness of the model and IFFO algorithm, this paper takes an e-commerce logistics company as an example for numerical simulation. The logistics company has four distribution centers, the maximum carrying capacity of each distribution vehicle is 200 kg, the maximum driving distance of each vehicle is 500 km, the rental cost of each distribution vehicle is 600 yuan/vehicle, the variable cost of unit mileage is 5 yuan/km, and the fuel cost is 7.5 yuan/L. Four depots need to provide logistics distribution services to 48 consumers. Euclidean distance is used to represent the distance between any points. Given the demand of each consumer, it is assumed that the logistics distribution vehicles start from the morning of that day to carry out the distribution task and promise to deliver the goods before that day, allowing a certain delay in distribution, but not more than the latest. The average speed of the vehicle is 60 km/h. It is required to reduce the cost of logistics distribution and customers’ delayed receiving time and design reasonable scheduling and logistics distribution routes. The coordinates of depot information (unit: km) are (4.163, 13.559), (21.387, 17.105), (–36.118, 49.097), and (–31.201, 0.235), and the consumer information is shown in Table1.Table 1
Customer information.
No.X-axis (km)Y-axis (km)Demand (kg)1−29.73064.136122−30.6645.4638351.6425.469164−13.1769.33655−67.41368.32312648.9076.274575.24322.260138−65.00277.234209−4.175−1.569131023.02911.639181125.4826.287712−42.615−26.392613−76.67299.341914−20.67357.892915−52.0396.567416−41.37650.8242517−91.94327.588518−65.11830.212171918.59796.716320−40.94283.2091621−37.756,−33.325252223.76729.0832123−43.03020.4531424−35.297−24.8961925−54.75514.3681426−49.32933.37462757.40423.8221628−22.75455.408929−56.62273.3402030−38.5623.7051331−16.77919.5371032−11.56011.6151633−46.54597.974193416.2299.32022351.2947.3491436−26.40429.52910374.35214.6851138−50.665−23.1261539−22.833−9.8141340−71.100−18.6161541−7.84932.07484211.877−24.9332243−18.927−23.7302444−11.92011.75534529.84011.633254612.268−55.8111947−37.933−21.613214842.883−2.96610


### 4.1. Performance Analysis of IFFO

Genetic algorithm (abbreviated form GA) has the advantage of fast convergence in solving NP-hard problems, so it has become an important method for solving vehicle routing problems [28–31]. In order to verify the effectiveness of IFFO, the paper compares the solution results of FFO, IFFO, and GA and draws the distribution route map of the three algorithms. Among them, the population number of GA and FFO is set to 60, and the number of IFFO subpopulations is set to 5. Each population has 12 individuals, the crossover rate and mutation rate of GA are set to 0.9 and 0.1, respectively, IFFA carries out information interaction among subpopulations every 10 iterations, and the total number of iterations of the three algorithms is 500. The algorithm programs are written in C++ programming language and run on Intel (R) Core (TM) i5−8250@1.6 GHz on a Dell laptop with 8.0 GB CPU and 8.0 GB memory. Each of the three algorithms runs 20 times independently, and the optimal calculation results are shown in Figures 5–7.Figure 5
Routes from FFO.Figure 6
Routes from GA.Figure 7
Routes from IFFO.From the analysis of Figures5 to 7, we can see that both GA and FFO get 8 distribution routes after the operation, while in this paper the multipopulation fruit fly algorithm IFFA designed gets 7 distribution routes after the operation, because it reduces the use of a distribution vehicle; that is, it reduces the fixed cost, which further shows that the reasonable design of logistics distribution routes can reduce the distribution cost.As can be seen from Figure8, compared with GA, the basic logistics cost, fuel cost, and overtime compensation cost are reduced by 25.5%, 32.8%, and 23.3%, respectively. Compared with the basic fruit fly algorithm FFO, the basic logistics cost and fuel cost calculated by IFFO are reduced by 8.4% and 5.1%, respectively, and the overtime compensation penalty is increased by 11.6%. This is mainly because IFFO has obtained 7 distribution routes. Because of the lack of a distribution vehicle, the distribution task of each vehicle is increased, the waiting time of customers is increased, and the amount of delay penalty is increased. By analyzing Figure 9, it can be found that in the iterative process of the algorithm, the gap between the solution results of GA and FFO and that of IFFO is increasing, which indicates that the multipopulation mechanism proposed in this paper can expand the search range of the solution and improve the optimization speed and accuracy of the solution.Figure 8
Cost comparison among 3 algorithms.Figure 9
Convergence analysis among 3 algorithms.


### 4.2. Consider the Importance of Carbon Emissions

Figure10 shows that the cost of logistics distribution in an open-loop distribution scenario is reduced by 19.70% compared with the total cost of closed-loop distribution. That is, after the distribution task is completed, the distribution vehicle does not have to return to the original distribution center but can be assigned nearby. This is mainly because when the open-loop distribution is completed, the vehicle does not have to return to the distribution center, thus avoiding empty driving of the vehicle, thus reducing the fuel consumption cost. Thus, the total distribution cost has been reduced, which indicates that in the actual logistics distribution process, the empty vehicles should be minimized, the full load rate of vehicles should be increased, and the logistics distribution costs such as fuel consumption costs should be reduced through reasonable optimization of distribution routes.Figure 10
Cost comparison between open and close loop.


## 4.1. Performance Analysis of IFFO

Genetic algorithm (abbreviated form GA) has the advantage of fast convergence in solving NP-hard problems, so it has become an important method for solving vehicle routing problems [28–31]. In order to verify the effectiveness of IFFO, the paper compares the solution results of FFO, IFFO, and GA and draws the distribution route map of the three algorithms. Among them, the population number of GA and FFO is set to 60, and the number of IFFO subpopulations is set to 5. Each population has 12 individuals, the crossover rate and mutation rate of GA are set to 0.9 and 0.1, respectively, IFFA carries out information interaction among subpopulations every 10 iterations, and the total number of iterations of the three algorithms is 500. The algorithm programs are written in C++ programming language and run on Intel (R) Core (TM) i5−8250@1.6 GHz on a Dell laptop with 8.0 GB CPU and 8.0 GB memory. Each of the three algorithms runs 20 times independently, and the optimal calculation results are shown in Figures 5–7.Figure 5
Routes from FFO.Figure 6
Routes from GA.Figure 7
Routes from IFFO.From the analysis of Figures5 to 7, we can see that both GA and FFO get 8 distribution routes after the operation, while in this paper the multipopulation fruit fly algorithm IFFA designed gets 7 distribution routes after the operation, because it reduces the use of a distribution vehicle; that is, it reduces the fixed cost, which further shows that the reasonable design of logistics distribution routes can reduce the distribution cost.As can be seen from Figure8, compared with GA, the basic logistics cost, fuel cost, and overtime compensation cost are reduced by 25.5%, 32.8%, and 23.3%, respectively. Compared with the basic fruit fly algorithm FFO, the basic logistics cost and fuel cost calculated by IFFO are reduced by 8.4% and 5.1%, respectively, and the overtime compensation penalty is increased by 11.6%. This is mainly because IFFO has obtained 7 distribution routes. Because of the lack of a distribution vehicle, the distribution task of each vehicle is increased, the waiting time of customers is increased, and the amount of delay penalty is increased. By analyzing Figure 9, it can be found that in the iterative process of the algorithm, the gap between the solution results of GA and FFO and that of IFFO is increasing, which indicates that the multipopulation mechanism proposed in this paper can expand the search range of the solution and improve the optimization speed and accuracy of the solution.Figure 8
Cost comparison among 3 algorithms.Figure 9
Convergence analysis among 3 algorithms.


## 4.2. Consider the Importance of Carbon Emissions

Figure10 shows that the cost of logistics distribution in an open-loop distribution scenario is reduced by 19.70% compared with the total cost of closed-loop distribution. That is, after the distribution task is completed, the distribution vehicle does not have to return to the original distribution center but can be assigned nearby. This is mainly because when the open-loop distribution is completed, the vehicle does not have to return to the distribution center, thus avoiding empty driving of the vehicle, thus reducing the fuel consumption cost. Thus, the total distribution cost has been reduced, which indicates that in the actual logistics distribution process, the empty vehicles should be minimized, the full load rate of vehicles should be increased, and the logistics distribution costs such as fuel consumption costs should be reduced through reasonable optimization of distribution routes.Figure 10
Cost comparison between open and close loop.


## 5. Conclusion

In this paper, the driving distance and load of distribution vehicles are considered as the key factors affecting fuel consumption, a fuel consumption model is established, and a terminal distribution route planning model with multiple depots is constructed under the time limit of receipt by consumers, and the coding method of the problem is designed. Considering that the traditional fruit fly algorithm is easy to fall into local optimum, multiple fruit fly algorithms are designed. The multipopulation evolution mechanism of simultaneous population evolution and the interaction mechanism between individual subpopulations are designed. The model is solved by genetic algorithm, fruit fly algorithm, and improved fruit fly algorithm. The effectiveness of the improved multipopulation fruit fly algorithm is verified, the cost of logistics distribution is reduced, and the vehicle routing rules of multiple depots with delivery time constraints for customers are solved. NP-hard problems such as delimitation problems provide a way to solve them.Admittedly, this paper also has some drawbacks, such as whether the customer’s order can be dynamically changed, whether the customer’s time window can be changed, and so on. This will be the work to be studied hereinafter.



---

*Source: 9994014-2021-06-09.xml*