Abstract
Aiming at the high cost of multicategory orders fulfillment under multiwarehouse collaborative distribution, comprehensively considering the fulfillment costs of different orders fulfillment strategies, an order fulfillment strategy selection model is proposed. The first step of the model uses the linear programming algorithm to solve the cost of suborder merge transportation after the order is split. The second step calculates the cost of the current “greedy algorithm” of the e-commerce platform for order split fulfillment. Then, the cost of each strategy is compared and the lowest cost one is chosen. The calculation example analysis shows that the order fulfillment strategy is closely related to the delivery location of the order and the SKU category. When the delivery location is far away and SKU categories are many in the order, the merged transportation strategy of suborders after the order is split will be significantly better than the cost of separate transportation. The multiwarehouse collaborative distribution fulfillment strategy proposed in this paper can provide a decision basis for the e-commerce platform to choose which fulfillment method.
1. Introduction
With the rapid development of the Internet, more and more people are enjoying the convenience brought by the Internet. According to the data of the “China Internet Development Report 2019,” the number of Internet users in China has reached 829 million, and the amount of e-commerce transactions has reached 3.163 billion [1]. The B2C online sales model has occupied the leading position in the online retail industry. People’s shopping methods have also changed from traditional offline physical store shopping to online shopping. According to data, the utilization rate of online shopping by netizens has reached as high as 73.6%. Therefore, more and more orders are transacted online every day. While bringing convenience, it also brings huge challenges to e-commerce platforms. The categories included in the order may not be one. When there are multiple categories of goods, the order may be any combination of thousands of Stock Keeping Units (SKUs). And the order may be from a certain warehouse, or multiple keeping units. When one or more SKUs in the order are short of stock, the defective SKUs will be allocated to other warehouses. Then, the order will be split into multiple suborders.
Different-order splitting methods may affect logistics costs. Studying the method of order splitting and fulfillment, the best warehouse is found to provide SKUs, which can effectively reduce the fulfillment cost. However, the method of order split fulfillment may split the order into multiple suborders and multiple packages in the transportation link, resulting in high-order fulfillment costs. After the order split, the packages are combined for transportation, and the split order can be transported only once, which can effectively reduce the transportation cost. This method also incurs transfer costs when transshipping between warehouses and warehouses, and the sum of transportation costs may be higher than the cost of order split fulfillment. Therefore, it is particularly important to study the strategy of order fulfillment and choose one with the lowest fulfillment cost.
Thus, order splitting will affect the cost of order fulfillment directly. At present, many large e-commerce platforms adopt the “greedy rule” for order splitting. The rule is that the nearest warehouse will first fulfill the SKUs in the order. If SKUs in the order cannot be fulfilled entirely, the unfulfilled part will be allocated to the next closest warehouse, until SKUs are fully fulfilled. This splitting method can split the order quickly, and the distribution distance is also considered. However, this splitting method may make some warehouses which can fulfill all the orders at one time face the result that the orders will be split, resulting in the increase of fulfillment costs. Therefore, studying the collaborative distribution between multiple warehouses and finding a suitable fulfillment strategy can reduce order fulfillment costs and improve customer’s satisfaction.
2. Literature Review
At first, e-commerce occupied a small market share with a small number of orders, so little attention was paid to the economy brought by order splitting. Scholars have done more research on order allocation. Song et al. took the warehouse management system of B2C e-commerce retail business as his research object. Based on the existing research, they introduced the current situation and development trend of the warehouse management system and discussed the importance of the warehouse management system in the commercial industry [2]. Liu et al. pointed out in their research that there is a lack of research on the behavior of suppliers in the process of task assignment of certain logistics service supply chain and constructed the subjective utility function of task assignment of suppliers within two cycles [3]. Cheng and Wei discussed the model of e-commerce logistics allocation in their study. Under the premise of lowest cost, the optimal order allocation combination can be quickly obtained by this model [4]. Han et al. made production and distribution decisions taking into account stochastic demand in multiple categories and when orders were allowed to be split in their study [5].
Subsequently, with the rapid development of e-commerce, the order quantity is increasing. Studies have shown that about 31% of all-channel retailers’ profitability has been affected by order splitting. The cost increase caused by order splitting becomes more and more obvious. Therefore, it is very important to study the rationality of order splitting and its economy. Zhang et al. set the minimum logistics transportation cost as the goal in their research on order distribution after order split of “one place, multiwarehouse” large online supermarket. They considered the relationship and constraints between variables such as distribution, transportation, and so on and constructed a mathematical model to solve the problem. However, this paper does not take into account the problem of transverse transshipment between cities and the strategy of merging orders after proper order split [6]. Fu et al. proposed that not only the packaging cost, order transshipment cost, order transportation cost, and other factors need to be considered but also the time cost increase caused by order splitting need to be considered [7]. Under the background of integration of warehousing and distribution and considering the follow-up logistics and distribution links, Qin and Wu combined the bill-breaking and transportation to optimize, effectively reducing the marginal cost of the two parts [8]. Zhao studied the order fulfillment strategy of reorganization after order splitting. With the goal of optimizing the cost of order fulfillment, they established a mathematical model and solved it [9]. Zhang took the two principles of “minimum split quantity of SKUs” and “customer’s satisfaction first” as the rule of order removal in their research, which broke the thought of fixed distribution scope of warehouse [10]. With the goal of minimizing the total cost of distribution, Xin et al. built an O2O store distribution optimization model based on order splitting [11]. Xu et al. proposed reflecting order fulfillment efficiency through picking cost, split delivery cost, distribution cost, and time penalty cost [12].
Torabi et al. studied order fulfillment and transshipment under e-commerce platform. The paper pointed out that when the nearest fulfillment center is unable to meet the order requirements, it is necessary to transfer SKUs or customer’s orders from nearby factories to provide ideas for this study on the transshipment of SKUs in warehouse [13]. Jasin et al. in their study pointed out that an important challenge for e-commerce platforms is to develop fulfillment strategies and select the right facilities to fulfill orders to reduce total transportation costs [14]. In terms of supplier selection, Gang et al. proposed to allocate orders with three goals: total purchase cost minimization, total delay risk minimization, and total defect risk minimization [15]. Park et al. described a two-stage decision-making approach that first identifies the appropriate supplier distribution area and then determines the best supplier with economic and environmental factors [16]. With the progress of product manufacturing and processing, continuous production has become one of the concerns of manufacturers, and the demand for continuous production is also taken into account in the selection of upstream supply chains. Amin-Tahmasbi and Alfi studied how to select the right suppliers and allocate orders in the green supply chain to achieve the overall optimal effect of the supply chain [17]. The issue of order fulfillment was studied by Li et al., which integrates the order allocation method and order transportation decision of online retailers. Aiming at the lowest transportation cost, a hybrid integer programming model formula was designed to solve the problem of how online retailers can fulfill all SKUs in customer’s orders in the best way [18]. Ishfaq and Raju proposed that retailers can use their stores as a strategy for order fulfillment [19]. Zhang et al. also mentioned in another article on order splitting and package merging that multiple suborders for order splitting can be packaged into the same package by package merging, taking into account commodity order conflicts [20]. Li et al. studied the order fulfillment problems of online retailers and proved through experiments that product overlap between different warehouses will affect the operating costs of e-commerce companies [18]. Sun et al. proposed order allocation and delivery path optimization as the common consideration when studying the order allocation and unilateral soft time window constrained delivery route delivery problem [21].
The appeal document studied the fulfillment process of order allocation and order splitting and considered the impact of different order splitting methods and order allocation methods on fulfillment costs. However, most studies have not considered that the package merged scheme after order splitting, which can effectively reduce transportation costs. Some studies have considered suborder merged transportation, but the location of order merged warehouse is relatively fixed, or geographic location factors have not been taken into account to increase the cost of order merged transportation. Therefore, this article studies the multiwarehouse collaborative distribution strategy, comprehensively considers the transportation cost to choose the order fulfillment strategy, and flexibly chooses the warehouse for the suborder package merged instead of the fixed-order package merge warehouse, which can make the way of order fulfillment more flexible and effectively reduce the cost of order fulfillment.
3. Problem Description and Assumptions
3.1. Description of the Problem of Order Splitting Method Selection
The order fulfillment diagram is shown in Figure 1. The order split fulfillment strategy is to deliver the split orders to multiple warehouses for fulfillment, and then each warehouse sends packages to costumer. The package merging strategy after the order split is to deliver the split orders to multiple warehouses for fulfillment then transship the split orders to the merged warehouses, and then the merged warehouses send express delivery to customer.

