# Location Model for Distribution Centers for Fulfilling Electronic Orders of Fresh Foods under Uncertain Demand

Authors: Hao Zhang; Ying Xiong; Mingke He; Chongchong Qu
Journal: Scientific Programming
 (2017)

---

## Abstract

The problem of locating distribution centers for delivering fresh food as a part of electronic commerce is a strategic decision problem for enterprises. This paper establishes a model for locating distribution centers that considers the uncertainty of customer demands for fresh goods in terms of time-sensitiveness and freshness. Based on the methodology of robust optimization in dealing with uncertain problems, this paper optimizes the location model in discrete demand probabilistic scenarios. In this paper, an improved fruit fly optimization algorithm is proposed to solve the distribution center location problem. An example is given to show that the proposed model and algorithm are robust and can effectively handle the complications caused by uncertain demand. The model proposed in this paper proves valuable both theoretically and practically in the selection of locations of distribution centers.


---

## Body

## 1. Introduction

In recent years, customers have enjoyed the fast delivery of fresh goods and foods through the rapid development of electronic commerce. Currently, in China, some big competitive e-commerce companies such as Amazon Fresh, Oahu Fresh, and Motion Optimization are providing e-commerce services with fast distribution network centers. The biggest problem faced by these companies is the uncertainty of customer demand for fresh goods, as the fresh goods are perishable and have a definite shelf life. Currently, up to 30% of all fresh food is lost throughout the supply chain before it reaches the consumers, implying huge economic loss issues [1]. Having the distribution centers strategically located helps to keep perishable food fresh by keeping the time of storage and transport between facilities as short as possible [2]. The location of distribution centers is of great importance during the design of the distribution network center because of the perishable nature of fresh food [3].The size or the location of distribution centers will affect freshness, delivery speed, and distribution cost for each firm. Companies can build or rent distribution centers in a targeted area by analyzing market demand to improve the locations of the distribution network center and to reduce cost. Once the size and location of the distribution center are determined, it will not change for a certain period of time, but the customer demand of fresh goods may change. An important issue that arises while designing a distribution network is coping with the uncertainty of demand [4]. Distribution center location will be affected when demand uncertainty is considered, as demand uncertainty forces companies to design a more reasonable distribution network and distribution plan to react quickly to variations and to meet customers’ expectations [5]. Therefore, it is important to consider the uncertain customer demand in the selection of commodity distribution centers.The rest of the paper is structured as follows. Section2 presents a relevant literature review on models of distribution center locations for perishable products and on robust optimization models. In Section 3, an optimization model is established to minimize the total costs of distribution center locations for delivering fresh goods; the methodology and the solution algorithm are given to solve the model. Section 4 addresses experimental results. Finally, Section 5 is devoted to the conclusions and the clarification of our work.


## 2. Related Literature Review

Many scholars have conducted in-depth studies on the location of distribution centers for perishable products and proposed various models and algorithms for optimizing site selection.Hiassat et al. [6] considered the characteristics of perishable products. An optimization model was proposed to add a decision regarding the location of the distribution center to the inventory path problem. A genetic algorithm and a local search heuristic method were used to solve the problem. Govindan et al. [7] established a model of distribution center location and path optimization that mainly considers the high quality of perishable food. The model was solved with the multiobjective particle swarm optimization adaptive multiobjective variable neighborhood search hybrid method. Drezner and Scott [8] considered the location of a distribution center for a single perishable product. The model was established based on the inventory and position decision. The Weiszfeld algorithm was used to solve for the minimum total cost. Seyedhosseini and Ghoreyshi [9] formulated a new integrated production and distribution planning model for perishable products. LINGO software was used to solve the production model, and a particle swarm heuristic was developed to tackle the distribution model. de Keizer et al. [10] developed a network design model for perishable products that integrates decision-making on hub locations with the positioning of the customer order decoupling point, taking into account decay in product quality and the heterogeneity of product quality to allow for a comprehensive differentiation of product flows in network design. Orjuela-Castro et al. [3] present a model for locating facilities of mountain ranges, considering the factors of temperature and relative humidity on the perishability of fresh food.Yang et al. [11] studied the dairy distribution center location model based on two levels of distribution and considered the cost of corruption of fresh products. He solved the model using a genetic algorithm. Zhang and Shao-chuan [12] studied a model of locating fresh food distribution centers, used the addition method to solve the problem, and then used field search to replace the improved initial solution. Wu et al. [13] proposed a multiperiod location model with transportation economies of scale that distributes a single perishable product and formulated the problem as a mixed integer nonlinear programming model. Musavi and Bozorgi-Amiri [14] present a novel sustainable hub location-vehicle scheduling model considering responsiveness and environmental impacts and propose an adopted nondominated sorting genetic algorithm-II (NSGA-II) metaheuristic approach to solve problems. Rezaei-Malek et al. [15] propose a multiobjective model to design a disaster relief logistics hub location considering the lifetime of perishable products by adjusting certain time windows and consider the inherent uncertainty of input data. Khalili-Damghani et al. [16] propose a biobjective model to reduce the total cost of a company and consider the location of warehouses and the routing of vehicles for the distribution of perishable products.From the literature review, we can see that many scholars are studying models of fresh perishable product distribution while assuming deterministic demand. However, there exists significant uncertainty regarding demand as the industry transitions from the current delivery mode of fresh products from a mono type and large batch distribution to a multitype delivery mode and small batch distribution. Therefore, companies should consider the effect of uncertainty in the establishment of distribution centers.The main method of optimization under uncertainty is robust optimization. Robust optimization assumes that the uncertain parameters belong to a bounded and closed set and obtains a worst-case scenario to help decision makers reduce risk. Zhang et al. [17] proposed a robust mixed integer linear model with multiple objectives (economic, environmental, and social objectives) under supply and demand uncertainty. Qiu and Wang [18] developed a robust optimization model for designing a three-echelon supply chain network that consists of manufacturers, distribution centers, and retailers under both demand uncertainty and supply disruptions. Ben-Tal et al. [19, 20] developed a robust optimization method and proposed an optimization framework of comprehensive robust equivalence. The robust optimization method was applied to a problem of uncertain and bounded demand. Ghodratnama et al. [21] studied the multiobjective hub location-distribution problem from a supply chain angle. The model is optimized by robust and fuzzy target programming. Habibzadeh Boukani et al. [22] considered the use of robust optimization methods to handle problems of locating multiple allocation centers under uncertain parameters. It was found that ignoring uncertainty in the supply chain network design could result in significant losses and costs.Jakubovskis [23] presents a robust optimization modeling approach to make strategic capacity planning and resource acquisition decisions. The author examines the effects of economies of scale, economies of scope, and the combined effects of scale and scope under uncertain demand realizations. Eiselt and Marianov [24] studied WTE facility location planning problems under uncertainty from a government perspective in a cost-effective and environmental-friendly way. Bardossy and Raghavan [25] presented a robust optimization model for the connected facility location problem within the framework and extend the BS robust optimization approach using heuristics in conjunction with a lower bounding procedure for the subproblems. de Rosa et al. [26] presented the robust capacitated facility location problem to cope with uncertainty by dynamically assigning multilevel production allocations, locations, and capacity adjustments for uncertain parameter development over time. Ehrgott et al. [27] argue that robust optimization can be applied to problems where a solution is required that hedges against all possible scenarios, with realizations from the uncertain input data. Due to operational environment changes and information uncertainty in network designs, Xu et al. [28] present a general two-stage quantitative framework to help decision makers to select the optimal network design scheme for collaborative logistics networks under uncertainty, then add the robust constraints into the expected value model, and make the model more robustness. Majewski et al. [29] propose a min–max robust multiobjective problem formulation to determine a robust sustainable design to cope with uncertainties, and the formulation allows the identification of robust sustainable designs, easily guaranteeing the security of the energy supply.The above literature shows that robust optimization is an effective way to address uncertain problems. These studies have laid the foundation for the subsequent optimization of robust research.In this paper, we will consider factors such as uncertain demand, the shelf life of a variety of perishable products, the timeliness and freshness of those products, and the establishment of a location model for distribution centers that satisfies the customer demand for fast delivery of products. Robust optimization can also improve the ability of anti-interference in the model of locating distribution centers to address the problem of uncertainty. An improved fruit fly algorithm is used to solve the robust optimization.


## 3. Model Building and Solution Method

### 3.1. Problem Description

