# Application of Data Mining Algorithm in Agricultural Products Logistics Network Planning

Authors: Dong-Yun Yu; Gui-Ling Wu
Journal: Security and Communication Networks
 (2022)

---

## Abstract

The location of agricultural products center is related to the overall operation efficiency of logistics system and has a great impact on the follow-up agricultural products distribution route planning. The distribution route planning directly determines the total transportation cost and customer service quality of the whole logistics system. In this study, the problem of location path under the background of agricultural products logistics is studied, and an algorithm of agricultural products logistics network planning based on space-time constraints is proposed. An algorithm based on K-means is used to cluster the time-space double factors of customers. Minimize the total distribution cost under the constraints of meeting customer needs and minimizing time window deviation. Experimental results show that the proposed algorithm has better performance through Taguchi analysis and master-slave two-layer model analysis, and its algorithm has better convergence and sensitivity and can better reduce the total cost of distribution and the length of transportation path.


---

## Body

## 1. Introduction

With the promotion of the rural revitalization strategy, the issues concerning agriculture, rural areas, and farmers have become fundamental issues concerning the national economy and people’s livelihood [1]. China is a big agricultural country, and agriculture is the basic industry of the national economy. With the continuous improvement of residents’ living standards, people’s demand for fresh agricultural products is also increasing [2]. Agricultural products logistics distribution is an important link in the supply chain of fresh agricultural products, which determines the quality of the final fresh food. At present, China’s fresh agricultural products logistics are still in the stage of development, and the annual transport process of rotting fruit and vegetables is worth up to 70 billion yuan, resulting in a huge economic loss [3]. Therefore, it is of great practical significance to accelerate the development of fresh agricultural products logistics distribution and optimize the location and path of agricultural products logistics [4].The contributions of this study are listed as follows: (1) a k-means based clustering algorithm for customer spatial-temporal is designed. (2) Under the constraints of meeting customer requirements and minimizing time window deviation, the total cost is minimized.


## 2. Related Works

In order to cope with the rapidly growing demand for agricultural products, site selection and route planning of logistics outlets have become key links in supply chain management and logistics system construction [5]. It plays an important role in reducing the operation cost and improving the distribution efficiency and customer satisfaction. Logistics site selection is a medium and long-term strategy, as the hub of logistics activities directly affects the whole system planning [6]. It is interdependent with customer location and distribution route arrangement. If route planning is ignored in site selection, the cost of logistics distribution system will be increased. The specific route of vehicle distribution is a short-term operational decision, but the short-term decision will ultimately affect customer satisfaction and the total operating cost [7]. The actual distribution process is in a very complicated environment. In the process of distribution, it is easy to encounter all kinds of interference events, such as refrigeration unit cannot work as usual due to vehicle breakdown and traffic accidents caused by vehicles can not arrive on time. This will affect the execution of the initial distribution plan or even cause distribution disruption. At this time, it will not only affect the operation cost and increase the burden of enterprises but also aggravate the food decay and then affect the consumption safety of residents [8].In recent years, scientific site selection and rational distribution path planning of agricultural products have attracted extensive attention of scholars at home and abroad. Literature [9] studied the VRP (vehicle routing problem) model of fruit and vegetable distribution with a time window and solved it by the tabu search algorithm. Literature [10] proposed the threshold acceptance algorithm for multi-model VRP of fresh milk and meat distribution. Literature [11] proposed a hybrid ant colony algorithm combined with a local search operator to solve this problem. Literature [12] studies the integration problem of perishable food production and distribution with the time window under a time-varying road network and designs a hybrid genetic algorithm to solve it. Literature [13] builds a multivehicle and multiobjective LRP (logistic resource planning) model with the time window for this problem and proposes a hybrid solution algorithm of multiobjective particle swarm optimization and multiobjective neighbourhood search. Literature [14] proposed the LRP model, considering the influencing factors of fresh food quality attenuation.


## 3. Problem Description and Modelling

