Algorithms for Picking and Distribution of Online Orders in New Retail Enterprises

. This paper studies joint algorithms of order picking and distribution in new retail enterprises. The problem will consider many factors, such as the type of goods, picking time, batch capacity of distribution, distribution time, and distribution cost. First of all, the research problems are summarized as mathematical programming problems. Then, a genetic algorithm and comparison algorithms are proposed. Finally, the rationality of the model and the eﬀectiveness of the algorithms are veriﬁed by computational experiments, and management enlightenments are revealed.


Introduction
In the first quarter of 2020, communities in China were closed for management, and since then, the public has been buying fresh food and daily necessities online because of the outbreak of COVID-19. e number of customers in traditional stores has reduced, and orders from new fresh e-commerce have increased rapidly. e new mode of doorto-door delivery has become popular. "It's not the alarm clock that wakes me up every day, but the desire for fresh vegetables." After the outbreak of the epidemic, many people living at home chose to stay away from the grocery market temporarily and "embrace" the Internet, so "online shopping" has become the main choice for supplying daily necessities. is has led to the rise of various online fresh food retail platform merchants against the trend, with the number of users, orders, and sales reaching a new height. According to public information, Dingdong (an APP for online fresh food shopping) saw a 291.42% increase in the number of new users and an overall volume growth of approximately 80%; the order volume of Meituan (an APP for online fresh food shopping) increased by more than 200% in some sites in Shanghai; and the number for HEMA (an APP for online fresh food shopping) was 290%. While the business volume of each online retail platform is booming, the supply chain including logistics and distribution is also under great pressure.
On January 15, 2016, HEMA opened its first store in Shanghai Jinqiao Square and quickly became an "Internet celebrity." HEMA is a new retail format completely reconstructed by Alibaba for offline supermarkets that is different from other fresh e-commerce. It is a supermarket, a restaurant, and a vegetable market. However, such descriptions seem to be inaccurate. Consumers can buy goods in-store or place orders through HEMA APP. is feature is also known as "warehouse-store-integration," and HEMA's warehouse is also its store. Compared to traditional warehouse, the interior merchandise is placed differently. e traditional warehouse stores goods in the standard shelfstacking pattern. However, each customer can see all goods in HEMA. e display and placement of commercial products are different according to the preferences of consumers in the area where the store is located.
By observing online orders' picking process of HEMA, we found that once a customer places an order in HEMA APP, the information processing center will divide the order into several suborders according to commodity types, such as river fresh, fruit, pasta, and daily necessities. ( is is determined by the goods location and attributes of the commodity. For example, fresh river food products need to be dehydrated and processed. It must also be sealed and packed to prevent contamination of other goods.) e information of each suborder is first sent to the handheld device of the staff in the area where the goods are located. e staff selects goods and puts them into a bag. e bag is hung on the hook at the starting position of a conveyor belt, which transfers the bag to the packaging area. In the packaging area, items from the same order are assembled together and passed on to the deliverymen, who distribute customers' orders in batches. One of the biggest characteristics of HEMA is fast delivery: within 3 kilometers around the store, it takes only 30 minutes to deliver goods to your door.
From the above description, we can see that, in the order processing system, the flow of information drives the flow of goods: receiving information from the information processing center, sending instructions to the staff, and sending the goods to the customers by deliverymen. Each of the above steps is important in order to achieve the goal of rapid delivery. In this paper, we formulate the above order processing as a joint scheduling problem of online order picking and distribution.
Order picking is a process of picking the required products from the shelves accurately and quickly, according to the information of customers' orders. It is one of the most important operations in the distribution center. An appropriate order picking system helps improve working efficiency and customer satisfaction [1]. Many literatures have studied such problems, mainly involving design of goods location [2], picking routes [3], order batching [4,5], and partition picking [6]. In the "online shopping" mode, logistics distribution business poses a lot of new challenges. Researchers have studied the decision-making and route optimization of e-commerce logistics distribution, such as [7,8]. In order to deliver goods to customers quickly, it is necessary to manage order picking and distribution as a whole. is is because the starting time of vehicle distribution is directly related to the completion time of order picking. Wang et al. [9] constructed a joint scheduling model of picking and distribution to minimize orders' fulfillment time. Peng [10] studied a joint scheduling problem of order batching and distribution routing and took the shortest total fulfillment time from order picking to distribution completion as the goal of B2C e-commerce distribution center. Zhang et al. [11] studied the online integrated order picking and delivery problem with the multizone routing method to minimize the sum of the maximum delivery completion time and the total delivery cost. e order picking in this paper is different from the traditional warehouse order picking. A HEMA offline store is also a warehouse, which increases the difficulty of order fulfillment due to the variety of commodity demand and small batch sizes. All orders submitted through HEMA app are picked by the staff in the sales area. e placement of goods in the sales area is different from that in traditional warehouses.
ere is no unified standard shelf. e display and the placement of goods varies from shop to shop according to the preferences of consumers in the area where the store is located. erefore, we study the picking and distribution problem of orders generated in HEMA APP from a different view. It is assumed that, in a certain period of time, there are some orders to be picked out and distributed to customers. ese orders are regarded as jobs, the staff and conveyor belts in HEMA stores are regarded as machines, and the deliverymen are regarded as vehicles. We analyze the combined problem of order picking and distribution and establish the model with the goal of minimizing the sum of orders' total completion time and total delivery cost.
From the view of scheduling research, we study a machine scheduling problem with transportation of finished jobs. Hall and Potts [12] were the first to propose a joint machine scheduling problem with job transportation. Chen [13] gave a detailed review on the joint problems of machine scheduling and product transportation published before 2008. Zhong et al. [14] and Fu et al. [15] studied scheduling problems of outsourcing the transportation of products to third-party logistics companies. Ullrich [16] considered machine scheduling and job transportation problems with path planning. In this paper, we consider orders' picking and distribution in HEMA as a joint scheduling problem with distribution coordination. Orders are first processed in dedicated flow shops followed by assembly lines and then are distributed to the customers by deliverymen. To the best of our knowledge, this machine scheduling problem has not been covered in any previous literature. e remaining sections of this paper are organized as follows: In Section 2, we give the problem description; in Section 3, we construct a MP model for the case with one machine at each stage and one deliveryman; in Section 4, we devise algorithms to solve the problem; in Section 5, numerical experiments are carried out to verify the rationality of the model and the effectiveness of the algorithms; in Section 6, we conclude this paper.