In the practice of fresh goods e-commerce, the uncertainty of customer demand for fresh products and the requirement of customer satisfaction for fresh commodities distribution often exist simultaneously. Both factors must be considered at the same time. The distribution network of an enterprise is often composed of multiple distribution centers and this paper will establish a location model for multiple distribution centers. The goal of the location model is to meet the requirements of the customers when distributing the goods from the distribution center to the customers and maintain the lowest cost possible.


### 3.2. Assumptions

Many scholars have presented mathematical models, and it is crucial to consider all of the assumptions in this paper. In our research, it is assumed that fresh goods e-commerce enterprises will set up a number of discrete distribution centers within a certain period of time and a certain area. Goods are purchased from a plurality of fresh commodity suppliers and are stored in different distribution center locations. When an order is received from customers, the nearest distribution center is selected to deliver products to customers. We assume that the quantity and satisfaction requirements of the fresh commodity consumer (demand point) are predetermined, but the specific demand for each order of the consumer is uncertain. That is, each order can be ordered with multiple fresh varieties. The goal of the distribution center location model is to meet the requirements of the customers when distributing the goods from the distribution center to the customers and maintain the lowest cost possible. The logic diagram is as shown in Figure1.Figure 1
Logic diagram of locating distribution centers.In addition to the general assumptions described above, this paper also considers the following specific assumptions that the fresh goods e-commerce enterprises operate in a specific period of time:(1)
Fresh goods e-commerce enterprises prefer to rent the distribution centers from the existing candidate distribution centers and avoid the choice of constructing them. The benefit of selecting from existing distribution centers is that the fixed costs and operating costs are lower than when constructing a new center.(2)
Customer demand is uncertain, and any candidate distribution center can fully satisfy the demand of a particular customer.(3)
The supply capacity of fresh commodity suppliers can meet the largest needs of the demand.(4)
In the total cost calculation, firms do not consider the fresh goods inventory costs, loading and unloading losses, vehicle maintenance costs, equipment maintenance costs, and staff bonus.(5)
Unit delivery cost is known and constant.(6)
The spoilage rate of fresh foods in the distribution process is constant.(7)
Fresh goods remain fresh when leaving the distribution center.(8)
Freshness of fresh produce can be perceived at all times during distribution.(9)
Delivery times may fluctuate, but drivers are penalized according to the degree of deviation from the service standard.(10)
This model is appropriate only for a certain period of time and static location assumptions, regardless of future costs and earnings changes.


### 3.3. Notation

The following notation is used to formulate the problem considered in this paper. Parameters are as follows:H: Set of suppliers H=h∣h=1,2,…,qI: Set of distribution centers I=i∣i=1,2,…,mJ: Set of customers J=j∣j=1,2,…,nK: Set of fresh food typesUh: Maximum supply capacity of supplier h to the enterpriseNi: Maximum inventory capacity of distribution center iθk: Corruption rate coefficient of fresh food k, constantlhi: Distance between supplier h and distribution center ilij: Distance between distribution center i and customer jv: Average speed of vehicleChi: Transportation cost per unit from supplier h to distribution center iCij: Transportation cost per unit from distribution center i to customer jAi: Fixed cost of distribution center iBi: Operating cost of distribution center ifij: Penalty costs of vehicle arriving late to customer jw: The largest number of new distribution centers available to rentrk: The average selling price of the variety k of fresh goodstij: Time of vehicle from distribution center i to customer jTj: The serve time that customer j requires from the delivery centerTjmax: The shortest waiting time that customer j is not dissatisfiedTjmin: The longest waiting time that customer j is dissatisfiedαjk: The freshness satisfaction threshold for customer j of variety k of fresh goodsβj: The time satisfaction threshold for customer j.Decision Variables
d
h
i: The transport quantity of goods from supplier h to distribution center i
d
i
j: The transport quantity of goods from distribution center i to customer j
d
j: The demand of customer j
y
i: Binary variable that takes the value 1 if distribution center i is selected
z
h
i: Binary variable that takes the value 1 if distribution center i is supplied by supplier h
z
i
j: Binary variable that takes the value 1 if customer j is supplied by distribution center i
z
j
k: Binary variable that takes the value 1 if fresh food k is supplied to customer j.


### 3.4. Distribution Center Location Mathematical Model

This paper constructs the location model of the distribution center under the condition of determinate customer demand, then introduces the demand uncertainty function, and optimizes the model using the robust optimization method.


#### 3.4.1. Location Mathematical Model under Determinate Demand

The total cost of the distribution center model is the minimum total cost, which is composed of fixed costs, operating expenses, transportation costs, delayed penalty costs, and fresh goods corruption costs for distribution centers. The consumer satisfaction model includes the maximum freshness of fresh goods and the maximum accuracy of the distribution center service time:(1)
Fixed costs and operating expenses(δ1)(1)δ1=∑i∈IAiyi+∑i∈IBiyi(2)
Transportation costs(δ2)(2)δ2=∑h∈H∑i∈IChilhidhi+∑i∈I∑j∈JCijlijdij(3)
Delayed penalty costs(δ3)(3)δ3=fijtij-Tj0tij≥Tjtij<Tj.(4)
Fresh goods corruption costs(δ4)Fresh goods corruption costs can be expressed in terms of freshness. Consumers care about the freshness of products as visual indicators of their quality. Product transport time and mileage have a large impact on the freshness of certain perishable products. Therefore, this paper, which is based on the freshness model established by Zhang and Shao-chuan [12], takes the transportation time and the transport distance as the variables into account. We form a new freshness formula: (4)ϕjk=1-θk∑h∈H∑i∈I∑j∈Jλ1lhi/v+tij+λ2lhi+lijzij,where the transit time weight is λ1, the transport distance weight is λ2, and the weight is determined according to the specific transportation distance and the transportation time. For the convenience of follow-up study, in this article, λ1=λ2=0.5.Fresh goods corruption costs(5)δ4=∑k∈Krk1-ϕjk.(5)
The freshness of fresh goods (τjk) (6)τjk=∑j∈J∑k∈Kzjkϕjk∑j∈J∑k∈Kzjk.(6)
The distribution center service time (μj) (7)μj=∑i∈I∑j∈Jzijωtij∑i∈I∑j∈Jzij.ω
(
t
i
j
) is the consumer satisfaction time function. We use the satisfaction formula introduced to the literature in Yunfeng et al. [30]: (8)ωtij=1tij≤TjminTjmax-tijTjmax-TjminγTjmin<tij≤Tjmax0tij≥Tjmax.In summary, the models of e-commerce distribution center locations are as follows:(9)minδ=δ1+δ2+δ3+δ4(10)maxτjk(11)maxμj(12)s.t.∑i∈Idhi≤Uh∀h∈H(13)∑h∈Hdhi≤Niyi∑j∈Jdij≤Niyi∀i∈I(14)∑i∈Iyi≤w(15)∑i∈Izij=1∀j∈J(16)∑i∈Idij≥dj∀j∈J(17)zij≤yizhi≤yi∀i∈I∀j∈J(18)dhi≥0dij≥0(19)yi,zhi,zij∈0,1∀i∈I∀j∈J.The objective function (9) indicates that the total cost is to be minimized. The objective function (10) indicates the maximum freshness of fresh goods. The objective function (11) indicates the maximum accuracy of the distribution center service time.Constraint (12) is the supply constraint of the supplier. It ensures that the total amount of products transported from supplier h does not exceed the maximum supply capacity. Constraints (13) are the distribution center i inventory constraints, and they enforce that the storage of the total fresh product does not exceed the maximum inventory capacity. Constraint (14) represents the number of new distribution center constraints. Constraint (15) ensures that each customer has only one candidate distribution center to deliver to him or her. Constraint (16) indicates that the volume of fresh foods delivered to the customer cannot be less than the customer demand, due to possible cargo damage. Constraint (17) ensures that the selected distribution center can provide delivery. Equations (18) and (19) are constrained by decision variables.In the calculation, the multiobjective function is transformed into a single objective function by the main objective method to select the main objective function according to the enterprise’s strategic plan. If the business goal is to minimize the total cost and the freshness and the distribution center service time only need to achieve a consumer satisfaction threshold, then consumer satisfaction does not have to be maximized, but consumer satisfaction is transformed into a constraint. In this paper, the main objective function is chosen to be the minimum total cost, and the satisfaction of the consumer is set as a constraint:(20)τjk≥αjk,μj≥βj.Constraint (20) requires that the freshness of the product must reach the customer satisfaction threshold, and the satisfaction degree of the distribution center service time must meet the customer satisfaction threshold for time.In the abovementioned distribution center location model, it is assumed that the demanddj is known, and the total cost of the decision method can be obtained from the objective function (9). However, in real life, there is a great deal of uncertainty in the demand for fresh goods, so we need to use a robust optimization method to optimize the selection of locations for distribution centers.