The location, vehicle information, volume, distribution of customer points, demand, time window, and other information of several candidate distribution centers are known. On the premise of satisfying the volume restriction and vehicle load limitation of distribution center, the site selection is made from the candidate distribution center and service customers are determined. Vehicles depart from selected distribution centers and each customer is served only once, minimizing the total cost while meeting customer needs and time window constraints.This study establishes an optimization model to minimize total cost and maximize customer satisfaction:(1)minz=BC+TC+PC.(2)max1t∑x∈Cμxnx.(3)BC=1ϖ∑b∈BXbKb,TC=ρ∑x∈c∑y∈c∑z∈ZWzdxyixyz+ρ∑x∈c∑y∈c∑z∈ZFzixyz,PC=ρ∑x∈c∑z∈Zα1DxmaxETx−nxz,0+ρ∑x∈c∑z∈Zα1Dxmaxnxz−LTx,0.TC consists of transportation costs and vehicle start-up costs. PC is the penalty cost of the delivery vehicle’s advance or delay in meeting the customer’s time window requirements.Constraints are as follows:(4)∑x∈CDxjxz⩽Vz,∀z∈Z.(5)∑x∈C∑y∈Cixyz=sz−1,∀z∈Z.(6)∑x∈CBixyz−∑x∈CBixyz=0,∀z∈Z,∀y∈C.(7)∑x∈C∑y∈Cixyz=∑y∈C∑x∈Cixyz=1,∀z∈Z.(8)∑x∈CBDxKb⩽O,∀b∈B.(9)μxnx=0,nx⩽Ex,nx−ExETx−Ex,Ex<nx⩽ETx,1,ETx<nx⩽LTx,Lx−nxLx−LTx,LTx<nx⩽Lx,0,Lx<nx..Equation (1) represents the goal of minimizing the total cost, which consists of the distribution center depreciation cost, distribution cost, vehicle start-up cost, and the penalty cost for violating the time window. Equation (2) represents the goal of maximizing average customer satisfaction. Equation (4) represents the vehicle load constraint. Equation (5) indicates that each customer is served only by one vehicle. Equation (6) represents the elimination of subloops. Equation (7) indicates that the vehicle must leave after serving the customer. Equation (8) represents the volume constraint of distribution center. Equation (9) represents customer satisfaction membership function.The above equations and coincidence are described below.C represents the customer set xx=1,2,…,t for delivery. B indicates distribution center set bb=1,2,…,w.CB indicates the collection of distribution centers and customer points, that is, CB=C∪B. ϖ indicates the service life of the alternative distribution center. ρ represents the number of customer services per year. O indicates the volume of the distribution center. Z represents vehicle set z|z=1,2,…,z.Xb represents the fixed construction cost of the distribution center b. Fz represents the start-up cost of vehicle z. Wz is the unit transportation cost of vehicle z. dxy represents the distance between client x and client y. Vz represents the load constraint of vehicle z. Dx is the quantity demanded by customer x. nxyz indicates the travel time of the vehicle from customer x to customer y. nxz represents the time when vehicle z arrives at customer point i. Sz represents the collection of customer points served by vehicle z.Sz represents the number of customer points served by vehicle z.ETx indicates the earliest service start time expected by the customer. LTx indicates the customer’s expected start time of service. α1 represents the penalty coefficient per unit time for the vehicle to service customer x before LTx. α2 represents the penalty coefficient per unit time of the vehicle’s service to customer x after LTx. Ex represents the earliest service start time that customer x can tolerate. Lx indicates the latest service start time that customer x can tolerate. δ is the confidence level of satisfying demands, that is, if the probability level of satisfying all demands reaches δ.


## 4. The Proposed Algorithm

In this study, the multidistribution network location and distribution path planning are studied. In order to reduce the difficulty of solving the problem, k-means clustering algorithm considering customer time and space is adopted. The multicenter path problem is transformed into a single center path problem. First, the k-means clustering algorithm is used to select the location of logistics outlets. The time-space two-factor algorithm designed in this study considering customers is used to determine the service customers of the distribution center. Finally, particle swarm optimization is used to optimize the path. The specific algorithm steps and flow are shown in Figure1.Figure 1
The specific algorithm steps and flow.


### 4.1. Algorithm Process Description

Step 1.
Form an initial allocation. Use k-means clustering algorithm to determine the location of distribution center. Each customer point is divided to the nearest distribution center in turn to form the initial cluster.Step 2.
Calculate the time-space connectivity between clients. Suppose the time window of customer pointx is ETx,LTy, the time window of customer point y is ETx,LTy. The service duration at customer point x is fx. If the travel time from customer point x to customer point y is nxy, the time-space linkage index χxy between customers is as follows:(10)χxy=1,ETx+fx+nxy⩽LTy;0,otherwise;..
Ifχxy=1 is displayed, customer x connects with customer y.Step 3.
Calculate and compare the time-space distance (space-time distance) indexγxb of customer a and any distribution center b:(11)γab=∑n,y∈CχxyTbDab,b∈B,where Tb is the number of customers in distribution center b. Dab is the distance between customer a and distribution center b. Compared with γab, the customer is served by the largest distribution center in γab.Step 4.
Check the capacity constraints of the distribution center and adjust the customer list for service in the distribution center:(12)Jb=1,∑x∈CBDxKbO≤1,b∈B,0,otherwise..
IfJb  = 0, the sum of customer demands in the distribution center exceeds the upper limit of the distribution center capacity. Calculate the ratio of the spatiotemporal distance index of customer x to the sub-small spatiotemporal distance index γxb' of the distribution center:(13)φx=γxbγxb′.
It is assumed that the upper limit of the volume of the three distribution centers is 80, as shown in the Figure2. At present, the total customer demands of the three distribution centers are 77, 75, and 86, respectively, and distribution center 3 exceeds the upper volume limit. According to step 4.4 rules of the design algorithm in this study, the customer 10 with the minimum spatiotemporal distance index and the demand greater than or equal to 6 in distribution center 3 is divided into the secondary distribution center 1. Then, the customer 3 in distribution center 1 whose demand is greater than or equal to 3 and whose spatiotemporal distance index is the smallest is divided into distribution center 2. The customer list after adjustment is shown in Figure 2. All distribution centers meet the upper volume limit.Figure 2
The adjusted customer list. (a) Before customer list adjustment. (b) After customer list adjustment.