Problem Descriptions
Suppose that, during a certain period of time, there are several orders waiting to be processed in the online order system of HEMA. Each order is composed of several types of suborders and processed in four stages in sequence. e first and second stages are order processing within the shop: a subjob is first processed on a stage 1 machine (the staff picks out the products and put them into a bag) and then processed on a stage 2 machine (the conveyor belt transfers the bag to packing area); then, in the packing area, suborders belonging to the same order are assembled together for distribution; this is stage 3. In stage 4, completed orders are distributed to their customers in batches by deliverymen with electric power carts. e full process is shown in Figure 1.
We regard each order as a job, and a suborder as a subjob (order and job, and suborder and subjob will be used interchangeably in the following). e staff and conveyor belts are regarded as machines, and the deliverymen are regarded as vehicles.
Next, we describe the above process of orders' picking and distribution as a joint machine scheduling and transportation problem. At the beginning of the planning horizon, n orders e processing time for job O i 's assembling operation is p 3 i . Each vehicle contains a batch of jobs when it departs from the store. It delivers the jobs to the customers one by one and returns to the store after it delivers the last job. en, it is ready for the next batch's delivery. It can carry no more than Q jobs in one batch. In this paper, a complete undirected graph G � (V, E) with n + 1 vertices is used to represent the geographical locations and distances between the HEMA store and n customers, V � V 0 , V 1 , V 2 , . . . , V n , E � e ij , i ≠ j, i, j � 1, 2, · · · , n}, where V 0 is the HEMA store, and V 1 , V 2 , . . . , V n represent n customers. It takes time of t ij (i, j � 1, 2, . . . , n) for the vehicle travelling between V i and V j . e vehicle starts from V 0 , distributes the orders in the current batch to their customers one by one, and returns to V 0 . We assume that the triangle inequality is satisfied between any three points in the distribution network. Since a batch may contain a variety of orders (e.g., requiring refrigeration or additional packaging), each order occurs a distribution cost d i . If several orders are contained in one batch, the distribution cost of this batch equals the arithmetic mean of the cost of all orders in the batch.
Our goal in this paper is to design a solution for the above joint machine scheduling and distribution problem, such that the total arrival time (sum of the times when the customers receive their orders) and the total distribution cost are minimized.
We need to make the following decisions: (1) subjobs' arrangement on the dedicated flow-shop machines and the assembly machines; (2) batching decision before distribution, including the number of batches and jobs contained in each batch; (3) the time when each batch leaves the machine and the routes of distributing orders in each batch.