#### 3.4.2. Location Mathematical Model under Uncertain Demand

The abovementioned distribution center location model is converted into an equivalent auxiliary model by using robust optimization. The uncertainty of demand is at the core of obtaining the equivalent auxiliary model. This paper uses a series of discrete scenarios to describe the possible requirements of the customer.The specific demand of each location is unknown and is considered to vary in a closed and bounded box. This is a common description of the uncertainty method.Assuming that the demand scenario iss, where s=1,2,…,S is the probability that the demand scenario s of customer j satisfies the ellipsoid uncertainty set. The general form of the box can be specified as follows: (21)pjs∈Ω=pjs0+Qu,eTQu=0,pjs0+Qu≥0,u≤1,where pjs0 is the most probable probability distribution of demand points; Q∈Rnm×nm is the scope of the zoom; u denotes the Euclidean norm for perturbation; eTQu=0,pjs0+Qu≥0 is to ensure that the demand scenario probability pjs is a probability distribution.Assuming that the demand of each customer is independent of each other and does not interfere with each other, and the total cost of the site under the demand scenarios of customer j is δjs, the cost of a distribution center is determined as follows: (22)δij=∑s∈Sδijspjs.The total expected cost for all distribution centers is determined as follows:(23)Eδi=∑j∈Jδij=∑j∈J∑s∈Sδijspjs=∑j∈JpjTδj,δj=δj1,δj2,…,δjsT,pj=pj1,pj2,…,pjsT.The total cost of the distribution center is transformed:(24)minEδ=min∑j∈JpjTδj.The robust correspondence model of (19) is expressed as(25)minmaxpjs∈Ω⁡Eδ=minmaxpjs∈Ω⁡∑j∈JpjTδj.The above model is equivalent to(26)minϖ(27)s.t.maxpjs∈Ω∑j∈JpjTδj≤ϖ.p
j
s satisfies the demand uncertain set (21); then the left side of formula (27) is(28)maxpjs∈Ω∑j∈JpjTδj=maxpjs∈Ω⁡∑j∈Jpjs0Tδj+QuTδj=∑j∈Jpjs0Tδj+maxpjs∈ΩQuTδj.Becauseu≤1(29)maxpjs∈Ω⁡QuTδj=maxpjs∈Ω⁡QTδj.Equation (27) is converted to(30)∑j∈Jpjs0Tδj+maxpjs∈Ω⁡QTδj≤ϖ.In summary, the optimization objective of the robust optimization model ismin⁡ϖ and composed of the constraints (30) and (12) to (20). The model has good robustness, through the robust optimization of the model, which can meet the uncertain demand of the customer and ensure the economic feasibility of the location selection scheme.


### 3.5. Improved Fruit Fly Optimization Algorithm (IFOA)

After the above two-step modeling, this paper establishes a model of the distribution center of fresh goods e-commerce under uncertain demand. The next important problem is the solution of the model. The location problem in the uncertain situation is an NP-hard problem. The traditional solution method is complicated, and the required amount of is prohibitive for finding a solution. Therefore, a heuristic algorithm is used to solve the problem.FOA is suitable for solving the optimization problem with complex constraints and strong correlation between the constituent elements of the solution [31]. It is widely used in many classical optimization fields, such as efficient truss optimization [32], gasification process operation optimization [33], and analysis of service satisfaction [34]. The FOA algorithm is easy to combine with other methods, has strong robustness, and is suitable for robustly optimizing the location of distribution centers. Therefore, FOA is used to solve the problem in this paper.


#### 3.5.1. Fruit Fly Optimization Algorithm (FOA)

FOA is outlined as follows.Step 1.
Initialize parameters, including the maximum number of evaluations (maxgen) and the size of fruit flies (sizepop), and initialize the position of the flies (X_axis,Y_axis).Step 2.
Randomly initialize the flight direction and distance of the individual flies, whereRandomValue is the distance in the search:(31)Xi=X_axis+RandomValue,Yi=Y_axis+RandomValue.Step 3.
The distance of each fly from the origin point and the smell concentration judgment value is defined as follows:(32)Disti=xi2+yi2,Si=1Disti.Step 4.
Based onSi, the smell concentration of flies, denoted by Smelli, is calculated as follows:(33)Smelli=functionSi.Step 5.
Find the fruit flies with the best smell concentration and allow the flies to fly to the optimal position(34)bestSmellbestindex=minSmelliSmellbest=bestSmellx_axis=Xbestindexy_axis=Ybestindex.Step 6.
Stop the search if the maximum evaluation number is reached; otherwise, repeat Steps2–5.FOA has great ability to achieve global optimization and high convergence accuracy and has great research value in the field of engineering. However, the original FOA uses a fixed search step and cannot take both global search capabilities and local search capabilities into account, thus affecting the convergence rate and search ability. Additionally, it is easy for FOA to focus on a local optimum, leading to premature convergence. This paper focuses on the shortcomings of the algorithm and improves FOA. The purpose of improving the FOA is to make it solve the location model better.


#### 3.5.2. Improved Fruit Fly Optimization Algorithm (IFOA)

In this paper, an improved fruit fly optimization algorithm (IFOA) is proposed. The search step size is dynamically adjusted by introducing the weighting function. The purpose of dynamic adjustment is to divide the search into two parts. The first part contains a large search step in a large area for a global search to ensure that the algorithm considers the global optimum. The second part contains a smaller step search to ensure local search capabilities.The fruit fly individual random search expression is as follows:(35)Xi=X_axis+ψ·rand,Yi=Y_axis+ψ·rand,where ψ represents the weighted function:(36)ψ=exp⁡-Smelli-Smelli-1Smelliζ,where Smelli is the ith optimal fitness value. When the ratio change is large, it indicates that the fly group is searching for a new space and that the weighting function is conducive to a global search. When the ratio change is small, the fruit fly group has shifted to a local search, and the weight function is reduced. ζ>0 and as ζ increases, fruit fly search ability increases, which prevents the algorithms from concentrating on a local optimum. It can be adjusted according to the actual problem. In addition to the random search expression, the other IFOA algorithm step expression is consistent with FOA.


#### 3.5.3. Test Function

To test and analyze the performance of the improved algorithm, the following two classic test functions were used to test FOA and IFOA, respectively. Function form, range, theoretical extremes, and peak are shown in Table1.Table 1
Test function.
Test function
Range
Optimal
Peak
m
i
n
f
1
=
-
e
x
p
-
0.5
⋅
∑
i
=
1
n
x
i
2
[
-
1,1
]
-
1
Single
m
i
n
f
2
=
s
i
n
2
∑
i
=
1
n
x
i
2
-
0.5
1
+
0.001
∑
i
=
1
n
x
i
2
2
+
0.5
[
-
100,100
]
0
MultipleThe specific initialization parameter is set tosizepop=20maxgen=100. We randomly initialize the flies’ population position. The results of the functional tests are shown in Table 2, and the optimization process is shown in Figure 2.Table 2
Mean and standard deviation of function test.
Function
Result
FOA
IFOA
f
1
(
x
)
Mean
3.0546 × 10−6
-
1
Std
7.5382 × 10−6
0
f
2
(
x
)
Mean
3.1266 × 10−6
4.67 × 10−4
Std
8.6307 × 10−8
2.328 × 10−3Figure 2
Optimization process of FOA and IFOA.From the test results in Table2 and optimization process, IFOA has stronger capabilities of global search, local search, and higher convergence accuracy than FOA. Under the same conditions, IFOA results are superior to FOA, in terms of both mean and standard deviation. Under the same convergence accuracy, the number of valid iterations of IFOA is less than that of FOA, which indicates that IFOA converges faster. Therefore, IFOA effectively improves the convergence precision and convergence speed of FOA.


### 3.6. The Calculation Process of Model

(1)
Collect the relevant data needed to establish the distribution center model (as shown in Section3.3);
(2)
Convert the distribution center model under uncertain demand to a tractable equivalent model by using robust optimization.
(3)
IFOA is used to solve the mathematical model:
(1)
Set the initial parameters, including the maximum number of evaluations (maxgen) and the size of the fruit flies (sizepop), and the initial position of the flies (X_axis,Y_axis).
(2)
Randomly setting the flight direction and distance of the individual flies, the fruit fly individual random search expression is as follows:(37)Xi=X_axis+ψ·rand,Yi=Y_axis+ψ·rand.
(3)
According to the fitness function formula, the individual fruit fly is calculated to find the position and optimal value of the individual and the global optimal individual.
(4)
Find the fruit flies with the best smell concentration and allow the flies to fly to the optimal position.
(5)
Stop the search if the maximum evaluation number is reached; otherwise, repeat.
(6)
According to the IFOA optimal location results, then find the corresponding best location of the distribution center and the optimal distribution path.