### 4.2. Particle Swarm Optimization Fusion Algorithm

#### 4.2.1. Standard Particle Swarm Optimization Algorithm

Particle swarm optimization is a swarm intelligence algorithm with a simple principle and fast search speed. The optimization idea of solving the optimal value is to simulate the foraging process of birds. Assuming that the initial values of velocity and position are randomly assigned in the solution space,W particles with space dimension D are searched. The idea of particle swarm optimization algorithm is to modify the position and velocity of particles through individual extreme pbest and global extreme gbest. It makes the particles move closer to the optimal solution. If the number of iterations is z, the update of particle velocity Q and position I is as follows:(14)Qz+1=mQz+c1r1Uxdz−Iz+c2r2Uadz−Iz,(15)Iz+1=IZ+QZ+1,where m is the inertia weight. r1 and r2 are random numbers distributed in the interval [0, 1]. Uxdz is the individual extreme value. Uadz is the global extreme value. c1 and c2 are usually taken as 2. When the population optimal solution reaches the preset range or Z is equal to the maximum number of iterations, the search is terminated.


#### 4.2.2. Chaotic Particle Swarm Optimization Algorithm

Modern nonlinear theory interprets chaos as an aperiodic and irregular motion in a certain system. The logistic equation under the wormhole model is a typical chaotic system, which can be simplified as follows:(16)it+1=pit1−it.Whenp takes 4 and it is a random number between 0 and 1, the output of the equation can traverse between 0 and 1 without repetition and quasi random. Therefore, by combining chaotic search with PSO algorithm, we can solve the problem that PSO algorithm is easy to fall into local optimization due to the strong randomness of particle initialization and evolution. Among them, the optimization of PSO using chaos can be divided into the following two points: one is to optimize the initial position and initial velocity using a chaotic sequence to improve the ergodicity and diversity of the population. Second, the optimal solution of the current population is searched by chaos, and the optimal result is used to replace the position of any particle in the current population. It can not only improve the convergence speed but also avoid the defect that it is easy to fall into local optimization.


#### 4.2.3. Particle Swarm Optimization Algorithm

The chicken swarm algorithm (CSO) is a new bionic optimization algorithm, which mainly simulates the hierarchy and foraging behavior of chickens. The idea of CSO is to group chickens according to their types. Each Rooster can lead several hens and chicks into a group, and the hens in the group will forage under the guidance of the rooster. The chicks in the group can only forage around the corresponding hens, and information exchange is allowed between different groups. Roosters, hens, and chicks are classified from good to bad according to their fitness. In each round of search, the roosters, hens, and chicks in the group will be reselected.The method of particle swarm optimization using the multi swarm nature of CSO is as follows:(1)
In the first round of search, the fitness values of the population are sorted from small to large, and then all particles in the population are divided into three categories: G particle (rooster), H particle (hen), and C particle (chick). Groups are grouped according to rules, and the other rounds update the member types in the group by comparing the fitness values in the group, without changing the order of group numbers.(2)
When updating the speed and position of particles in each round, class G particles are excellent individuals in the group, and the updating formula is the same as formulas (14) and (15).Class H particles search under the guidance of class G particles and absorb the experience of other groups. The iterative formula of its speed and position can be changed to(17)QHz+1=mQHz+c1r1Uxdz−IHz+c2r2Uadz−IHz+c3r3Ifz−IHz,IHz+1=IHz+QHz+1.Among them,Uadz changes from the global optimization of equation (1) to the intragroup optimization, r3 is a random number of 0–1, Ifz is the optimal position of other groups, and c3 is usually taken as 2. Class C particles can only be searched near class H particles, and their position iteration formula is as follows:(18)ICz+1=ICz+FFL×IHaz−ICz,where IHaz is the position of H particle corresponding to C particle and FL is usually taken as 0.5.


## 4.1. Algorithm Process Description