MP Model for a Special Case
In this section, we study the case when each job contains two subjobs (subjob A and subjob B denote fresh goods and nonfresh goods, respectively), and there are one assembly machine and one vehicle. We construct a mathematical programming model for this problem. It seems that it is a bit special; however, we can see that it reveals the meaning for the coordinated consideration of order picking and distribution. We first list parameters and variables for this model.
Mathematical programming model is as follows: Objective function (1) is to minimize the sum of the total completion time and the total distribution cost of jobs. Constraints (2) and (3) ensure that each subjob starts processing after time zero. Constraints (4) and (5) denote the finishing time of type A subjobs at the first stage and second stage. Constraints (6) and (7) indicate that a subjob can be started on stage 2 machine only after it has been finished on the corresponding stage 1 machine. Constraints (8) and (9) denote the finishing time of type B sub jobs at the first stage and second stage. Constraint (10) denotes the finishing time of the jobs at the third stage. Constraint (11) ensures that a job can be assembled only after its two subjobs have been completed. Constraints (12) to (16) ensure that, at any time, only one job can be processed on a machine. Constraint (17) ensures that a job is contained in exactly one batch. Constraint (18) ensures that the number of jobs in one batch is no larger than the capacity constraint. Constraint (19) denotes the bound for the number of distribution batches. Constraint (20) ensures that the vehicle can start travelling only after all jobs in one batch are completed. Constraint (21) indicates that, for each job, the departure time is the starting time of corresponding batch distribution. Constraint (22) denotes the cost of distribution for each batch. Constraint (23) ensures that the vehicle starts a new distribution batch only if he has distributed all the jobs in the last batch and returns to the store. Constraints (24) to (26) indicate that each customer is visited exactly once. Constraints (27) and (28) indicate that the vehicle travels from/to the store exactly F times. Constraint (29) denotes the time when the vehicle returns to the store equal to its starting time of the current batch plus the total travel time in the routing. Constraints (30) to (31) denote the delivery time of job O i in batch B f .