## 3.1. Problem Description

In the practice of fresh goods e-commerce, the uncertainty of customer demand for fresh products and the requirement of customer satisfaction for fresh commodities distribution often exist simultaneously. Both factors must be considered at the same time. The distribution network of an enterprise is often composed of multiple distribution centers and this paper will establish a location model for multiple distribution centers. The goal of the location model is to meet the requirements of the customers when distributing the goods from the distribution center to the customers and maintain the lowest cost possible.


## 3.2. Assumptions

Many scholars have presented mathematical models, and it is crucial to consider all of the assumptions in this paper. In our research, it is assumed that fresh goods e-commerce enterprises will set up a number of discrete distribution centers within a certain period of time and a certain area. Goods are purchased from a plurality of fresh commodity suppliers and are stored in different distribution center locations. When an order is received from customers, the nearest distribution center is selected to deliver products to customers. We assume that the quantity and satisfaction requirements of the fresh commodity consumer (demand point) are predetermined, but the specific demand for each order of the consumer is uncertain. That is, each order can be ordered with multiple fresh varieties. The goal of the distribution center location model is to meet the requirements of the customers when distributing the goods from the distribution center to the customers and maintain the lowest cost possible. The logic diagram is as shown in Figure1.Figure 1
Logic diagram of locating distribution centers.In addition to the general assumptions described above, this paper also considers the following specific assumptions that the fresh goods e-commerce enterprises operate in a specific period of time:(1)
Fresh goods e-commerce enterprises prefer to rent the distribution centers from the existing candidate distribution centers and avoid the choice of constructing them. The benefit of selecting from existing distribution centers is that the fixed costs and operating costs are lower than when constructing a new center.(2)
Customer demand is uncertain, and any candidate distribution center can fully satisfy the demand of a particular customer.(3)
The supply capacity of fresh commodity suppliers can meet the largest needs of the demand.(4)
In the total cost calculation, firms do not consider the fresh goods inventory costs, loading and unloading losses, vehicle maintenance costs, equipment maintenance costs, and staff bonus.(5)
Unit delivery cost is known and constant.(6)
The spoilage rate of fresh foods in the distribution process is constant.(7)
Fresh goods remain fresh when leaving the distribution center.(8)
Freshness of fresh produce can be perceived at all times during distribution.(9)
Delivery times may fluctuate, but drivers are penalized according to the degree of deviation from the service standard.(10)
This model is appropriate only for a certain period of time and static location assumptions, regardless of future costs and earnings changes.


## 3.3. Notation

The following notation is used to formulate the problem considered in this paper. Parameters are as follows:H: Set of suppliers H=h∣h=1,2,…,qI: Set of distribution centers I=i∣i=1,2,…,mJ: Set of customers J=j∣j=1,2,…,nK: Set of fresh food typesUh: Maximum supply capacity of supplier h to the enterpriseNi: Maximum inventory capacity of distribution center iθk: Corruption rate coefficient of fresh food k, constantlhi: Distance between supplier h and distribution center ilij: Distance between distribution center i and customer jv: Average speed of vehicleChi: Transportation cost per unit from supplier h to distribution center iCij: Transportation cost per unit from distribution center i to customer jAi: Fixed cost of distribution center iBi: Operating cost of distribution center ifij: Penalty costs of vehicle arriving late to customer jw: The largest number of new distribution centers available to rentrk: The average selling price of the variety k of fresh goodstij: Time of vehicle from distribution center i to customer jTj: The serve time that customer j requires from the delivery centerTjmax: The shortest waiting time that customer j is not dissatisfiedTjmin: The longest waiting time that customer j is dissatisfiedαjk: The freshness satisfaction threshold for customer j of variety k of fresh goodsβj: The time satisfaction threshold for customer j.Decision Variables
d
h
i: The transport quantity of goods from supplier h to distribution center i
d
i
j: The transport quantity of goods from distribution center i to customer j
d
j: The demand of customer j
y
i: Binary variable that takes the value 1 if distribution center i is selected
z
h
i: Binary variable that takes the value 1 if distribution center i is supplied by supplier h
z
i
j: Binary variable that takes the value 1 if customer j is supplied by distribution center i
z
j
k: Binary variable that takes the value 1 if fresh food k is supplied to customer j.


## 3.4. Distribution Center Location Mathematical Model

This paper constructs the location model of the distribution center under the condition of determinate customer demand, then introduces the demand uncertainty function, and optimizes the model using the robust optimization method.


### 3.4.1. Location Mathematical Model under Determinate Demand

The total cost of the distribution center model is the minimum total cost, which is composed of fixed costs, operating expenses, transportation costs, delayed penalty costs, and fresh goods corruption costs for distribution centers. The consumer satisfaction model includes the maximum freshness of fresh goods and the maximum accuracy of the distribution center service time:(1)
Fixed costs and operating expenses(δ1)(1)δ1=∑i∈IAiyi+∑i∈IBiyi(2)
Transportation costs(δ2)(2)δ2=∑h∈H∑i∈IChilhidhi+∑i∈I∑j∈JCijlijdij(3)
Delayed penalty costs(δ3)(3)δ3=fijtij-Tj0tij≥Tjtij<Tj.(4)
Fresh goods corruption costs(δ4)Fresh goods corruption costs can be expressed in terms of freshness. Consumers care about the freshness of products as visual indicators of their quality. Product transport time and mileage have a large impact on the freshness of certain perishable products. Therefore, this paper, which is based on the freshness model established by Zhang and Shao-chuan [12], takes the transportation time and the transport distance as the variables into account. We form a new freshness formula: (4)ϕjk=1-θk∑h∈H∑i∈I∑j∈Jλ1lhi/v+tij+λ2lhi+lijzij,where the transit time weight is λ1, the transport distance weight is λ2, and the weight is determined according to the specific transportation distance and the transportation time. For the convenience of follow-up study, in this article, λ1=λ2=0.5.Fresh goods corruption costs(5)δ4=∑k∈Krk1-ϕjk.(5)
The freshness of fresh goods (τjk) (6)τjk=∑j∈J∑k∈Kzjkϕjk∑j∈J∑k∈Kzjk.(6)
The distribution center service time (μj) (7)μj=∑i∈I∑j∈Jzijωtij∑i∈I∑j∈Jzij.ω
(
t
i
j
) is the consumer satisfaction time function. We use the satisfaction formula introduced to the literature in Yunfeng et al. [30]: (8)ωtij=1tij≤TjminTjmax-tijTjmax-TjminγTjmin<tij≤Tjmax0tij≥Tjmax.In summary, the models of e-commerce distribution center locations are as follows:(9)minδ=δ1+δ2+δ3+δ4(10)maxτjk(11)maxμj(12)s.t.∑i∈Idhi≤Uh∀h∈H(13)∑h∈Hdhi≤Niyi∑j∈Jdij≤Niyi∀i∈I(14)∑i∈Iyi≤w(15)∑i∈Izij=1∀j∈J(16)∑i∈Idij≥dj∀j∈J(17)zij≤yizhi≤yi∀i∈I∀j∈J(18)dhi≥0dij≥0(19)yi,zhi,zij∈0,1∀i∈I∀j∈J.The objective function (9) indicates that the total cost is to be minimized. The objective function (10) indicates the maximum freshness of fresh goods. The objective function (11) indicates the maximum accuracy of the distribution center service time.Constraint (12) is the supply constraint of the supplier. It ensures that the total amount of products transported from supplier h does not exceed the maximum supply capacity. Constraints (13) are the distribution center i inventory constraints, and they enforce that the storage of the total fresh product does not exceed the maximum inventory capacity. Constraint (14) represents the number of new distribution center constraints. Constraint (15) ensures that each customer has only one candidate distribution center to deliver to him or her. Constraint (16) indicates that the volume of fresh foods delivered to the customer cannot be less than the customer demand, due to possible cargo damage. Constraint (17) ensures that the selected distribution center can provide delivery. Equations (18) and (19) are constrained by decision variables.In the calculation, the multiobjective function is transformed into a single objective function by the main objective method to select the main objective function according to the enterprise’s strategic plan. If the business goal is to minimize the total cost and the freshness and the distribution center service time only need to achieve a consumer satisfaction threshold, then consumer satisfaction does not have to be maximized, but consumer satisfaction is transformed into a constraint. In this paper, the main objective function is chosen to be the minimum total cost, and the satisfaction of the consumer is set as a constraint:(20)τjk≥αjk,μj≥βj.Constraint (20) requires that the freshness of the product must reach the customer satisfaction threshold, and the satisfaction degree of the distribution center service time must meet the customer satisfaction threshold for time.In the abovementioned distribution center location model, it is assumed that the demanddj is known, and the total cost of the decision method can be obtained from the objective function (9). However, in real life, there is a great deal of uncertainty in the demand for fresh goods, so we need to use a robust optimization method to optimize the selection of locations for distribution centers.