(a)

(b)
An e-commerce platform has several orders within a period of time. According to the type of SKUs contained in the order, the SKUs can be divided into three cases. The first case is that the categories of SKUs included in the order is one; then according to the “greedy algorithm,” the warehouse closest to the distribution station can be found to fulfill the order without splitting the order. The second case is that the order contains two or more categories of SKUs. According to the “greedy algorithm” rules of large e-commerce platforms, it can be found that one warehouse can fulfill all of the SKUs without order splitting. The last case is that the order also contains many categories of SKUs. According to the “greedy algorithm” split rule, orders will be distributed to multiple warehouses for fulfillment. Each suborder will be transported by a separate package, and each package will be transported to the customer independently, which will increase the total cost of fulfilling the orders. This paper mainly focuses on the last case, when the order needs to be split, to study the multiwarehouse collaborative distribution strategy.
Based on the above questions and analyses, the following assumptions are made for the convenience of the study:(i)In a large city, there are several warehouses of the same level, the same SKU quality among warehouses is the same, and they all have the ability to package and merge.(ii)The location of the warehouse is known, and the delivery station is known after the customer places the order.(iii)Each item has the same weight and volume and does not exceed the maximum capacity of the package.(iv)Logistics distribution uses the transportation mode of “warehouse to distribution station, distribution station to customer.” The transportation cost only needs to consider the distribution cost from warehouse to distribution station.(v)The fixed cost of the vehicle does not change.
3.2. Notations and Decision Variables
The notations for variables mean the following: : minimal order fulfillment cost : warehouse collection, k ∈ (1, …, K), where k represents a specific warehouse : order set, s ∈ (1, … S), where s represents the SKU in the order : order package merge fulfillment cost : cost of order split fulfillment : total number of SKUs in the order : unit path cost : fixed cost of dispatch vehicles : number of SKUs in the order : SKU’s warehouse hold : the maximum weight a package can carry : the maximum volume a package can hold : the weight of each SKU : the volume of each SKU : the distance from warehouse j to distribution station k during order transportation : cost of transshipment from warehouse j to warehouse k when order is transshipped A: a collection of all transit routes B: a collection of all transportation routes = = = =
4. Mathematical Model
In order to select the fulfillment method with the lowest cost, it is necessary to calculate the cost of the two fulfillment strategies. Therefore, the objective function of the mathematical model should calculate the costs of two fulfillment strategy of the order and select the one with the lowest cost. When considering the constraints, it is emphasized that each order can only be fulfilled once. And when the orders are combined, the quantity of SKUs to be transshipped should be equal to the quantity transported out. The mathematical model is as follows:
Equation (1) is the objective function, which means that the fulfillment strategy with the lowest cost one is selected. Equation (2) calculates the fulfillment cost when the package is not merged after the order split. represents the variable cost when transportation occurs. And represents the fixed cost of transportation. If = 1, it means that this part of the distribution cost will be incurred from warehouse j to distribution station k. The sum of the two costs is the transportation cost from the warehouse to the distribution station. Equation (3) calculates the fulfillment cost of the package merge after the order is split. represents the transportation cost from the warehouse to the distribution station, and represents the transshipment cost between the warehouses. If = 1, there will be a transshipment cost from warehouse j to warehouse k. The minimum of the sum of the two costs represents the smallest total cost of package merged transportation after the order split. Constraint (4) means that each SKU is only fulfilled once to avoid repeated picking in different warehouses, resulting in the actual picking quantity of SKUs greater than the number of SKUs in the order. represents the quantity of each suborder in all packages; if the value of constraint (4) is equal to 1, it means that all the SKUs in the suborders can only be fulfilled once. Commodities need to be transported from the warehouse that provides the SKUs to the combined warehouse for packaging. Constraint (5) indicates that there is a transshipment between the warehouse and the warehouse (the SKUs provided by the combined packaging warehouse are also regarded as transfer), and the transfer can only be done once and must be once. Constraint (6) indicates that in the case of constraint (5), where the SKUs are provided by the merged warehouse, the transshipment cost is 0. Constraint (7) means that the number of transshipment packages is the same as the number of transport packages, and the quantity is π. To avoid the situation of SKUs being stranded in the merged warehouse and to ensure that all SKUs in the order are fulfilled, the first half of the equation calculates the sum of all transshipped decisions (including the situation where SKUs provided by merged warehouse), and the second half of the equation calculates the total number of all suborders in all packages, so this equation can guarantee that all the SKUs in the order can be fulfilled. Constraint (8) means that when the order is allocated to warehouse k, it is necessary to ensure that the remaining inventory of this warehouse is greater than the required quantity of SKUs. Constraint (9) means that the total weight of the suborder package is less than the maximum weight that the package can load. The first half of the equation is the total weight of the suborder, and the second half is the weight limit of the used package. Constraint (10) means that the total volume of the package of the suborder is less than the maximum volume that the package can load. Constraint (11) means that the transfer decision variable is 0 or 1. If it is 1, it means that the SKU in the suborder is transferred from warehouse j to warehouse k. If it is 0, it means that there is no transfer process. Constraint (12) represents the values of 0 or 1 for the decision variables of vehicle start, and 1 means that there is a vehicle dispatched from warehouse j to distribution station k.
5. Algorithm Design
5.1. Algorithm Flowchart
According to the algorithm model, the algorithm is designed for the order fulfillment strategy selection problem (as shown in Figure 2). Step 1. Set the number of warehouses, the remaining inventory information of the warehouse, limit the maximum purchase amount of a single SKU in the order, the unit path cost per kilometer of the transportation vehicle, the fixed cost of the vehicle consumption when the vehicle is dispatched, and the maximum weight limit that can be shipped by the transport package, the limitation of the maximum volume of the package that can be shipped. Step 2. Enter the SKU category and SKU quantity placed by the customer. Step 3. Compare the entered quantity of each SKU with the remaining inventory of each warehouse. If all SKU types and quantities are fulfilled by one or more warehouses, proceed to the next step to calculate the transportation cost. But if all the remaining stocks in the warehouse are insufficient, it will prompt that the item is out of stock; then return to Step 2 to place order again. Step 4. Using linear programming algorithm, respectively, calculate the transfer cost z of all the SKUs in the order from different supply warehouses to warehouses k1, k2, …, kn, and then calculate the transportation cost Z from the combined warehouse to the distribution station. Then, the sum of the transshipment cost z1, z2, …, zn and the transportation cost Z1, Z2, …, Zn corresponding to each warehouse gets the cost C1, C2, …, Cn of order fulfillment for each warehouse. Step 5. Select the merged warehouse k with the smallest fulfillment cost and the fulfillment warehouse that provides the SKUs and use this cost as merged fulfillment cost. Step 6. According to the “greedy rule” algorithm, calculate the fulfillment cost of split fulfillment strategy cost. Step 7. Compare the total cost of two fulfillment strategy and select the lowest cost one as the final fulfillment strategy.