Step 1.
Form an initial allocation. Use k-means clustering algorithm to determine the location of distribution center. Each customer point is divided to the nearest distribution center in turn to form the initial cluster.Step 2.
Calculate the time-space connectivity between clients. Suppose the time window of customer pointx is ETx,LTy, the time window of customer point y is ETx,LTy. The service duration at customer point x is fx. If the travel time from customer point x to customer point y is nxy, the time-space linkage index χxy between customers is as follows:(10)χxy=1,ETx+fx+nxy⩽LTy;0,otherwise;..
Ifχxy=1 is displayed, customer x connects with customer y.Step 3.
Calculate and compare the time-space distance (space-time distance) indexγxb of customer a and any distribution center b:(11)γab=∑n,y∈CχxyTbDab,b∈B,where Tb is the number of customers in distribution center b. Dab is the distance between customer a and distribution center b. Compared with γab, the customer is served by the largest distribution center in γab.Step 4.
Check the capacity constraints of the distribution center and adjust the customer list for service in the distribution center:(12)Jb=1,∑x∈CBDxKbO≤1,b∈B,0,otherwise..
IfJb  = 0, the sum of customer demands in the distribution center exceeds the upper limit of the distribution center capacity. Calculate the ratio of the spatiotemporal distance index of customer x to the sub-small spatiotemporal distance index γxb' of the distribution center:(13)φx=γxbγxb′.
It is assumed that the upper limit of the volume of the three distribution centers is 80, as shown in the Figure2. At present, the total customer demands of the three distribution centers are 77, 75, and 86, respectively, and distribution center 3 exceeds the upper volume limit. According to step 4.4 rules of the design algorithm in this study, the customer 10 with the minimum spatiotemporal distance index and the demand greater than or equal to 6 in distribution center 3 is divided into the secondary distribution center 1. Then, the customer 3 in distribution center 1 whose demand is greater than or equal to 3 and whose spatiotemporal distance index is the smallest is divided into distribution center 2. The customer list after adjustment is shown in Figure 2. All distribution centers meet the upper volume limit.Figure 2
The adjusted customer list. (a) Before customer list adjustment. (b) After customer list adjustment.


## 4.2. Particle Swarm Optimization Fusion Algorithm

### 4.2.1. Standard Particle Swarm Optimization Algorithm

Particle swarm optimization is a swarm intelligence algorithm with a simple principle and fast search speed. The optimization idea of solving the optimal value is to simulate the foraging process of birds. Assuming that the initial values of velocity and position are randomly assigned in the solution space,W particles with space dimension D are searched. The idea of particle swarm optimization algorithm is to modify the position and velocity of particles through individual extreme pbest and global extreme gbest. It makes the particles move closer to the optimal solution. If the number of iterations is z, the update of particle velocity Q and position I is as follows:(14)Qz+1=mQz+c1r1Uxdz−Iz+c2r2Uadz−Iz,(15)Iz+1=IZ+QZ+1,where m is the inertia weight. r1 and r2 are random numbers distributed in the interval [0, 1]. Uxdz is the individual extreme value. Uadz is the global extreme value. c1 and c2 are usually taken as 2. When the population optimal solution reaches the preset range or Z is equal to the maximum number of iterations, the search is terminated.


### 4.2.2. Chaotic Particle Swarm Optimization Algorithm

Modern nonlinear theory interprets chaos as an aperiodic and irregular motion in a certain system. The logistic equation under the wormhole model is a typical chaotic system, which can be simplified as follows:(16)it+1=pit1−it.Whenp takes 4 and it is a random number between 0 and 1, the output of the equation can traverse between 0 and 1 without repetition and quasi random. Therefore, by combining chaotic search with PSO algorithm, we can solve the problem that PSO algorithm is easy to fall into local optimization due to the strong randomness of particle initialization and evolution. Among them, the optimization of PSO using chaos can be divided into the following two points: one is to optimize the initial position and initial velocity using a chaotic sequence to improve the ergodicity and diversity of the population. Second, the optimal solution of the current population is searched by chaos, and the optimal result is used to replace the position of any particle in the current population. It can not only improve the convergence speed but also avoid the defect that it is easy to fall into local optimization.


### 4.2.3. Particle Swarm Optimization Algorithm

The chicken swarm algorithm (CSO) is a new bionic optimization algorithm, which mainly simulates the hierarchy and foraging behavior of chickens. The idea of CSO is to group chickens according to their types. Each Rooster can lead several hens and chicks into a group, and the hens in the group will forage under the guidance of the rooster. The chicks in the group can only forage around the corresponding hens, and information exchange is allowed between different groups. Roosters, hens, and chicks are classified from good to bad according to their fitness. In each round of search, the roosters, hens, and chicks in the group will be reselected.The method of particle swarm optimization using the multi swarm nature of CSO is as follows:(1)
In the first round of search, the fitness values of the population are sorted from small to large, and then all particles in the population are divided into three categories: G particle (rooster), H particle (hen), and C particle (chick). Groups are grouped according to rules, and the other rounds update the member types in the group by comparing the fitness values in the group, without changing the order of group numbers.(2)
When updating the speed and position of particles in each round, class G particles are excellent individuals in the group, and the updating formula is the same as formulas (14) and (15).Class H particles search under the guidance of class G particles and absorb the experience of other groups. The iterative formula of its speed and position can be changed to(17)QHz+1=mQHz+c1r1Uxdz−IHz+c2r2Uadz−IHz+c3r3Ifz−IHz,IHz+1=IHz+QHz+1.Among them,Uadz changes from the global optimization of equation (1) to the intragroup optimization, r3 is a random number of 0–1, Ifz is the optimal position of other groups, and c3 is usually taken as 2. Class C particles can only be searched near class H particles, and their position iteration formula is as follows:(18)ICz+1=ICz+FFL×IHaz−ICz,where IHaz is the position of H particle corresponding to C particle and FL is usually taken as 0.5.