### 3.4.2. Location Mathematical Model under Uncertain Demand

The abovementioned distribution center location model is converted into an equivalent auxiliary model by using robust optimization. The uncertainty of demand is at the core of obtaining the equivalent auxiliary model. This paper uses a series of discrete scenarios to describe the possible requirements of the customer.The specific demand of each location is unknown and is considered to vary in a closed and bounded box. This is a common description of the uncertainty method.Assuming that the demand scenario iss, where s=1,2,…,S is the probability that the demand scenario s of customer j satisfies the ellipsoid uncertainty set. The general form of the box can be specified as follows: (21)pjs∈Ω=pjs0+Qu,eTQu=0,pjs0+Qu≥0,u≤1,where pjs0 is the most probable probability distribution of demand points; Q∈Rnm×nm is the scope of the zoom; u denotes the Euclidean norm for perturbation; eTQu=0,pjs0+Qu≥0 is to ensure that the demand scenario probability pjs is a probability distribution.Assuming that the demand of each customer is independent of each other and does not interfere with each other, and the total cost of the site under the demand scenarios of customer j is δjs, the cost of a distribution center is determined as follows: (22)δij=∑s∈Sδijspjs.The total expected cost for all distribution centers is determined as follows:(23)Eδi=∑j∈Jδij=∑j∈J∑s∈Sδijspjs=∑j∈JpjTδj,δj=δj1,δj2,…,δjsT,pj=pj1,pj2,…,pjsT.The total cost of the distribution center is transformed:(24)minEδ=min∑j∈JpjTδj.The robust correspondence model of (19) is expressed as(25)minmaxpjs∈Ω⁡Eδ=minmaxpjs∈Ω⁡∑j∈JpjTδj.The above model is equivalent to(26)minϖ(27)s.t.maxpjs∈Ω∑j∈JpjTδj≤ϖ.p
j
s satisfies the demand uncertain set (21); then the left side of formula (27) is(28)maxpjs∈Ω∑j∈JpjTδj=maxpjs∈Ω⁡∑j∈Jpjs0Tδj+QuTδj=∑j∈Jpjs0Tδj+maxpjs∈ΩQuTδj.Becauseu≤1(29)maxpjs∈Ω⁡QuTδj=maxpjs∈Ω⁡QTδj.Equation (27) is converted to(30)∑j∈Jpjs0Tδj+maxpjs∈Ω⁡QTδj≤ϖ.In summary, the optimization objective of the robust optimization model ismin⁡ϖ and composed of the constraints (30) and (12) to (20). The model has good robustness, through the robust optimization of the model, which can meet the uncertain demand of the customer and ensure the economic feasibility of the location selection scheme.


## 3.4.1. Location Mathematical Model under Determinate Demand

The total cost of the distribution center model is the minimum total cost, which is composed of fixed costs, operating expenses, transportation costs, delayed penalty costs, and fresh goods corruption costs for distribution centers. The consumer satisfaction model includes the maximum freshness of fresh goods and the maximum accuracy of the distribution center service time:(1)
Fixed costs and operating expenses(δ1)(1)δ1=∑i∈IAiyi+∑i∈IBiyi(2)
Transportation costs(δ2)(2)δ2=∑h∈H∑i∈IChilhidhi+∑i∈I∑j∈JCijlijdij(3)
Delayed penalty costs(δ3)(3)δ3=fijtij-Tj0tij≥Tjtij<Tj.(4)
Fresh goods corruption costs(δ4)Fresh goods corruption costs can be expressed in terms of freshness. Consumers care about the freshness of products as visual indicators of their quality. Product transport time and mileage have a large impact on the freshness of certain perishable products. Therefore, this paper, which is based on the freshness model established by Zhang and Shao-chuan [12], takes the transportation time and the transport distance as the variables into account. We form a new freshness formula: (4)ϕjk=1-θk∑h∈H∑i∈I∑j∈Jλ1lhi/v+tij+λ2lhi+lijzij,where the transit time weight is λ1, the transport distance weight is λ2, and the weight is determined according to the specific transportation distance and the transportation time. For the convenience of follow-up study, in this article, λ1=λ2=0.5.Fresh goods corruption costs(5)δ4=∑k∈Krk1-ϕjk.(5)
The freshness of fresh goods (τjk) (6)τjk=∑j∈J∑k∈Kzjkϕjk∑j∈J∑k∈Kzjk.(6)
The distribution center service time (μj) (7)μj=∑i∈I∑j∈Jzijωtij∑i∈I∑j∈Jzij.ω
(
t
i
j
) is the consumer satisfaction time function. We use the satisfaction formula introduced to the literature in Yunfeng et al. [30]: (8)ωtij=1tij≤TjminTjmax-tijTjmax-TjminγTjmin<tij≤Tjmax0tij≥Tjmax.In summary, the models of e-commerce distribution center locations are as follows:(9)minδ=δ1+δ2+δ3+δ4(10)maxτjk(11)maxμj(12)s.t.∑i∈Idhi≤Uh∀h∈H(13)∑h∈Hdhi≤Niyi∑j∈Jdij≤Niyi∀i∈I(14)∑i∈Iyi≤w(15)∑i∈Izij=1∀j∈J(16)∑i∈Idij≥dj∀j∈J(17)zij≤yizhi≤yi∀i∈I∀j∈J(18)dhi≥0dij≥0(19)yi,zhi,zij∈0,1∀i∈I∀j∈J.The objective function (9) indicates that the total cost is to be minimized. The objective function (10) indicates the maximum freshness of fresh goods. The objective function (11) indicates the maximum accuracy of the distribution center service time.Constraint (12) is the supply constraint of the supplier. It ensures that the total amount of products transported from supplier h does not exceed the maximum supply capacity. Constraints (13) are the distribution center i inventory constraints, and they enforce that the storage of the total fresh product does not exceed the maximum inventory capacity. Constraint (14) represents the number of new distribution center constraints. Constraint (15) ensures that each customer has only one candidate distribution center to deliver to him or her. Constraint (16) indicates that the volume of fresh foods delivered to the customer cannot be less than the customer demand, due to possible cargo damage. Constraint (17) ensures that the selected distribution center can provide delivery. Equations (18) and (19) are constrained by decision variables.In the calculation, the multiobjective function is transformed into a single objective function by the main objective method to select the main objective function according to the enterprise’s strategic plan. If the business goal is to minimize the total cost and the freshness and the distribution center service time only need to achieve a consumer satisfaction threshold, then consumer satisfaction does not have to be maximized, but consumer satisfaction is transformed into a constraint. In this paper, the main objective function is chosen to be the minimum total cost, and the satisfaction of the consumer is set as a constraint:(20)τjk≥αjk,μj≥βj.Constraint (20) requires that the freshness of the product must reach the customer satisfaction threshold, and the satisfaction degree of the distribution center service time must meet the customer satisfaction threshold for time.In the abovementioned distribution center location model, it is assumed that the demanddj is known, and the total cost of the decision method can be obtained from the objective function (9). However, in real life, there is a great deal of uncertainty in the demand for fresh goods, so we need to use a robust optimization method to optimize the selection of locations for distribution centers.


## 3.4.2. Location Mathematical Model under Uncertain Demand