A Genetic Algorithm
Note that the two-stage assembly scheduling problem with two parallel machines in the first stage and no delivery is strongly NP-hard [17]. erefore, the problem in this paper with two dedicated flow shops in the first stage and delivery coordination is obviously strongly NP-hard. Only relatively small instances can be optimally solved in reasonable computational time. Consequently, in this section, we develop a genetic algorithm to find good solutions [18].
For a given sequence of O 1 , O 2 , . . . , O n , we first devise algorithm CA-D (Algorithm 1) to arrange the jobs' processing and distribution.
Note that algorithm CA-D generates a feasible schedule for our problem; however, this schedule is not that good.
is is because the processing sequence and delivery sequence are the same in one batch. Next, we propose algorithm LGP (Algorithm 2) to improve this problem.
LGP does not change the batching decisions but tries to reduce the completion time on the machines as well as the total transportation time of each batch.
Next, we list the details of our genetic algorithm: (1) Coding and encoding A chromosome represents a sequence of orders' picking and distribution based on the above algorithm CA-D. Figure 2 shows an example of a chromosome with ten genes indicating that there are ten jobs to be processed. 1, 5, 4, 2, 7, 10, 9, 8, 3, 6 { } is the input of algorithm CA-D in order to determine the processing sequence on each machine and the distribution batches with routing consideration.
(2) Fitness function We define the fitness function of a chromosome as the inverse of the objective function:

) Genetic operators
Genetic operators used in this paper include selection, crossover, mutation, reversal, and reinsertion. First, parent chromosomes are selected from the initial population, then the offspring chromosomes are generated by crossover operator, and then mutation operation is performed. In order to improve the local search ability, reverse operation is carried out. Finally, in order to handle the reduction of the number of chromosomes caused by the selection operator, reinsertion operation is carried out: In this paper, Roulette wheel selection is used to select offspring from the parent population. Roulette wheel selection is similar to the roulette wheel used in gambling. Table 1 Table 1 and then select the parent individuals in turn by roulette selection. (3.2) Crossover In this paper, Partially Matched Crossover (PMX) method is used in the crossover. In PMX, we first select two crossover points randomly, exchange the genes between the two crossover points, and then replace the repeated genes through allele mapping. In Figure 4, we show the process of creating two offspring from a pair of parents by PMX crossover and mutation, using individuals 9 and 10 from Table 2: first, the crossover region of the parent individual is selected, and the genes of the two chromosomes within the crossover region are crossed over. As the new chromosome contains duplicated genes, we replace the duplicated genes by mapping the alleles of the parent individuals (4 − 7 − 10, 2 − 5, 7 − 6, 9 − 3). A random number in [0, 1] is generated, and if it is smaller than the crossover probability c, crossover is run. Step 1: for batch B f , select two jobs randomly from this batch. Swap the two jobs in the processing sequence, i.e., on each machine, corresponding subjobs are swapped. Compute the completion time of the last job in B f on the assembly machine. Repeat such swapping operation 50 times and select the processing sequence with the minimum completion time of the last job in B f .
Step 2: for batch B f , select two jobs randomly from this batch. Swap the two jobs in the delivery sequence and compute the total delivery time of this new sequence. Repeat such swapping operation 50 times and select the delivery sequence with the minimum total delivery time.

(3.3) Mutation
In the mutation operation, for the two individuals after the crossover operation, we randomly select two positions in an individual to exchange genes at these two positions, as shown in Figure 5. A random number in [0, 1] is generated, and if it is smaller than the mutation probability m, mutation is run.
(4) Iteration termination conditions e minimal fitness function value of the last generated population is denoted as LB, where the initial value of LB is the minimum fitness function value of the initial population. e minimal fitness function value of the current population is denoted as CR. If (|LB − CR|/LB) ≤ ε (ε is a given positive number) or the number of iterations reaches 500, stop. Now we are ready to devise a genetic algorithm DU-GA (Algorithm 3) for the integrated order picking and distribution problem.

Numerical Experiments and Analysis
In order to verify the rationality of the above model and test the performance of algorithm DU-GA, we conduct numerical experiments and analyze the results based on Python 3.8. All numerical experiments are performed on a personal   is a random integer uniformly generated in interval of [5,10] and the other parameter settings are similar to this).
Group-X (Instances 1-20) considers the case when orders contain both fresh and nonfresh products, where the processing time is always larger than zero. e picking time for fresh products is generally longer than that for nonfresh products due to the additional steps (i.e., dewatering and weighing) during the picking process. Group-Y (Instances 21-40) and Group-Z (Instances 41-60) allow orders containing only fresh products or only nonfresh products, in recognition of the fact that customers may need to buy only fresh or nonfresh products, where the processing time may be zero, which is more realistic. Group-Z (Instances 41-60) examines cases where the delivery time of orders is significantly longer than processing time.

Parameters for Genetic Operators.
Before the genetic algorithm is applied, the following parameters need to be determined: population size P, crossover probability c, and mutation probability m. P is set to be one of 50, 100, 150 { } and maintains the same size for each iteration. e crossover probability c is set to be one of 0.7, 0.8, 0.9 { }. e mutation probability m is generally set to be in [0.05, 0.1]; however, considering the strong NP-hardness of the problem, m is set to be one of 0.1, 0.2, 0.3 { } to expand the search space. Since the actual performance of genetic algorithm is closely related to these parameters, we first test different combinations of (P, c, m). For each group, an instance is generated. For different parameters of GA, the algorithm is run five times for each instance. Table 3 lists the average objective value for the instances (i.e., 13477.71 online 2 column 2 denotes the average objective value of the instance of Group-X with parameter (50, 0.7, 0.1), and the others are similar to this).
We observe the following:

Stability Test.
To evaluate the stability of algorithm DU-GA, for Groups X, Y and Z, we run each instance five times to assess the span between the minimal solution (denoted as S B ) and the average value (denoted as S A ), which is referred to as Relative Deviation (denoted as RD), calculating by RD � ((S A − S B )/S A ) × 100%. Table 4 shows that the span between S A and S B is small, with an average RD of 1.46% for Group-X, 1.97% for Group-Z, and 2.05% for Group-Y. erefore, DU-GA is stable in all three groups of instances.

Comparison Algorithm.
To evaluate the effectiveness of the algorithm DU-GA, we design comparison algorithms DU-1 (Algorithm 4) and DU-2 (Algorithm 5). Algorithm DU-1 is a genetic algorithm that is different from DU-GA in that it calculates the fitness function based on the departure  time of each job s i4 . Algorithm DU-2 processes and distributes jobs in a random order. Tables 5-7 We also observe that DU-GA takes the longest time in most instances, but the maximal does not exceed 11.83 seconds; the running time of DU-1 is shorter than that of DU-GA, while the running time of DU-2 is the shortest. Compared with DU-1, DU-GA not only considers the delivery times in fitness function but also adds further optimization of the production and distribution stages based on the basic GA algorithm:

Algorithm Effectiveness Analysis. In
(1) Compare DU-GA with DU-1 According to Tables 5-7, the average improvement of C DU−GA over C DU−1 for Groups X, Y and Z instances is 1.94%, 4.00%, and 5.12%.
(1.1) It is shown that the improvement of C DU−GA over C DU−1 of Group-Y is better than that of Group-X. Note that the processing times of jobs in Group-Y are smaller than those of Group-X, and thus the distribution time is relatively larger in Group-Y. DU-GA differs from DU-1 in that it considers the delivery times as well as processing times in the fitness function; therefore, the larger the delivery times, the more the improvement of C DU−GA over C DU−1 . (1.2) e improvement of C DU−GA over C DU−1 of Group-Z is better than that of Group-Y. Note that the transportation times of instances in Group-Z are obviously higher. e same reason as in (1.1) can explain this observation. (1.3) e results of Group-Z are significantly better than those of the other two groups, meaning that, compared to algorithm DU-1, algorithm DU-GA is highly effective for the practical case when orders may only contain fresh items or nonfresh items and take longer for distribution than processing.
(2) Compare DU-GA with DU-2 According to Tables 5-7, the average improvement of DU-GA over DU-2 for Groups X, Y and Z instances is 5.35%, 9.70%, and 10.38%.
(2.1) It is shown that the average improvement of C DU−GA over C DU−2 of Group-Y is better than that of Group-X. DU-2 is a FIFO strategy, and no optimization skill is applied. DU-GA is a genetic algorithm, and it considers the processing times and the delivery times in the fitness function. Note that there is only one vehicle for distribution, and multiple orders are contained in one batch; thus, the optimization of the distribution stage plays a more important role than that of the production stages. Recall that the processing times of jobs in Group-Y are smaller than those of Group-X, and thus the distribution time is relatively larger in Group-Y. erefore, the larger the delivery times, the more the improvement of C DU−GA over C DU−2 . (2.2) e improvement of C DU−GA over C DU−2 of Group-Z is better than that of Group-Y. Note that the transportation times of instances in Step 1: determine the population size P, the crossover probability c, the mutation probability m, and the termination condition of the algorithm, followed by initializing the population (i.e., randomly generating P individuals).
Step 2: for each individual, apply algorithm CA-D. Evaluate fitness values of the chromosome and select two individuals as parents.
Step 3: perform crossover and mutation operators on the selected parents to obtain offspring individuals.
Step 4: update the population by adding the newly generated individuals to the population.
Step 2 and Step 3 are repeated until the termination condition is met, and the iteration is stopped.
Step 5: select the best solution from the current population, and let it be the input of algorithm LGP. Run algorithm LGP, and output the resulted solution.
Group-Z are obviously higher. e same reason as in (2.1) can explain this observation. (2.3) e results of Group-Z are significantly better than those of the other two groups, meaning that, compared to algorithm DU-2, algorithm DU-GA is highly effective for the practical case when orders may only contain fresh items or nonfresh items, and the time for distribution is longer than processing.
(3) For each instance, C DU−GA − C DU−2 is always larger than C DU−GA − C DU−1 . DU-2 is a FIFO strategy, and no optimization skill is applied, while DU-1 is a genetic algorithm, which considers jobs' processing times in the fitness function. DU-1 is also an acceptable algorithm, but not as good as DU-GA.