## 4.2.1. Standard Particle Swarm Optimization Algorithm

Particle swarm optimization is a swarm intelligence algorithm with a simple principle and fast search speed. The optimization idea of solving the optimal value is to simulate the foraging process of birds. Assuming that the initial values of velocity and position are randomly assigned in the solution space,W particles with space dimension D are searched. The idea of particle swarm optimization algorithm is to modify the position and velocity of particles through individual extreme pbest and global extreme gbest. It makes the particles move closer to the optimal solution. If the number of iterations is z, the update of particle velocity Q and position I is as follows:(14)Qz+1=mQz+c1r1Uxdz−Iz+c2r2Uadz−Iz,(15)Iz+1=IZ+QZ+1,where m is the inertia weight. r1 and r2 are random numbers distributed in the interval [0, 1]. Uxdz is the individual extreme value. Uadz is the global extreme value. c1 and c2 are usually taken as 2. When the population optimal solution reaches the preset range or Z is equal to the maximum number of iterations, the search is terminated.


## 4.2.2. Chaotic Particle Swarm Optimization Algorithm

Modern nonlinear theory interprets chaos as an aperiodic and irregular motion in a certain system. The logistic equation under the wormhole model is a typical chaotic system, which can be simplified as follows:(16)it+1=pit1−it.Whenp takes 4 and it is a random number between 0 and 1, the output of the equation can traverse between 0 and 1 without repetition and quasi random. Therefore, by combining chaotic search with PSO algorithm, we can solve the problem that PSO algorithm is easy to fall into local optimization due to the strong randomness of particle initialization and evolution. Among them, the optimization of PSO using chaos can be divided into the following two points: one is to optimize the initial position and initial velocity using a chaotic sequence to improve the ergodicity and diversity of the population. Second, the optimal solution of the current population is searched by chaos, and the optimal result is used to replace the position of any particle in the current population. It can not only improve the convergence speed but also avoid the defect that it is easy to fall into local optimization.


## 4.2.3. Particle Swarm Optimization Algorithm

The chicken swarm algorithm (CSO) is a new bionic optimization algorithm, which mainly simulates the hierarchy and foraging behavior of chickens. The idea of CSO is to group chickens according to their types. Each Rooster can lead several hens and chicks into a group, and the hens in the group will forage under the guidance of the rooster. The chicks in the group can only forage around the corresponding hens, and information exchange is allowed between different groups. Roosters, hens, and chicks are classified from good to bad according to their fitness. In each round of search, the roosters, hens, and chicks in the group will be reselected.The method of particle swarm optimization using the multi swarm nature of CSO is as follows:(1)
In the first round of search, the fitness values of the population are sorted from small to large, and then all particles in the population are divided into three categories: G particle (rooster), H particle (hen), and C particle (chick). Groups are grouped according to rules, and the other rounds update the member types in the group by comparing the fitness values in the group, without changing the order of group numbers.(2)
When updating the speed and position of particles in each round, class G particles are excellent individuals in the group, and the updating formula is the same as formulas (14) and (15).Class H particles search under the guidance of class G particles and absorb the experience of other groups. The iterative formula of its speed and position can be changed to(17)QHz+1=mQHz+c1r1Uxdz−IHz+c2r2Uadz−IHz+c3r3Ifz−IHz,IHz+1=IHz+QHz+1.Among them,Uadz changes from the global optimization of equation (1) to the intragroup optimization, r3 is a random number of 0–1, Ifz is the optimal position of other groups, and c3 is usually taken as 2. Class C particles can only be searched near class H particles, and their position iteration formula is as follows:(18)ICz+1=ICz+FFL×IHaz−ICz,where IHaz is the position of H particle corresponding to C particle and FL is usually taken as 0.5.


## 5. Experimental Results and Analysis