6. Example Analysis
6.1. Instance Description
Suppose there are 5 large warehouses in a certain place, and there is a certain intersection of SKUs between warehouses and warehouses. There are 20 distribution stations in this place, which are distributed in different places. Then, set the unit path cost to 2 yuan per kilometer, the fixed cost of departure to 150 yuan, and the inventory quantity is randomly generated.
The limited delivery service range is a rectangular area with a side length of 100 km, and the coordinate information of the warehouse and the coordinate information of the delivery station are randomly generated, as shown in Tables 1 and 2.
6.2. Parameter Settings
The parameters and parameter values needed in this article are shown in Table 3.
6.3. Example Solution
In order to study the cost of distribution, it is necessary to know the number of product orders purchased by the customer in the e-commerce and the geographic location of the customer. Because in reality, customer’s orders on the e-commerce platform are according to their own needs, and the needs of each customer are inconsistent, so this cannot be accurately estimated. The geographical location of the customer cannot be estimated before placing an order. Therefore, the customer’s order and location are randomly generated according to the parameter conditions. The generated order information is the data in Table 4.
When setting up warehouse inventory, in order for the order split to occur more frequently and the simulation is more meaningful, the quantity of inventory is set to a lower inventory level. The inventory of each warehouse is shown in Table 5.
After the customer places an order, the e-commerce platform can obtain the order delivery address, which can be expressed as a point in the coordinates [74.6, 89.8], as shown in Figure 3. According to the customer’s location, a distribution station needs to be allocated to deliver the SKUs to the customer. The “European Distance” between the customer’s location and distribution station is calculated; the nearest distribution station for delivery is selected. Finally, the distribution station 18 to deliver customer’s order is selected.