e Enlightenment for the Management of New Retail
Enterprises. e orders' processing sequence in each stage directly affects the order delivery time, which in turn has an impact on customer satisfaction. In order to improve customer satisfaction, we must consider different practical scenarios. e results of numerical experiments show that the genetic algorithm DU-GA is relatively stable for all instances. We also design comparison algorithms DU-1 and DU-2 to evaluate the effectiveness of DU-GA. e results show that algorithm DU-GA outperforms algorithm DU-1 Step 1: same as Step 1 of DU-GA; Step 2: for each individual, apply algorithm CA-D. Calculate the fitness value for individuals in the population by taking 1/ n i�1 s i4 F f�1 D f as the fitness function.
Step 3-Step 4: same as Step 3 -Step 4 of DU-GA; Step 5: output the processing sequence, batching decision, and delivery routings of the best solution based on fitness function 1/ n i�1 s i4 F f�1 D f . Calculate the corresponding objective function n i�1 c i4 + F f�1 D f . ALGORITHM 4: DU-1.
Step 1: run algorithm CA-D in a random order; Step 2: output the processing sequence, batching decision and delivery routings. Calculate the corresponding objective n i�1 c i4 + F f�1 D f . ALGORITHM 5: DU-2. Table 5: Experimental results of 20 instances in Group-X.
Instance and algorithm DU-2 for all instances of three different groups.
From the above analysis, we can observe the following: (1) Algorithm DU-2, based on "first-arrive-first-process" method, is easy for operation. e manager of the new retail enterprise merely processes the orders according to the arrival sequence, and the distribution cost and delivery time can be relatively high.
(2) Compared to DU-2, DU-1 takes the departure time of each job into consideration and results in a lower total order delivery time and delivery cost. is algorithm may be run in the development stage of optimizing the operation: the manager outsources the distribution to 3PL companies and focuses on the departure times and distribution costs of orders. However, when the customers receive their orders, it is out of control, and the manager has no idea of the customers' satisfaction level. Instance  Table 7: Experimental results of 20 instances in Group-Z.
Instance (3) Compared to DU-1, algorithm DU-GA takes both order delivery time and delivery cost into consideration. e manager determines orders' picking and delivery as a whole and can monitor the customers' satisfaction level and total delivery cost at the same time.
DU-2, DU-1, and DU-GA represent the degrees of attention to order picking and distribution at different stages: (1) DU-2 indicates the initial stage of enterprise establishment, and the variety of goods and the number of customers are relatively small. erefore, the enterprise starts processing orders as soon as receiving them.
(2) DU-1 represents the development stage of the enterprise. As the scale of business becomes larger, the number of orders increases. At this stage, the new retail enterprises may cooperate with 3PL companies; thus, the business managers only need to arrange the production to ensure orders' departure times. (3) DU-GA indicates a stable period after expansion.
New retail enterprises start to focus on lean management of operation. ey build their own logistics instead of resorting to 3PL companies. Hence, they need to jointly consider orders' picking and distribution.

Summery and Prospects
Based on the characteristics of orders' picking and delivery in new retail enterprises, this paper builds a joint scheduling and distribution model. An MP model is established for a fundamental case, and we devise a genetic algorithm as well as comparison algorithms. e results of computational experiments show the rationality of the model and the effectiveness of the algorithms. Furthermore, we simulate different practical situations to verify the applicability and performance of the algorithm. It is shown that our genetic algorithm is stable and outperforms comparison algorithms.
Our study provides management insights, showing that joint scheduling algorithms can significantly improve the efficiency of order picking and distribution in new retail enterprises. Reasonable coordination of order picking and distribution can effectively reduce business operation costs and improve customer satisfaction. e research in this paper can be further extended, such as cases with more than three types of suborders and different types of vehicles. e research model in this paper is an offline scheduling problem, and future research can consider online problems.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest in this paper.