The abovementioned distribution center location model is converted into an equivalent auxiliary model by using robust optimization. The uncertainty of demand is at the core of obtaining the equivalent auxiliary model. This paper uses a series of discrete scenarios to describe the possible requirements of the customer.The specific demand of each location is unknown and is considered to vary in a closed and bounded box. This is a common description of the uncertainty method.Assuming that the demand scenario iss, where s=1,2,…,S is the probability that the demand scenario s of customer j satisfies the ellipsoid uncertainty set. The general form of the box can be specified as follows: (21)pjs∈Ω=pjs0+Qu,eTQu=0,pjs0+Qu≥0,u≤1,where pjs0 is the most probable probability distribution of demand points; Q∈Rnm×nm is the scope of the zoom; u denotes the Euclidean norm for perturbation; eTQu=0,pjs0+Qu≥0 is to ensure that the demand scenario probability pjs is a probability distribution.Assuming that the demand of each customer is independent of each other and does not interfere with each other, and the total cost of the site under the demand scenarios of customer j is δjs, the cost of a distribution center is determined as follows: (22)δij=∑s∈Sδijspjs.The total expected cost for all distribution centers is determined as follows:(23)Eδi=∑j∈Jδij=∑j∈J∑s∈Sδijspjs=∑j∈JpjTδj,δj=δj1,δj2,…,δjsT,pj=pj1,pj2,…,pjsT.The total cost of the distribution center is transformed:(24)minEδ=min∑j∈JpjTδj.The robust correspondence model of (19) is expressed as(25)minmaxpjs∈Ω⁡Eδ=minmaxpjs∈Ω⁡∑j∈JpjTδj.The above model is equivalent to(26)minϖ(27)s.t.maxpjs∈Ω∑j∈JpjTδj≤ϖ.p
j
s satisfies the demand uncertain set (21); then the left side of formula (27) is(28)maxpjs∈Ω∑j∈JpjTδj=maxpjs∈Ω⁡∑j∈Jpjs0Tδj+QuTδj=∑j∈Jpjs0Tδj+maxpjs∈ΩQuTδj.Becauseu≤1(29)maxpjs∈Ω⁡QuTδj=maxpjs∈Ω⁡QTδj.Equation (27) is converted to(30)∑j∈Jpjs0Tδj+maxpjs∈Ω⁡QTδj≤ϖ.In summary, the optimization objective of the robust optimization model ismin⁡ϖ and composed of the constraints (30) and (12) to (20). The model has good robustness, through the robust optimization of the model, which can meet the uncertain demand of the customer and ensure the economic feasibility of the location selection scheme.


## 3.5. Improved Fruit Fly Optimization Algorithm (IFOA)

After the above two-step modeling, this paper establishes a model of the distribution center of fresh goods e-commerce under uncertain demand. The next important problem is the solution of the model. The location problem in the uncertain situation is an NP-hard problem. The traditional solution method is complicated, and the required amount of is prohibitive for finding a solution. Therefore, a heuristic algorithm is used to solve the problem.FOA is suitable for solving the optimization problem with complex constraints and strong correlation between the constituent elements of the solution [31]. It is widely used in many classical optimization fields, such as efficient truss optimization [32], gasification process operation optimization [33], and analysis of service satisfaction [34]. The FOA algorithm is easy to combine with other methods, has strong robustness, and is suitable for robustly optimizing the location of distribution centers. Therefore, FOA is used to solve the problem in this paper.


### 3.5.1. Fruit Fly Optimization Algorithm (FOA)

FOA is outlined as follows.Step 1.
Initialize parameters, including the maximum number of evaluations (maxgen) and the size of fruit flies (sizepop), and initialize the position of the flies (X_axis,Y_axis).Step 2.
Randomly initialize the flight direction and distance of the individual flies, whereRandomValue is the distance in the search:(31)Xi=X_axis+RandomValue,Yi=Y_axis+RandomValue.Step 3.
The distance of each fly from the origin point and the smell concentration judgment value is defined as follows:(32)Disti=xi2+yi2,Si=1Disti.Step 4.
Based onSi, the smell concentration of flies, denoted by Smelli, is calculated as follows:(33)Smelli=functionSi.Step 5.
Find the fruit flies with the best smell concentration and allow the flies to fly to the optimal position(34)bestSmellbestindex=minSmelliSmellbest=bestSmellx_axis=Xbestindexy_axis=Ybestindex.Step 6.
Stop the search if the maximum evaluation number is reached; otherwise, repeat Steps2–5.FOA has great ability to achieve global optimization and high convergence accuracy and has great research value in the field of engineering. However, the original FOA uses a fixed search step and cannot take both global search capabilities and local search capabilities into account, thus affecting the convergence rate and search ability. Additionally, it is easy for FOA to focus on a local optimum, leading to premature convergence. This paper focuses on the shortcomings of the algorithm and improves FOA. The purpose of improving the FOA is to make it solve the location model better.


### 3.5.2. Improved Fruit Fly Optimization Algorithm (IFOA)

In this paper, an improved fruit fly optimization algorithm (IFOA) is proposed. The search step size is dynamically adjusted by introducing the weighting function. The purpose of dynamic adjustment is to divide the search into two parts. The first part contains a large search step in a large area for a global search to ensure that the algorithm considers the global optimum. The second part contains a smaller step search to ensure local search capabilities.The fruit fly individual random search expression is as follows:(35)Xi=X_axis+ψ·rand,Yi=Y_axis+ψ·rand,where ψ represents the weighted function:(36)ψ=exp⁡-Smelli-Smelli-1Smelliζ,where Smelli is the ith optimal fitness value. When the ratio change is large, it indicates that the fly group is searching for a new space and that the weighting function is conducive to a global search. When the ratio change is small, the fruit fly group has shifted to a local search, and the weight function is reduced. ζ>0 and as ζ increases, fruit fly search ability increases, which prevents the algorithms from concentrating on a local optimum. It can be adjusted according to the actual problem. In addition to the random search expression, the other IFOA algorithm step expression is consistent with FOA.


### 3.5.3. Test Function

To test and analyze the performance of the improved algorithm, the following two classic test functions were used to test FOA and IFOA, respectively. Function form, range, theoretical extremes, and peak are shown in Table1.Table 1
Test function.
Test function
Range
Optimal
Peak
m
i
n
f
1
=
-
e
x
p
-
0.5
⋅
∑
i
=
1
n
x
i
2
[
-
1,1
]
-
1
Single
m
i
n
f
2
=
s
i
n
2
∑
i
=
1
n
x
i
2
-
0.5
1
+
0.001
∑
i
=
1
n
x
i
2
2
+
0.5
[
-
100,100
]
0
MultipleThe specific initialization parameter is set tosizepop=20maxgen=100. We randomly initialize the flies’ population position. The results of the functional tests are shown in Table 2, and the optimization process is shown in Figure 2.Table 2
Mean and standard deviation of function test.
Function
Result
FOA
IFOA
f
1
(
x
)
Mean
3.0546 × 10−6
-
1
Std
7.5382 × 10−6
0
f
2
(
x
)
Mean
3.1266 × 10−6
4.67 × 10−4
Std
8.6307 × 10−8
2.328 × 10−3Figure 2
Optimization process of FOA and IFOA.From the test results in Table2 and optimization process, IFOA has stronger capabilities of global search, local search, and higher convergence accuracy than FOA. Under the same conditions, IFOA results are superior to FOA, in terms of both mean and standard deviation. Under the same convergence accuracy, the number of valid iterations of IFOA is less than that of FOA, which indicates that IFOA converges faster. Therefore, IFOA effectively improves the convergence precision and convergence speed of FOA.


## 3.5.1. Fruit Fly Optimization Algorithm (FOA)

FOA is outlined as follows.Step 1.
Initialize parameters, including the maximum number of evaluations (maxgen) and the size of fruit flies (sizepop), and initialize the position of the flies (X_axis,Y_axis).Step 2.
Randomly initialize the flight direction and distance of the individual flies, whereRandomValue is the distance in the search:(31)Xi=X_axis+RandomValue,Yi=Y_axis+RandomValue.Step 3.
The distance of each fly from the origin point and the smell concentration judgment value is defined as follows:(32)Disti=xi2+yi2,Si=1Disti.Step 4.
Based onSi, the smell concentration of flies, denoted by Smelli, is calculated as follows:(33)Smelli=functionSi.Step 5.
Find the fruit flies with the best smell concentration and allow the flies to fly to the optimal position(34)bestSmellbestindex=minSmelliSmellbest=bestSmellx_axis=Xbestindexy_axis=Ybestindex.Step 6.
Stop the search if the maximum evaluation number is reached; otherwise, repeat Steps2–5.FOA has great ability to achieve global optimization and high convergence accuracy and has great research value in the field of engineering. However, the original FOA uses a fixed search step and cannot take both global search capabilities and local search capabilities into account, thus affecting the convergence rate and search ability. Additionally, it is easy for FOA to focus on a local optimum, leading to premature convergence. This paper focuses on the shortcomings of the algorithm and improves FOA. The purpose of improving the FOA is to make it solve the location model better.


## 3.5.2. Improved Fruit Fly Optimization Algorithm (IFOA)