Taking the actual problem of location and route of fresh electricity supplier in a city as a case study. The number of customers and their locations of the e-commerce service are relatively stable. The current distribution center capacity is limited and cannot meet the growing customer demand. In order to reduce distribution costs and improve customer satisfaction, the e-commerce company plans to open new distribution outlets and hire professional distribution teams to make distribution plans. The alternative distribution center of the e-commerce has been basically determined. The number and location of customers served by the company are relatively stable, keeping at about 60 customer points for a long time. The location, construction cost, and processing capacity of alternative distribution centers are listed in Table1. A one-day order, a total of 60 customers (numbered 1, 2, ..., 60), and rent 8 operation vehicles with the same specifications from the distribution company are selected. The maximum load of the vehicle is 100 kg, and the speed of the vehicle is 60 km/h. The fixed cost of the vehicle is 150 yuan/vehicle, the transportation cost per unit distance is 0.57 yuan/km, and the value loss coefficient of the unit product per unit time is 0.5 yuan/hour. The service time of the vehicle at the customer point is related to the order quantity of the customer, and the service time of the goods per unit weight is 0.02 hours. The opportunity cost loss coefficient due to arriving earlier than the customer’s expected time window is 10 yuan/hour. The penalty cost factor for arriving late in the customer’s expected time window is 20 yuan/hour. All algorithms were run using python3.8.2 on an ASUS W518 computer with an Inter(R) Core(TM) CPU i7-6700 K@4 GHz, 8 GB RAN 64 bit, Windows 10 operating system.Table 1
Information table of alternative distribution centers.
NumberLongitudeLatitudeYuan/dayStorage capacity (kg)1238.2833650.28635836705302238.2198350.17989760868703238.3628450.22004939666404238.2920550.164098632011105238.2878850.19053940945706238.2985250.14818460518707238.2434750.19580336715408238.4158450.189083662012609238.3702850.165667438067010238.3866650.2223446210101011238.3642450.239137379065012238.202950.202132330066013238.2734850.223855428558014238.2948950.255086405055015238.2735550.2567083870560The location, demand, and time window information of customers are listed in Table2. The customer time window is a fuzzy variable represented by a trapezoidal fuzzy number. Due to the limited layout, Table 3 only lists the information related to the top 20 customers.Table 2
Customer information table.
NumberLongitudeLatitudeDemand (kg)Time windowExETxLTxLx1238.25428850.25495390046.52238.22525450.242306110146.53238.26794250.20603801484238.25414450.24465610004.565238.28116550.217452100145.56238.27570350.2107341001457238.24738950.2137571100368238.21203150.2213711200579238.31968450.22417110046.510238.33405750.2303281200.556.511238.30056850.2339241I00.55.56.512238.34656150.19830312015.5613238.29568150.25159590066.514238.31551650.26211512014.5615238.24724550.25808612014.755.516238.32600850.248126100155.517238.31616350.23105610015.56.518238.30444950.216501800.54619238.33786650.2076549016720238.3091250.1921988014.56Table 3
The experimental design analysis.
No.POPCPMPRun1Run2Run3Run4Run5SNRMean1300.750.19597.569590.289465.219533.29669.39−78.59571.1282300.80.159556.59558.0719535.1413524.69478.69−81.150112330.63300.850.219520.599498.599469.8219438.219542.4984.078913493.944400.750.159580.79547.5919555.639527.9413616.2−81.173512365.615400.80.29557.889628.059652.2715679.089592.9781.816610822.056400.850.19848.55930.9515930.629560.212706.48−79.964710795.357500.750.25369.279619.345879.39767.549527.24−77.228032.5388500.80.115575539551.91189115513516.465777.61−81.5453695510.89500.850.156000.85833.969608.319525.39589.91−78.58111.656


### 5.1. Taguchi Analysis

Algorithm parameters have a great influence on algorithm performance, and good parameter settings can greatly improve algorithm performance. Therefore, it is very important to determine reasonable parameter values. Taguchi design is an excellent parameter design method, originating from the field of quality management, which aims to determine the optimal level combination of parameters with the minimum number of tests [15]. The algorithm has been widely used for its superior reliability, reproducibility, and simple analysis. Taguchi method mainly measures parameters by the signal-to-noise ratio (S/N). The larger the signal-to-noise ratio is, the more reasonable the corresponding parameter settings are. In addition, Taguchi’s target values were divided into three groups: “smaller is better”, “bigger is better,” and “nominally best”. Since the objective function of this study is to minimize the total cost, the type of “the smaller the better” is selected, and the corresponding SNR calculation equation is as follows:(19)SN=−10∗log10∑n=1tFn2t,where n is the times of algorithm execution at each parameter level. Fn is the response value, that is, the objective function value of experiment n.Parameter settings of PSO algorithm mainly include iteration times, population size, learning factor, inertia weight, crossover probability, and mutation probability. The nonlinear dynamic inertia weight coefficients,mmax  = 0.9 and mmin  = 0.4, are used in this study. According to previous experience, the learning factor (C) was set as 2, and the number of generation (Gen) was set as 500. Population size (POP), crossover probability (CP), and mutation probability (MP) were optimized by Taguchi analysis to determine the optimal values. Considering the optimization of orthogonal experimental design, three levels were taken for each parameter: the population size was 30, 40, and 50, respectively. The crossover rates were 0.75, 0.80, and 0.85, respectively. The variation probability was 0.10, 0.15, and 0.2, respectively.Taguchi analysis was carried out using an A-type orthogonal test table, and each horizontal combination was repeated for 5 times. Table3 lists the orthogonal test results of Taguchi analysis, the experimental value of total cost under each scheme, and corresponding signal-to-noise ratio and mean value.