6.3.1. Order Fulfillment Results under Different Algorithms
(1) Order Fulfillment Result under Greedy Algorithm. The order is delivered by the delivery station 18, and the distance between the delivery station 18 and the five warehouses is judged. Sorting by distance can get k5 < k2 < k4 < k1 < k3. First, the SKUs that the warehouse k5 can fulfill are judged. SKU 3, SKU 16, and SKU 43 are in stock in warehouse k5, so it can fulfill SKU 3, SKU 16, and SKU 43. Then, the SKUs that can be fulfilled by warehouse k2 are determined. k2 has SKU 16, SKU 43, and SKU 97 inventory, but SKU 3 and SKU 43 have been fulfilled by warehouse k5. According to the principle that one SKU in the order can only be fulfilled once, k2 can only fulfill SKU 97. In the same way, it can be concluded that warehouse k1 can fulfill SKU 61. All SKUs in the order are fulfilled by warehouse k5, warehouse k3, and warehouse k1. After knowing the warehouse providing the SKUs, the set parameters are brought into the calculation formula of transportation cost. It can be concluded that the fulfillment cost of order splitting is 4.01 yuan.
(2) Order Fulfillment Result under Suborder Merge. When selecting fulfillment warehouse, it is different from the “greedy algorithm” fulfillment strategy. The strategy of package merging after the order split does not need to determine the distance from the distribution station to the warehouse. All of fulfillment warehouses have the same priority. However, when choosing to provide SKUs warehouse, it is necessary to determine the fulfillment and consolidation warehouses based on the minimum transportation cost. The transportation cost includes two parts: the transshipment cost between the warehouse and the warehouse and the transportation cost from the warehouse to the distribution station. In the calculation, the nonstandard assignment problem is used to solve the problem. Each SKU can only be assigned to one warehouse for fulfillment, but one warehouse can fulfill multiple SKUs. The cost of transferring to different merged warehouse is inconsistent with the cost of distribution from the warehouse to the distribution station, so the total transportation cost of each warehouse needs to be calculated separately. Firstly, the minimum cost of transshipment to warehouse k = 1 consolidation is calculated. Then, the cost of transport from merged warehouse 1 to distribution station 18 is calculated. Summarizing the two parts yields the cost of fulfillment for merging orders at warehouse 1. This problem can be solved by using the 0-1 programming of operations research, and its objective function is equation (13), and the constraint is equation (14):
According to the transshipment distance between the warehouse and the warehouse, the transshipment cost between the warehouses can be calculated. represents the transshipment cost from warehouse j to warehouse 1. As there may be no inventory of the SKU in the order in warehouse j, this SKU cannot be transshipped. So, the value is set as a very large number. Because the transshipment cost is required to be minimal, when the transshipment cost is set to a very large number, the decision variable xj1n for the warehouse j without inventory is 0. According to this processing method, the final transshipment cost matrix can be obtained, as shown in Table 6. xsjk represents the decision variable (detailed description in constraint (11)). Constraints indicate that each SKU can only be transshipped once. In addition, the SKU is fulfilled and can only be fulfilled once.
Then, the transshipment cost between warehouses and the transportation cost are brought into equation (13); then this 0-1 integer programming is solved. Each order to be fulfilled by only one warehouse as a constraint is set, and the value range of the decision variable is set from 0 to 1. Finally, it can be calculated that the sum of the minimum transportation cost of warehouse 1 is 1.76 yuan. In the same way, the transfer cost matrix of each warehouse is brought into the objective function constraint, and the minimum cost of the combined fulfillment of warehouse 1 to warehouse 5 can be calculated. The transportation cost is shown in Table 7. Comparing the combined fulfillment costs of the five warehouses, the warehouse 1 with the lowest cost is finally selected as the package consolidation and packaging warehouse. The total transportation cost is 1.76 yuan.
6.3.2. Simulation Results
For convenience, suppose that the SKUs in the order need to be fulfilled by two fixed warehouses, and the unit path cost and fixed cost of transshipment and transportation are the same. Then, the customer’s order position is changed. The location of the distribution station and order information are brought into the appeal algorithm for calculation. The cost of package merging after order splitting and the cost of order splitting by “greedy algorithm” can be calculated, as shown in Table 8.
When the order category and order fulfillment warehouse are the same, the order delivery location is different. From the data in the table, it can be seen that the cost of order fulfillment will change accordingly, and the order fulfillment strategy will be different. For example, in distribution station 1, when the customer is relatively close to the two warehouses, the cost of split fulfillment is better, and the strategy is also selected as split. The reason is that the distance between the two warehouses is greater than the distance between any warehouse and the customer. For the other example, distribution station 5, when customers are relatively far away from the two warehouses, the total distance between the two fulfillment methods is relatively large. However, when comparing the distance between the two delivery methods horizontally, it can be seen that the merged fulfillment strategy can greatly reduce the delivery cost, and the total transportation cost is reduced by 30%. It can be seen that when the distance to the warehouse is close, the cost of split fulfillment may be better than the cost of merged fulfillment. However, as the distance gradually increases, the cost of combined fulfillment becomes more and more superior to the cost of split fulfillment, and the fulfillment strategy should also choose the t least fulfillment cost one.
The locations of warehouses, distribution stations, and customers are fixed; then the impact of multiple categories on fulfillment costs by changing the number of SKUs is studied. Then, randomly 6 groups of orders are generated; each group of orders contains different orders for 5 delivery locations, all orders in each group of orders contain the same number of SKUs, and the number of SKUs is increased from 1 to 6. The total distribution cost of two different fulfillment strategies for 6 groups of orders is calculated by the appeal algorithm, and the results are shown in Table 9.
The number of SKUs contained in the order from 1 to 6 increases and a comparison chart of split fulfillment and merged fulfillment costs is drawn, as shown in Figure 4. When the SKU category in the order is 1, there is no significant difference in the cost of the two order fulfillment strategies. However, as the SKU in the order increases, the fulfillment cost of both strategies is increased. But the order split fulfillment has grown at a faster rate, and merged fulfillment costs have increased relatively slowly. And when the order contains a large number of types of SKUs, the cost of the two fulfillment strategies is quite different, and the cost of merged fulfillment is significantly lower.