In this paper, an improved fruit fly optimization algorithm (IFOA) is proposed. The search step size is dynamically adjusted by introducing the weighting function. The purpose of dynamic adjustment is to divide the search into two parts. The first part contains a large search step in a large area for a global search to ensure that the algorithm considers the global optimum. The second part contains a smaller step search to ensure local search capabilities.The fruit fly individual random search expression is as follows:(35)Xi=X_axis+ψ·rand,Yi=Y_axis+ψ·rand,where ψ represents the weighted function:(36)ψ=exp⁡-Smelli-Smelli-1Smelliζ,where Smelli is the ith optimal fitness value. When the ratio change is large, it indicates that the fly group is searching for a new space and that the weighting function is conducive to a global search. When the ratio change is small, the fruit fly group has shifted to a local search, and the weight function is reduced. ζ>0 and as ζ increases, fruit fly search ability increases, which prevents the algorithms from concentrating on a local optimum. It can be adjusted according to the actual problem. In addition to the random search expression, the other IFOA algorithm step expression is consistent with FOA.


## 3.5.3. Test Function

To test and analyze the performance of the improved algorithm, the following two classic test functions were used to test FOA and IFOA, respectively. Function form, range, theoretical extremes, and peak are shown in Table1.Table 1
Test function.
Test function
Range
Optimal
Peak
m
i
n
f
1
=
-
e
x
p
-
0.5
⋅
∑
i
=
1
n
x
i
2
[
-
1,1
]
-
1
Single
m
i
n
f
2
=
s
i
n
2
∑
i
=
1
n
x
i
2
-
0.5
1
+
0.001
∑
i
=
1
n
x
i
2
2
+
0.5
[
-
100,100
]
0
MultipleThe specific initialization parameter is set tosizepop=20maxgen=100. We randomly initialize the flies’ population position. The results of the functional tests are shown in Table 2, and the optimization process is shown in Figure 2.Table 2
Mean and standard deviation of function test.
Function
Result
FOA
IFOA
f
1
(
x
)
Mean
3.0546 × 10−6
-
1
Std
7.5382 × 10−6
0
f
2
(
x
)
Mean
3.1266 × 10−6
4.67 × 10−4
Std
8.6307 × 10−8
2.328 × 10−3Figure 2
Optimization process of FOA and IFOA.From the test results in Table2 and optimization process, IFOA has stronger capabilities of global search, local search, and higher convergence accuracy than FOA. Under the same conditions, IFOA results are superior to FOA, in terms of both mean and standard deviation. Under the same convergence accuracy, the number of valid iterations of IFOA is less than that of FOA, which indicates that IFOA converges faster. Therefore, IFOA effectively improves the convergence precision and convergence speed of FOA.


## 3.6. The Calculation Process of Model

(1)
Collect the relevant data needed to establish the distribution center model (as shown in Section3.3);
(2)
Convert the distribution center model under uncertain demand to a tractable equivalent model by using robust optimization.
(3)
IFOA is used to solve the mathematical model:
(1)
Set the initial parameters, including the maximum number of evaluations (maxgen) and the size of the fruit flies (sizepop), and the initial position of the flies (X_axis,Y_axis).
(2)
Randomly setting the flight direction and distance of the individual flies, the fruit fly individual random search expression is as follows:(37)Xi=X_axis+ψ·rand,Yi=Y_axis+ψ·rand.
(3)
According to the fitness function formula, the individual fruit fly is calculated to find the position and optimal value of the individual and the global optimal individual.
(4)
Find the fruit flies with the best smell concentration and allow the flies to fly to the optimal position.
(5)
Stop the search if the maximum evaluation number is reached; otherwise, repeat.
(6)
According to the IFOA optimal location results, then find the corresponding best location of the distribution center and the optimal distribution path.


## 4. Computational Results