### 5.2. Convergence Analysis of the Algorithm

In this study, the convergence of PSO algorithm is analyzed and verified by using two test functions combined with the test results of benchmark cases. For small and medium scale cases, the algorithm converges to the global optimal solution. There are 11 calculation examples in 24 Prins case sets [16] and 19 Barreto case sets [17], respectively. The gap between the solution results of PSO and BKR is 0%, indicating that the algorithm has converged the global optimal solution at this time. When solving large scale, the average difference between the optimal solution of the algorithm and BKR is only 1.16% in the Prins case set. In Barreto case set, the average difference between the optimal solution of PSO and BKR is 2.07%, excluding cases per 183–318 × 4 and per 183–318 × 4. The average difference between the optimal solution of all large-scale cases in the two case sets and BKR is 6.02%. Therefore, the PSO algorithm can converge to obtain an approximate optimal solution when solving large-scale problems. Finally, two common test functions are used to test as follows:(20)T1=minFi,j=i1−302+i2−202−20j1+20j2,s.t.−i1−2i2+30≤0,i1+i2−25≤0,i2≤15,minfi,j=i1−j12+i2−j22,s.t.0≤j1≤10,0≤j2≤10,,T2=minFi,j=−i12−3i2−4j1+j22,s.t.i12+2i2≤4,i1≥0,i2≥0,minfi,j=2i12+j12−5j2,s.t.i12−2i1+i22−2j1+j2≥−3,i2+3j1−4j2≥4,j1≥0,j2≥0..For the test function,T1 obtains its optimal solution i1,i2,j1,j2=20,5,10,5 through the PSO algorithm. F=225 is the upper target value. f=100 is the lower target value, and the convergence curve is shown in Figure 3. The optimal solution of T2 is i1,i2,j1,j2=0.4991,1.8733,4.1828,2.6054. F=−15.8120 is the upper target value, f=4.9668 is the lower target value, and the convergence curve is shown in Figure 4. The convergence curve shows the value of the objective function under different iterations. For both test functions, the optimal solution is obtained in the 6th or 7th generation, which further verifies the convergence and high efficiency of PSO algorithm.Figure 3
Convergence curve of test function T1.Figure 4
Convergence curve of test function T2.


### 5.3. Sensitivity Analysis of the Algorithm

In the case solution of this study, the confidence levelδ is assumed to be 0.9. In order to get a further conclusion, we calculate each cost at each confidence level δ from 0.05 to 0.95 successively. The algorithm in this study is used to calculate the optimal solution that meets the respective demand conditions at their respective confidence levels and observe their changes, and the change curve as shown in Figure 5 can be obtained.Figure 5
Cost change analysis.Through the analysis, the change trend of total cost and logistics cost is basically the same, and logistics cost accounts for a relatively high proportion. Therefore, it is very important for enterprises to choose where to establish distribution centers and establish several distribution centers from the perspective of overall cost when making location decisions.In addition, it can be seen from Figure5 that in the process of increasing confidence level, the input cost of enterprises is also gradually increasing. The confidence level essentially represents the percentage of shipments that can meet demand at the retail end. When the demand is uncertain, enterprises should pay more and more costs to meet the demand of the retail end. Meanwhile, the impact on cost can be further analyzed by adjusting the standard deviation σ. When the standard of quantity demanded changes, the actual quantity demanded changes. Standard deviation is often used to evaluate the degree of shadow of uncertain factors, and the greater the standard deviation is, the greater the uncertainty is.


## 5.1. Taguchi Analysis

Algorithm parameters have a great influence on algorithm performance, and good parameter settings can greatly improve algorithm performance. Therefore, it is very important to determine reasonable parameter values. Taguchi design is an excellent parameter design method, originating from the field of quality management, which aims to determine the optimal level combination of parameters with the minimum number of tests [15]. The algorithm has been widely used for its superior reliability, reproducibility, and simple analysis. Taguchi method mainly measures parameters by the signal-to-noise ratio (S/N). The larger the signal-to-noise ratio is, the more reasonable the corresponding parameter settings are. In addition, Taguchi’s target values were divided into three groups: “smaller is better”, “bigger is better,” and “nominally best”. Since the objective function of this study is to minimize the total cost, the type of “the smaller the better” is selected, and the corresponding SNR calculation equation is as follows:(19)SN=−10∗log10∑n=1tFn2t,where n is the times of algorithm execution at each parameter level. Fn is the response value, that is, the objective function value of experiment n.Parameter settings of PSO algorithm mainly include iteration times, population size, learning factor, inertia weight, crossover probability, and mutation probability. The nonlinear dynamic inertia weight coefficients,mmax  = 0.9 and mmin  = 0.4, are used in this study. According to previous experience, the learning factor (C) was set as 2, and the number of generation (Gen) was set as 500. Population size (POP), crossover probability (CP), and mutation probability (MP) were optimized by Taguchi analysis to determine the optimal values. Considering the optimization of orthogonal experimental design, three levels were taken for each parameter: the population size was 30, 40, and 50, respectively. The crossover rates were 0.75, 0.80, and 0.85, respectively. The variation probability was 0.10, 0.15, and 0.2, respectively.Taguchi analysis was carried out using an A-type orthogonal test table, and each horizontal combination was repeated for 5 times. Table3 lists the orthogonal test results of Taguchi analysis, the experimental value of total cost under each scheme, and corresponding signal-to-noise ratio and mean value.