7. Conclusion
This paper studies the order fulfillment strategy under multiwarehouse collaborative delivery. The existing research on order fulfillment can be roughly divided into two categories: the research on split fulfillment algorithms and the research on merged fulfillment. But the two fulfillment strategies have their advantages. They have different applicability under different commodity categories and transportation distances. The article takes the lowest total transportation cost as the goal and chooses the most suitable order fulfillment strategy. The simulation results show that the order fulfillment strategy of merged fulfillment after order splitting is obviously better than the order splitting rule of “greedy algorithm” in current e-commerce platform. Particularly when the order contains more SKUs categories, the merged fulfillment strategy cost will be significantly better than the split fulfillment cost. However, when the order distribution location is closer to the location of the supply warehouse, the order split fulfillment strategy transportation cost will be lower than the merged fulfillment cost. The order fulfillment strategy with the lowest cost is selected according to the delivery location and SKUs categories in the order. Managers can define the boundaries of a distribution area and SKU category based on actual conditions. If it exceeds this area and exceeds the number of defined order categories, the strategy of merged fulfillment after order splitting is used. On the contrary, it uses the fulfillment strategy that the suborders are not merged after order splitting.
Appendix
A. The Linear Programming Codes
The linear programming codes and parameters used in this paper are explained as follows: [Xk, fva1, exitflag, output] = intlinprog (f, intcon, [], [], a, b, lb, ub); %%Linear programming finds the minimum transfer cost fva1 to the warehouse.% T (1, j) = fva1+distancenum1 (j, 1).thta; %%Find the sum of transshipment cost and transportation cost. f represents the coefficient matrix of transshipment cost.%% a represents the coefficient matrix of equality constraints in linear programming. b represents the result matrix of equality constraints in linear programming. lb represents the upper limit of Xk value. ub represents the lower limit of Xk value. Matrix T records the total transportation cost of each warehouse j. The distancenum1 matrix stores the distance from each warehouse j to the distribution station. j represents the number of the warehouse. Its value ranges from 1 to j. thta represents the unit path cost after processing.
B. The Grey Algorithm Codes
The code and explanation of the greedy algorithm used in this paper are as follows: s = repmat (s, 5, 1); %% preprocess the order s to facilitate subsequent comparison.%% l = s ≤ K; %% compare the SKU in each order with the inventory to generate a logical matrix (the value of the element in the matrix is 0 or 1).%% shang = selectpsz (x, y, xs, ys); % % according to the Euclidean distance, select the delivery station closest to the delivery location.%% distancenum = distance (:, shang); %% get the distance from the distribution station to each warehouse.%% b = [l, distancenum]; %% combine logical matrix and distance.%% l = sortrows (b, 101); %% sort the logical matrix l according to the distance from the warehouse to the distribution station from near to far.%% distancenum = l (:, [101] ); %% get a new distance matrix.%% l (:, [101]) = []; %% delete the column about distance used when sorting in the matrix.%% % Greedy algorithm—eliminate the redundant 1 from the logical matrix to ensure that each order can only be fulfilled by one warehouse, and the closest warehouse is preferred. for n = 1 : 100 if l(1, n) = = 1 l(2, n) = 0; l(3, n) = 0; l(4, n) = 0; l(5, n) = 0; end end for n = 1 : 100 if l(2, n) = = 1 l(3, n) = 0; l(4, n) = 0; l(5, n) = 0; end end for n = 1 : 100 if l(3, n) = = 1 l(4, n) = 0; l(5, n) = 0; end end for n = 1 : 100 if l(4, n) = = 1 l(5, n) = 0; end end %% determine whether there are unfulfilled orders in the warehouse, and if there are unfulfilled SKUs output. %% d = any(l); d1 = any(s); for n = 1 : 100 if d1(1, n) = = 0 l(:, n) = 0; if d(1, n) = = 0 end end end e = any(l, 2); % determine which warehouses provides SKUs. cost = sum(e.distancenumthta); %% calculate the total transportation cost from all warehouses to the distribution station. %%
Data Availability
All data and models used during the study appear with in the article.
Conflicts of Interest
The authors declare that they have no conflicts of interest regarding the publication of this paper.
Acknowledgments
This research was supported by the National Science Foundation of China (no. 72001166), Science and Technology Guidance Plan of China Textile Industry Federation (no. 2016090), Doctoral Research Initiation Fund Project of Xi’an Polytechnic University (no. BS201834), Xi’an Scientific and Technological Innovation Platform Construction Project/Key Laboratory Construction Project (no. 2019220614SYS021CG043), Science and Technology of Shaanxi Project (no. 2021GY337), and Graduate Scientific Innovation Fund for Xi’an Polytechnic University (no. chx2020008).