Experiments are proposed in this part to prove the effectiveness and feasibility of the location model. Both deterministic and uncertain demand scenarios are considered, and then a comparison and analysis of the results of the two situations is provided. The numerical calculation problem is considered to occur in a developed city where a fresh goods e-commerce firm chooses to rent a certain number of distribution centers within an appropriate area. The area of suppliers is 3 and the area of customers is 10. The firm chooses to rent 3 locations from a set of 8 candidate distribution centers.The distance between the supplier and the candidate distribution center and the distance between the candidate distribution center and the demand point are obtained by using the Euclidean theorem. The details are shown in Tables3 and 4. The tables consider the different qualities of each candidate distribution center, such as the location, transportation, economy, and other conditions. Fixed costs, operating costs, and the largest inventory are also different, as shown in Table 5. The maximum supply capacity of supplier h is shown in Table 6.Table 3
Distance between supplierh and distribution center i (km).
I
1
I
2
I
3
I
4
I
5
I
6
I
7
I
8
H
1
143.1
29.12
199.45
120.93
77.38
88.14
32.14
79.83
H
2
73.82
94.24
118.86
47.12
45.00
12.04
65.27
109.65
H
3
132.23
110.25
105.94
35.44
91.26
63.95
75.80
63.24Table 4
Distance between distribution centeri and customer j (km).
I
1
I
2
I
3
I
4
I
5
I
6
I
7
I
8
J
1
142.00
41.34
245.50
167.17
89.19
117.33
75.60
144.36
J
2
54.20
96.42
205.35
142.20
59.03
86.28
100.72
180.71
J
3
116.10
11.70
195.64
116.82
51.78
71.56
24.69
102.01
J
4
65.25
183.98
137.61
124.19
121.80
111.23
164.97
214.24
J
5
48.27
77.16
172.79
105.36
22.82
48.50
70.00
145.79
J
6
99.04
159.32
62.96
48.10
107.20
76.94
128.57
146.73
J
7
226.49
135.09
203.41
146.70
165.89
156.31
120.35
48.87
J
8
107.18
33.83
173.10
94.20
41.61
52.15
7.21
89.05
J
9
128.79
194.74
39.81
75.06
143.22
112.87
163.19
171.14
J
10
152.77
145.86
79.10
39.84
122.48
91.66
111.40
82.38Table 5
Fixed costs, operating costs, and maximum inventory.
Candidate distribution centers
I
1
I
2
I
3
I
4
I
5
I
6
I
7
I
8
Fixed costs (million)
1.45
1.38
1.23
1.48
1.29
1.23
1.38
1.36
Operating costs (million)
0.07
0.06
0.06
0.09
0.05
0.06
0.07
0.06
Maximum inventory/t
1000
900
700
1100
1000
900
1200
800Table 6
The maximum supply capacity of supplier.
Supplier
H
1
H
2
H
3
The maximum supply capacity/t
8800
7900
6300The average traveling speed is 45 km/h for the distribution vehicles in the region, the average unit freight from the supplier to the distribution center is 1.5 yuan/(t·km), and the freight rate from the distribution center to the demand point is 1.8 yuan/(t·km). To simplify the follow-up calculation, the numerical calculations only consider the distribution of two fresh goods using the corruption coefficients of 0.15 and 0.08 and the unit prices of 4 yuan/kg and 6 yuan/kg. The average satisfaction threshold for customer satisfaction is 0.75, and the average satisfaction threshold for freshness is 0.7. If the delivery vehicle arrives late, the compensation fee is 50 yuan/(h·t). The demand point time window is shown in Table7.Table 7
Time window and determined demand of customer.
Customer
(Tjmin,Tj,Tjmax)
Demand (t)
J
1
(
2
,
2.5
,
3
)
200
J
2
(
3
,
4
,
5
)
400
J
3
(
1
,
1.5
,
2
)
350
J
4
(
1
,
2
,
2.5
)
250
J
5
(
2
,
3
,
4
)
150
J
6
(
3
,
3.5
,
4
)
350
J
7
(
1.5
,
2.5
,
3
)
300
J
8
(
2
,
3
,
4.5
)
180
J
9
(
1.5
,
2.5
,
3
)
350
J
10
(
3
,
4
,
5
)
300We consider cases where demand is both deterministic and uncertain. The calculation and comparative analysis of two cases can be conducted more directly to verify whether the model can help the fresh goods e-commerce to suppress the uncertainty interference by demand. The method used to predict the consumer demand is the multivariate autoregressive integrated moving average (AMIMA) model in this paper. Fresh e-commerce is characterized by consumers ordering through the Internet, so fresh e-commerce companies can collect customer information and order information (e.g., customers’ purchasing frequency, purchasing preferences, and position distribution). Then, the fresh e-commerce company can use this information to classify consumers and predict consumer demand. The autoregressive part of the multiple ARIMA model represents a linear combination of past values, while the moving average part of the multiple ARIMA model is a linear combination of past forecasting errors. The advantage of the multiple ARIMA model is that it improves prediction accuracy, facilitates statistics, and reduces the cost of prediction. Moreover, it can combine product cost changes with demand uncertainty to predict consumer demand [35]. In view of this, the multivariate ARIMA model is suitable to predict the consumer demand for fresh e-commerce. Although the AMIMA model can more accurately predict the uncertainty of demand, the size of fresh e-commerce’s consumers is small and widely distributed, so there is still uncertainty in demand. To learn more about the multivariate ARIMA model, studies [35, 36] are suggested. The deterministic demand for each customer is shown in Table 7.The affected factors of uncertain supply involve environmental factors (e.g., the natural environment, economic environment, and political environment) and the abilities of suppliers (e.g., production capacity, equipment capacity) [37]. First, the planting period for fresh foods is the quarter or year as a unit; the period is longer than for other products. Fresh e-commerce can be investigated in advance through the Internet, and then the product cultivation of the fresh food and the field investigation can be planned accordingly. Second, the suppliers of fresh electricity providers are typically farmers and fresh food bases around the region. These suppliers are less affected by global economic changes and political changes. The selection diversity of suppliers also allows fresh e-commerce companies to evaluate and select suppliers in advance. In addition, the equipment failure problem has less of an effect on fresh e-commerce because fresh products can be delivered to the distribution center though simple pretreatment packaging. In summary, the supply of fresh e-commerce is uncertain, but fresh e-commerce companies are less affected by these uncertain factors due to the special nature of fresh foods. The current delivery mode of fresh products is from a mono type and large batch distribution to a multitype delivery mode and small batch distribution. Each time an order is made, the consumer evaluates the fresh electricity service (e.g., Amazon Fresh and Motion Optimization). For the majority of instances, the perishable nature of a product results in the supply process having a lower variability than the demand process [38]. Therefore, this paper focuses on the location model for distribution centers under uncertain demand.For the case of uncertainty, we assume that the demand for each demand point iss=5. The number of scenarios for each demand point can be different from each other. The value of the demand scenario is determined by the survey, and then the five cases are generated randomly by Matlab 8.3 as the demand scenario of the demand point j. The demand scenario of the 10 demand points can be obtained by repeating the process ten times.The discrete demand probability distribution ispjs0,J=j∣j=1,2,…,n.Forpjs0, in the range (0,1), the simulations are randomly generated between the 10 numbers, normalized, and repeated ten times in order to get all the demand points in the uncertain demand scenario. The probability demand scenario of customer j (pjs) meets the uncertainty set. Let the decentralized matrix be Q=aI, where a is a nonnegative parameter and I is an identity matrix.In the experiment, leta=0.5 and a=0.8, respectively. Calculate pjs.The specific initialization parameter is set tomaxgen=100sizepop=20. The program is implemented in Matlab 8.3 and run on a computer with 2.6 GHz Intel i5-4210M CPU, 4 GB of RAM, and Windows 10. The distribution center decision-making program and the total cost are shown in Table 8.Table 8
The decision-making program and the total cost of distribution center.
The value ofa
Decision-making program and distribution range
Cost (RMB)
a
=
0
I
2: J1J3J7
7208563.14
I
5: J2J5J8
I
6: J4J6J9J10
a
=
0.1
I
2: J1J3J7
7215050.85
I
5: J2J5J8
I
6: J4J6J9J10
a
=
0.2
I
2: J1J3J7
7218655.13
I
5: J2J5J8
I
6: J4J6J9J10
a
=
0.3
I
2: J1J3J7
7228026.26
I
5: J2J5J8
I
6: J4J6J9J10
a
=
0.4
I
2: J1J3J7
7232351.40
I
5: J2J5J8
I
6: J4J6J9J10
a
=
0.5
I
2: J1J3J7
7259452.74
I
5: J2J4J5J8
I
6: J6J9J10
a
=
0.6
I
2: J1J3J7
7275602.78
I
5: J2J4J5J8
I
6: J6J9J10
a
=
0.7
I
2: J1J3J7
7294345.04
I
5: J2J4J5J8
I
6: J6J9J10
a
=
0.8
I
5: J2J5
7327583.63
I
6: J4J6J9J10
I
7: J1J3J7J8
a
=
0.9
I
5: J2J5
7334712.99
I
6: J4J6J9J10
I
7: J1J3J7J8
a
=
1
I
5: J2J5
7346246.70
I
6: J4J6J9J10
I
7: J1J3J7J8For the deterministic demand situation, the optimal decision is to choose distribution centerI2I5I6 from the candidate list. The total cost is 7.208 million. For the uncertain demand situation, when a=0.1 to a=0.4, the optimal decision is to choose distribution centers I2I5I6. The distribution range is constant, but the cost increases. When a=0.5 to a=0.7, the optimal decision is to choose distribution centers I2I5I6, but the distribution range is different from the deterministic demand situation. When a=0.8 to a=1, the optimal decision is to choose distribution centers I5I6I7. The increase ratio of the total cost in the case of uncertainty is compared to the total cost in the demand determination, as shown in Figure 3. Enterprises in the decision-making before the consumer demand should be the historical data for statistical and analysis, determine the variation range of parameter a, and make decisions based on cost and self-conditions (Figure 3).Figure 3
The increase ratio of the total cost of uncertain demand.Then using FOA to solve the model and initial parameters and operating environment equally with IFOA, the results are shown in Table9, the difference value of IFOA and FOA is shown in Figure 4, and the optimization process of FOA and IFOA is shown in Figure 5 (select a=0.5).Table 9
The results of FOA and IFOA.
The value ofa
IFOA optimal
FOA optimal
a
=
0
7208563.14
7208743.32
a
=
0.1
7215050.85
7215153.26
a
=
0.2
7218655.13
7218811.76
a
=
0.3
7228026.26
7228556.2
a
=
0.4
7232351.40
7233098.77
a
=
0.5
7259452.74
7260056.91
a
=
0.6
7275602.78
7276133.54
a
=
0.7
7294345.04
7294954.12
a
=
0.8
7327583.63
7328271.22
a
=
0.9
7334712.99
7335498.37
a
=
1
7346246.70
7347143.68Figure 4
The difference value of IFOA and FOA.Figure 5
Optimization process of FOA and IFOA (a=0.5).From the test results in Table9 and Figures 4 and 5, under the same conditions, IFOA results are superior to FOA, the convergence accuracy is more accurate, and the optimal results are better. Under the same convergence accuracy, the number of valid iterations of IFOA is less than that of FOA, which indicates that IFOA converges faster. Therefore, IFOA effectively improves the convergence precision and convergence speed of FOA. The applicability of IFOA is more extensive.


## 5. Conclusions

The location of distribution centers is a complex optimization problem. To solve the problem of unreasonable network layout and poor interpretation of customer demand and high cost of distribution, this paper optimizes the location of distribution centers, minimizes the total cost of distribution, and establishes a fast and secure distribution center network system. The conclusions of this paper are summarized as follows.In this paper, a distribution center model is established to reduce the total cost of the enterprise. The model is combined with the inherent characteristics of fresh goods e-commerce, taking into account the principles of distribution center selection, service levels, and freshness constraints. Due to the increase in the number of fresh goods e-commerce enterprises with more intense competition, consumer demand is more and more uncertain. Robust optimization is used to optimize the distribution center model, which makes the model more robust.An improved fruit fly optimization algorithm (IFOA) is proposed in this paper. The search step size is dynamically adjusted by introducing a weighting function. IFOA will serve to solve the established model. However, the applicability of IFOA is more general. In this paper, we validate the uncertain demand model by using an example, and we prove that the model of distribution centers is valid and can effectively handle the uncertainty of demand.This paper considers the influence of uncertain demand on the location of distribution centers for fresh goods. It enriches the fresh goods e-commerce distribution center model and provides a theoretical basis for a scientific method of selecting the locations of fresh e-commerce distribution centers. The applicability of the proposed model is meaningful and useful for the selection of fresh e-commerce distribution center locations. The shortcomings of this paper is that it only considers the uncertainty of customer demand and does not take into account other factors of uncertainty, such as uncertain delivery weather conditions and uncertain corruption rate.It is worth noting that some aspects of the model need to be improved. For example, we will pay more attention to a variety of uncertain factors so that the model is more suitable for more complex situations. Because the distribution center will be related to the distribution of fresh products, coupled with the international awareness of environmental protection strengthened gradually, the future will take into account the impacts of low-carbon environmental aspects of the distribution center location model.



---

*Source: 3423562-2017-10-19.xml*