## 5.2. Convergence Analysis of the Algorithm

In this study, the convergence of PSO algorithm is analyzed and verified by using two test functions combined with the test results of benchmark cases. For small and medium scale cases, the algorithm converges to the global optimal solution. There are 11 calculation examples in 24 Prins case sets [16] and 19 Barreto case sets [17], respectively. The gap between the solution results of PSO and BKR is 0%, indicating that the algorithm has converged the global optimal solution at this time. When solving large scale, the average difference between the optimal solution of the algorithm and BKR is only 1.16% in the Prins case set. In Barreto case set, the average difference between the optimal solution of PSO and BKR is 2.07%, excluding cases per 183–318 × 4 and per 183–318 × 4. The average difference between the optimal solution of all large-scale cases in the two case sets and BKR is 6.02%. Therefore, the PSO algorithm can converge to obtain an approximate optimal solution when solving large-scale problems. Finally, two common test functions are used to test as follows:(20)T1=minFi,j=i1−302+i2−202−20j1+20j2,s.t.−i1−2i2+30≤0,i1+i2−25≤0,i2≤15,minfi,j=i1−j12+i2−j22,s.t.0≤j1≤10,0≤j2≤10,,T2=minFi,j=−i12−3i2−4j1+j22,s.t.i12+2i2≤4,i1≥0,i2≥0,minfi,j=2i12+j12−5j2,s.t.i12−2i1+i22−2j1+j2≥−3,i2+3j1−4j2≥4,j1≥0,j2≥0..For the test function,T1 obtains its optimal solution i1,i2,j1,j2=20,5,10,5 through the PSO algorithm. F=225 is the upper target value. f=100 is the lower target value, and the convergence curve is shown in Figure 3. The optimal solution of T2 is i1,i2,j1,j2=0.4991,1.8733,4.1828,2.6054. F=−15.8120 is the upper target value, f=4.9668 is the lower target value, and the convergence curve is shown in Figure 4. The convergence curve shows the value of the objective function under different iterations. For both test functions, the optimal solution is obtained in the 6th or 7th generation, which further verifies the convergence and high efficiency of PSO algorithm.Figure 3
Convergence curve of test function T1.Figure 4
Convergence curve of test function T2.


## 5.3. Sensitivity Analysis of the Algorithm

In the case solution of this study, the confidence levelδ is assumed to be 0.9. In order to get a further conclusion, we calculate each cost at each confidence level δ from 0.05 to 0.95 successively. The algorithm in this study is used to calculate the optimal solution that meets the respective demand conditions at their respective confidence levels and observe their changes, and the change curve as shown in Figure 5 can be obtained.Figure 5
Cost change analysis.Through the analysis, the change trend of total cost and logistics cost is basically the same, and logistics cost accounts for a relatively high proportion. Therefore, it is very important for enterprises to choose where to establish distribution centers and establish several distribution centers from the perspective of overall cost when making location decisions.In addition, it can be seen from Figure5 that in the process of increasing confidence level, the input cost of enterprises is also gradually increasing. The confidence level essentially represents the percentage of shipments that can meet demand at the retail end. When the demand is uncertain, enterprises should pay more and more costs to meet the demand of the retail end. Meanwhile, the impact on cost can be further analyzed by adjusting the standard deviation σ. When the standard of quantity demanded changes, the actual quantity demanded changes. Standard deviation is often used to evaluate the degree of shadow of uncertain factors, and the greater the standard deviation is, the greater the uncertainty is.


## 6. Conclusion

With the rapid development of urbanization, the demand for agricultural products in cities is increasing. The shelf life of agricultural products puts forward higher requirements for logistics distribution. The location of logistics outlets determines the overall operation and distribution efficiency and greatly affects the planning of subsequent distribution routes. Site selection and distribution path planning determine the cost of distribution and customer service quality, and traditional methods have been unable to meet the current demand. Aiming at the above problems, this study proposes an algorithm of agricultural logistics network planning based on space-time constraints. The algorithm uses k-means clustering algorithm to determine the location of dot center. Then, the service customers are divided into two factors: time and space. Finally, the distribution path is planned by the particle swarm optimization algorithm. The experimental results show that the proposed algorithm can effectively shorten the total length of the distribution route, thus reducing the total cost of agricultural products distribution. When the demand and importance of customers change dynamically, the system will become more complex. How to deal with these complex factors will be the follow-up research direction of this study.



---

*Source: 5884050-2022-05-04.xml*