Optimization method of urban e-commerce takeaway delivery path based on one order and multiple merchants
Optimizing the takeaway delivery path through the ALNS algorithm and mileage saving method, the problems of high delivery costs and poor customer experience in the "one order and multiple merchants" scenario are solved, and cost reduction and satisfaction improvement are achieved.
Patent Information
- Application Number
- CN202410221081.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-02-28
AI Technical Summary
In the consumption scenario of "one order and multiple merchants", takeaway delivery costs remain high, customers have poor dining experience, and existing technology is difficult to effectively optimize delivery paths and resource allocation, resulting in high delivery costs and low customer satisfaction.
Adopting the urban e-commerce takeaway delivery path optimization method based on the ALNS algorithm, the delivery path and vehicle scheduling are optimized by building the objective function to provide the smallest total cost, combining the mileage saving method and adaptive large-scale search algorithm to optimize the delivery path and vehicle scheduling to reduce the delivery cost and improve customer satisfaction.
It effectively reduces the delivery cost of takeaway and improves customer satisfaction. By optimizing vehicle paths and resource allocation, the problems of high delivery costs and poor dining experience are solved, and are suitable for complex "one order and multiple merchants" scenarios.
Smart Images

Figure CN118134372B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of takeout delivery path optimization, and in particular to a method for optimizing the takeout delivery path of an urban e-commerce company based on a one-order-multiple-business scenario. Background Art
[0002] With the development and maturity of the food delivery industry, reducing delivery costs and improving customer satisfaction have become the core competitive strategies of food delivery companies. However, in the current consumer context of "one order, multiple merchants", due to insufficient delivery experience, high delivery difficulty, and high delivery service requirements, the allocation of food delivery resources is unreasonable and the food delivery service does not meet the requirements. Food delivery platforms are facing the dual challenges of high delivery costs and insufficient dining experience for food delivery customers. Therefore, how to reasonably allocate food delivery resources, optimize delivery routes, and thereby reduce delivery costs and improve customer satisfaction has become an urgent problem for food delivery companies.
[0003] Urban food delivery has developed rapidly in recent years, and the market size has expanded steadily. "One order, multiple merchants" refers to the consumption scenario in which food delivery customers place orders at different merchants at the same time. With the upgrading of consumption and the prevalence of the "party economy", the dining needs of food delivery customers are no longer limited to a single merchant or a single food delivery product, and present diversified and personalized cross-merchant consumption characteristics. In order to meet the dining needs of food delivery customers, provide better services, and thus improve their own competitiveness, various food delivery companies have launched new products or services. Meituan launched a smart ordering service, providing dining combinations suitable for different numbers and different price groups, providing a reference for the personalized combination consumption of food delivery customers; Ele.me launched a shopping cart one-click settlement service, food delivery customers can consume at multiple merchants at once, providing convenience for food delivery customers to consume across merchants; Ele.me and Meituan Food Delivery have both launched the same-city "running errands" business, by providing food delivery customers with help buying and delivery services, to a great extent meet the dining needs of food delivery customers across merchants. It can be seen that the cross-merchant dining needs of food delivery customers have been met to a great extent by food delivery companies, and "one order, multiple merchants" has become a new consumption scenario. But there are many problems, including:
[0004] 1. Food delivery costs remain high
[0005] The food delivery industry has a short history of development and a weak development foundation. It lacks delivery experience in the context of "one order, multiple merchants" consumption, and the difficulty of delivery has increased, resulting in high delivery costs for food delivery. On the one hand, in the context of "one order, multiple merchants", orders have the characteristics of a cross-merchant combination. In actual delivery, riders need to comprehensively consider the departure time, the meal delivery time of different merchants, and the time required by takeout customers, which increases the difficulty of delivery. Blind delivery based on personal experience alone is difficult to achieve optimal delivery, resulting in increased delivery costs. On the other hand, due to the lack of experience in rationally utilizing delivery resources through reasonable order allocation methods, the transportation capacity is at an excessively high level, resulting in a waste of vehicle resources. Excessive rider resource costs are an important reason that hinders food delivery platforms from making profits or expanding profits.
[0006] With the expansion of the scale of food delivery, many food delivery companies have realized the importance of vehicle scheduling. More and more companies hope to achieve economies of scale and reduce costs and increase efficiency through reasonable vehicle scheduling. Vehicle scheduling includes two links: order allocation and vehicle routing. Order allocation affects the occupation of food delivery vehicle resources. Reasonable allocation of orders can allow food delivery platforms to complete more orders with a smaller capacity scale, which is conducive to reducing the capacity scale; vehicle routing affects the consumption of vehicle resources. Reasonable arrangement of vehicle routing can reduce long-distance round trips, which is conducive to reducing driving costs. Therefore, scientific and reasonable vehicle scheduling can effectively reduce the investment in distribution vehicle resources and reduce distribution costs, which is of great significance to solving the problem of high food delivery costs.
[0007] 2. Traditional takeaway delivery affects customers’ dining experience
[0008] In the "one order, multiple merchants" consumption scenario, the needs of takeaway customers have also changed, showing the characteristics of diversified and personalized cross-merchant ordering, and takeaway customers have also put forward higher requirements for corresponding takeaway delivery services. The traditional delivery of "one order, one pickup" (one merchant picks up the meal at one time) has seriously affected the cross-merchant dining experience of takeaway customers.
[0009] On the one hand, due to the lack of delivery experience for cross-merchant orders, one order requires too many riders to complete the delivery, resulting in too many times for takeaway customers to pick up their meals; on the other hand, the unreasonable arrangement of the delivery sequence makes the time interval between two meals for takeaway customers too long, seriously affecting the customers' cross-merchant dining experience. Therefore, it is of great practical significance to reasonably arrange vehicle routes to reduce the number of meals and the time interval between meals.
[0010] Major food delivery platforms have also realized the demand of food delivery customers for not waiting at the same address. Meituan has launched a smart ordering function, which can provide meal combinations suitable for different numbers of people at different price points. After ordering, the meal can be picked up at one time, but the premise is that the order is placed at the same merchant, not across merchants; Ele.me cooperates with Dashidai, and orders placed at Dashidai can meet any meal combination across merchants, one-click selection, one delivery fee, and delivery at the same time, but the premise is that the order is placed at Dashidai mall. It can be seen that major platforms have begun to work hard to meet the new needs of food delivery customers. Although the effect has not yet been seen, in the context of "one order, multiple merchants" consumption, reducing the waiting time and the number of times to pick up meals has become a new research direction for improving customer satisfaction.
[0011] In summary, the current large volume of urban food delivery is facing the dual challenges of high delivery costs and low quality dining experience. Therefore, food delivery platforms need a more reasonable order allocation method to integrate orders sent to the same address, thereby reducing the number of deliveries and the scale of transportation capacity; they also need a reasonable delivery route to reduce driving delivery costs and reduce the time interval between multiple deliveries while meeting order requirements.
[0012] The takeaway industry market is developing rapidly, but the rapid development is also accompanied by a large number of problems such as unreasonable takeaway delivery arrangements, high delivery costs, and poor customer satisfaction. Therefore, some researchers have begun to analyze and study takeaway delivery, but most of the literature focuses on improving user satisfaction and lacks direct research on the optimization of takeaway resource allocation.
[0013] The technical problems existing in the prior art are analyzed from the order characteristics, delivery characteristics and time-constrained demand characteristics, as follows:
[0014] 1. The order characteristics of "one order, multiple merchants" are analyzed as follows:
[0015] For food delivery platforms, the "one order, multiple merchants" order format is of strategic significance for improving customer satisfaction. The current "one order, multiple merchants" has the characteristics of including multiple merchants in the order and the order can be split by merchant.
[0016] (1) An order includes multiple takeaway merchants
[0017] "One order, multiple merchants" refers specifically to a takeaway order that includes orders for multiple takeaway merchants. In a narrow sense, "one order, multiple merchants" refers to the same takeaway customer placing orders across merchants through one-click checkout in the shopping cart or other functions; in a broad sense, all takeaway customers at the same delivery address place orders across merchants during the same time period. Obviously, in the context of "one order, multiple merchants", an order has the characteristic of including multiple merchants.
[0018] (2) The order is divisible
[0019] Due to practical problems such as the difficulty of delivery and limited delivery capacity, current cross-merchant orders cannot be delivered to takeaway customers at once, and the orders have the characteristic of being split by merchant. Figure 1.1 As shown in the figure, (a) is the traditional "one order, one merchant" delivery process, (b) and (c) are the "one order, multiple merchants" order delivery processes, where (b) represents the delivery process under order splitting, and (c) represents the delivery process under order non-split. Compared with the traditional "one order, one merchant" order, the "one order, multiple merchants" order needs to consider whether the order is divisible and how to split it during the distribution process. Too many split orders mean that more takeaway riders are required to participate in the order delivery process, resulting in an increase in the rider cost in takeaway delivery. At the same time, takeaway customers need to pick up the food too many times, affecting the dining experience of takeaway customers; and if the order is split too few times, it often causes the rider to have to go back and forth for many long distances to pick up and distribute the food, resulting in an increase in the driving cost in takeaway delivery, and it will also increase the waiting time for takeaway customers to eat, affecting the dining experience of takeaway customers. Therefore, it is of great significance for takeaway companies to solve the problem of takeaway route optimization for divisible orders.
[0020] In summary, in the consumption scenario of "one order, multiple merchants", an order has two characteristics: it includes multiple merchants and the order can be split. Taking into account the cost and transportation capacity, how to reasonably split the order has become the key to balancing the cost of food delivery and customer satisfaction.
[0021] 2. The characteristics of takeaway delivery demand are analyzed as follows:
[0022] In order to study the demand relationship among takeaway merchants, takeaway riders and takeaway customers in takeaway delivery, take 5 delivery demands as an example, which includes 2 takeaway customers, 4 takeaway merchants and one rider station. The specific demand situation is shown in Figure 1.2.
[0023] Figure 1.2 The takeaway delivery demand situation can be explained as follows: takeaway customer No. 1 has delivery demands for takeaway merchants No. 1 and No. 2, takeaway customer No. 2 has delivery demands for takeaway merchants No. 2, 3 and 4, and the four takeaway merchants have delivery demands for riders, ultimately forming 5 complete delivery demands.
[0024] (1) There is a corresponding relationship between the delivery and pick-up demand
[0025] from Figure 1.2 It can be seen that a complete delivery demand includes the delivery pick-up demand and the delivery delivery demand, and the number of the generated delivery pick-up demand is consistent with the delivery delivery demand. At the same time, each delivery delivery demand has a corresponding delivery pick-up demand. The delivery delivery demand is special and corresponds one-to-one with the delivery pick-up demand.
[0026] (2) Delivery needs must meet the “pick up first, deliver later” requirement
[0027] Delivery needs include meal pickup needs and meal delivery needs. In the actual delivery process, the rider must first meet the meal pickup and meal delivery needs in order to complete the delivery. At the same time, unlike the traditional delivery process where the warehouse meets customer needs, the takeaway delivery process is not an independent link, but a process that requires close contact between takeaway merchants, takeaway customers, and riders. A complete delivery process requires the rider to first accept the takeaway order at the rider’s current location, then go to the corresponding takeaway merchant location to wait for the meal according to the meal pickup needs, and then go to the takeaway customer location to wait for the meal to be delivered according to the meal delivery needs, and finally complete the entire delivery process. The takeaway merchant and takeaway customer corresponding to the order must be visited by the same rider in turn. It can be seen that the delivery demand has the characteristics of "pick up first and then deliver".
[0028] 3. Analysis of the characteristics of delivery time constraints
[0029] (1) High timeliness requirements
[0030] In the process of food delivery, after placing an order, food delivery customers often agree on a delivery time with the food delivery platform. If the food delivery rider is later than the agreed time, customer satisfaction will decline, affecting the customer experience. If too many customers report this experience to other channels, it will greatly affect the brand of the food delivery company. In order to enhance the competitiveness of the company itself, current food delivery companies have made a lot of efforts in the timeliness of food delivery. Major platforms have deepened their efforts in food delivery timeliness, guaranteeing door-to-door service within three kilometers and delivery within one hour; Meituan Food Delivery launched on-time payment, which will be paid when the timeliness requirements cannot be met; Ele.me and Meituan Food Delivery have entered the drone delivery market, planning to build an air delivery network covering 5 kilometers and with a timeliness of 10 minutes in the next five years. It can be seen that the timeliness requirements for food delivery will become higher and higher.
[0031] (2) Complex time constraints
[0032] In the actual delivery process of "one order to multiple merchants", in order to meet the timeliness requirements of takeaway customers for takeaway and ensure that the takeaway is delivered to the takeaway customers faster and more accurately, the riders not only need to consider the constraints of the takeaway customers on the delivery time, but also need to comprehensively consider the time constraints in three dimensions, including the maximum driving time of the rider's vehicle, the service time of different takeaway merchants, and the different takeaway delivery times. There are many time constraints and they are complex.
[0033] The constraints of takeaway customers on delivery time are one of the evaluation criteria for takeaway customer satisfaction. If the delivery time is too long, it will affect the consumption experience of takeaway customers. The other three time constraints affect whether the rider can complete the delivery and whether they need to wait. It can be said that time constraints are the most critical consideration for the smooth completion of takeaway delivery. Therefore, considering the time constraints of takeaway delivery is the basis for optimizing the takeaway route.
[0034] In summary, takeaway delivery has the characteristics of splitting orders, "pick up first and deliver later" delivery requirements, and high timeliness requirements. In order to better study the delivery characteristics of takeaway delivery optimization problems under the background of "one order, multiple merchants" consumption, this section makes a simple comparison with traditional takeaway delivery in terms of order conditions, delivery conditions, time constraints, and delivery range, as shown in Table 1:
[0035] Table 1 Comparison with traditional delivery
[0036]
[0037] In summary, the characteristics of orders being divisible, orders containing multiple delivery requirements and more complex time constraints make the problem of optimizing delivery routes for food delivery in a smaller range extremely complicated. It is almost impossible to complete delivery while meeting the constraints by relying solely on human experience to arrange the route.
[0038] Further analysis of the impact of urban food delivery characteristics on vehicle routes is as follows:
[0039] The traditional vehicle routing problem (VRP) refers to the process of loading all customers' required materials in advance, starting the vehicle from the warehouse, visiting each customer under the constraints of the time window, making the total driving distance or cost as small as possible, and finally returning to the warehouse, and each customer only needs to receive service once. Compared with the traditional pick-up and delivery vehicle routing optimization problem, the takeaway delivery optimization problem has more complex constraints. In order to better perform vehicle scheduling, the following three parts are explored in depth from the impact of order characteristics on vehicle scheduling, the impact of distribution demand characteristics on vehicle scheduling, and the impact of time-constrained demand characteristics on vehicle routing.
[0040] 1) The impact of “one order, multiple merchants” order characteristics on vehicle routing
[0041] Due to various capacity constraints and other constraints, some orders cannot be delivered perfectly as required. At this time, the orders need to be split reasonably. Too many splits will affect the customer experience; if the splits are too few, the current capacity may not be able to complete the delivery or too high a cost may be required for delivery. From the perspective of vehicle scheduling, the splitability of orders means that the order requirements can be completed in batches.
[0042] Whether the takeaway order is divisible affects the delivery route of the rider. Figure 1.3 As shown in the figure, the left side shows the delivery when the order cannot be split. The order demands of takeaway customers for takeaway merchants 1, 2 and 3, 4 can only be delivered by one rider respectively; the right side shows the delivery when the order can be split. Considering that the order can be split, the order demands of takeaway customers can be completed by riders in batches, and then the collaborative delivery can be completed with a shorter delivery cost. In actual delivery, due to constraints such as time or load, "one order to multiple merchants" orders cannot all be delivered along the path on the left side of the figure. At the same time, too many order splits will also lead to problems such as decreased customer satisfaction. Reasonable batch delivery can reduce delivery costs while meeting order requirements.
[0043] 2) The impact of food delivery demand characteristics on vehicle routing
[0044] The pick-up and delivery requirements of takeout delivery have the characteristics of correspondence and "pick up first and deliver later". The pick-up and delivery requirements of takeout delivery have a corresponding relationship, which means that when the rider plans to visit a takeout customer with a delivery demand, he also needs to arrange the takeout merchant corresponding to this delivery demand on the access path, which increases the number of pick-ups in vehicle scheduling. Figure 1.4 As shown in the figure, the left side shows delivery without considering the corresponding relationship between delivery demands, and the right side shows delivery when considering the delivery demands appear in pairs. It can be seen that after adding the constraint that delivery demands appear in pairs, the demand points visited by riders will be reduced, thereby increasing the usage of riders.
[0045] At the same time, the delivery demand of “pick up first and deliver later” affects the order of riders’ visits, such as Figure 1.5 As shown in the figure, the left side is a route map without considering the "pick up first, deliver later" constraint of the delivery demand, and the right side is a route map considering this constraint. Due to the order of delivery demand, the rider needs to first pick up the food at the pickup location and then go to the delivery location for meal distribution. However, the route from the No. 2 takeaway customer to the No. 2 takeaway merchant on the left side cannot complete the delivery, forcing the rider to change the order of visits. It can be seen that adding the "pick up first, deliver later" feature constraint of the delivery demand affects the rider's visit order.
[0046] 3) The impact of time-constrained demands on vehicle routing
[0047] Timeliness is the most intuitive feeling of takeaway customers about the quality of takeaway delivery. The level of timeliness directly affects the service quality of takeaway delivery and is an important feature that takeaway companies have to pay attention to. The timeliness feature is the time window constraint, which affects the order of delivery by riders.
[0048] like Figure 1.6As shown in the figure, the left side is a delivery route map based on the shortest path, and the right side is a delivery route map under time constraints. Affected by the time window, the No. 2 takeaway merchant has to deliver before the No. 1 takeaway merchant, and then complete the delivery. It can be seen that time constraints affect the order in which riders visit for delivery.
[0049] At the same time, the time window may also affect the vehicle's inability to complete the delivery, that is, another vehicle is needed to help complete it, such as Figure 1.7 As shown in the figure, the left side is a delivery route map without considering the time window, and the right side is a delivery route map considering the time window. The time windows of takeaway merchant No. 1 and takeaway merchant No. 3 conflict. Since the time window of takeaway merchant 3 conflicts with the time window of takeaway merchant 1, one rider cannot complete the delivery task, so the demand of takeaway customers for takeaway merchant No. 3 needs to be met by other riders. It can be seen that the time window has a great impact on the rider's vehicle path, which will not only increase the delivery cost, but also may increase the number of vehicles.
[0050] In summary, the characteristics of the urban takeaway delivery optimization problem, such as the splittable orders, the paired delivery requirements and the "pick up first and deliver later" and the high timeliness requirements, will affect the vehicle scheduling and the final vehicle path. These three delivery characteristics increase the difficulty of model construction and solution of the urban takeaway delivery optimization problem. The time window and delivery requirements appear in pairs and the "pick up first and deliver later" feature mainly affects the vehicle path of takeaway delivery, increasing the difficulty of vehicle path arrangement; the splittable feature of the order mainly affects the order allocation in vehicle scheduling. How to reasonably split the order while taking into account the delivery cost and customer satisfaction requires better and more reasonable vehicle scheduling. Summary of the invention
[0051] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for optimizing the delivery path of urban e-commerce takeaways based on the situation of one order and multiple merchants. In view of the delivery problems faced by takeaway companies in the "one order and multiple merchants" consumption scenario, the present invention proposes to reduce delivery costs and improve customer satisfaction through reasonable vehicle scheduling based on the current consumption characteristics in the "one order and multiple merchants" scenario, and constructs an urban takeaway delivery optimization model. This is a new attempt to solve the problem of takeaway delivery, and it is also very consistent with the needs of current takeaway companies to reduce delivery costs and improve customer satisfaction. The research content of the present invention not only theoretically improves the theoretical system of vehicle paths and takeaway delivery optimization, but also plays an important role in guiding the path of takeaway delivery planning and the scheduling of delivery vehicles, and has certain practical and theoretical significance.
[0052] The objective of the present invention is achieved through the following technical solutions:
[0053] A method for optimizing the delivery path of urban e-commerce takeaways based on the scenario of one order with multiple merchants. One order with multiple merchants refers to a consumption scenario where takeaway customers place orders at different merchants at the same time, including:
[0054] S1. Construct a takeaway delivery optimization model based on delivery path cost, dispatch cost, customer satisfaction loss cost and several constraints. The objective function is to minimize the total cost; the total cost is the sum of the delivery path cost, dispatch cost and customer satisfaction loss cost;
[0055] S2. Set parameters, including acceptance probability h, number of removals N, number of iterations Max_gen, and current generation Gen;
[0056] S3. Generate an initial solution using the mileage saving method and initialize the probabilities of selecting different removal operators and insertion operators. The selection probability of the removal operator is Pyi, and the selection probability of the insertion operator is Pci. Let the local optimal solution be Xc, the global optimal solution be Xb, and the initial solution be Xi. Let Xi→Xc, Xi→Xb;
[0057] S4. The ALNS algorithm is used to continuously remove and reinsert to improve the initial solution. When the new solution is improved or satisfies the solution acceptance rule, the initial solution in the next iteration is replaced by the current new solution, and the iteration is finally completed; the details are as follows:
[0058] S401. Select the removal operator Y currently required to be used to remove N demand points by selecting probability Pyi;
[0059] S402. Select the reinsertion operator C currently needed to be used by selecting the probability Pci to reinsert the removed N demand points into the sequence to obtain the local optimal solution Xc;
[0060] S403. Calculate the local optimal solution value f(Xc) and the optimal value f(Xb), and update the current optimal solution according to the accepted solution rule;
[0061] S404. According to the comprehensive scoring strategy of the ALNS algorithm, the operator combination is evaluated, the selection probability of each operator is obtained, and then updated;
[0062] S405. Determine whether this local optimal solution has appeared in the iteration process. If so, deduct points from the operator combination. If not, add points to the operator combination.
[0063] S406. Determine whether the current number of iterations is greater than the maximum allowed number of iterations. If not, update the number of iterations, Gen→Gen+1, and repeat S401-S406. If so, the iteration terminates.
[0064] Further, in step S1,
[0065] (101) The delivery path length in the delivery path cost is the length of the delivery route that the takeaway delivery person needs to complete all order pick-up and delivery tasks from the current location, x ijk is a 0-1 variable. When it is 1, it means that rider k travels from point i to point j, otherwise it is 0; d ij represents the distance between point i and point j, c0 represents the delivery cost per unit distance; the mathematical expression of the delivery path cost is:
[0066]
[0067] (102) The dispatching cost includes the semi-fixed cost of the rider and the auxiliary support cost;
[0068] The semi-fixed costs of riders include fixed wages and supporting tool costs. The supporting tool costs include tooling costs, training costs, vehicle costs and related equipment costs.
[0069] Auxiliary support costs include technology R&D investment costs, system support costs, relevant personnel participation costs, and advertising and marketing costs;
[0070] C1 represents the dispatching cost, which is the sum of the semi-fixed cost of the rider and the auxiliary support cost. The dispatching cost is positively correlated with the number of riders and vehicles. k is a decision variable, which is 1 if rider k participates in the delivery, otherwise it is 0; its mathematical expression is:
[0071]
[0072] (103) Cost of loss of customer satisfaction
[0073] In the current meal delivery environment where orders can be split, factors that affect customer satisfaction include: the time interval between batch deliveries to the same address and the number of deliveries to the same address by the rider; is the decision variable, represents that order r contains j delivery demand, otherwise it does not contain it; where j∈C n , r∈D m ; F j represents the actual delivery time of order j, represents the time that customers expect to receive order j; the mathematical expression of customer satisfaction loss cost is:
[0074]
[0075] Furthermore, it is characterized in that the objective function of the takeaway delivery optimization model is
[0076]
[0077] The constraints are:
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092] x ijk =0 or 1 (19)
[0093] Among them, V k represents the rider vehicle set, {1, 2, 3..., k}; B n represents the takeaway meal demand set, {1, 2, 3..., n}; C n represents the takeaway delivery demand set, {n+1, n+1, n+3..., 2n}; Dm represents the order set, {1,2,3..., m}; c represents the customer satisfaction loss cost conversion coefficient; Q0 represents the maximum load; q i ,q j A positive value represents the demand corresponding to the delivery demand i and j, and a negative value represents the supply corresponding to the pickup demand i and j; Q i k , Q j k Respectively represent the loading status of rider k at demand points i and j; Respectively represent the time when the i and j demands are completed by rider k, where i∈B n , C n , k∈Vk ; W ij represents the waiting time of the takeaway merchant corresponding to demand i when demand i and demand j are successively satisfied by the same rider, where i, j∈B n , C n ;t k ij represents the time it takes for player k to move from position i to position j, where i,j∈B n , C n ; E i represents the earliest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; L i represents the latest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; M represents a large constant; takeaway merchants are also customers;
[0094] Formula (4) indicates that the total cost of the vehicle is minimized; among them, formula (5) means that each delivery demand must be met; formula (6) means that if each rider's vehicle leaves the distribution center, it must eventually return to the distribution center; formulas (7) and (8) mean that the rider's vehicle can be idle; formula (9) represents the flow conservation restriction; formulas (10) and (11) are one-to-one correspondence constraints for takeaway delivery demands, and takeaway merchants must be visited before takeaway customers; formula (12) indicates that vehicle visits must meet the time window restriction of the demand point; formula (13) represents the vehicle arrival time restriction; formulas (14) and (15) represent the loading constraints of each delivery point of the vehicle; formula (16) records whether k riders have started; formula (17) records the time when the vehicle completes the delivery demand; formula (18) records the earliest visit time of each order.
[0095] Furthermore, in step S3, the process of generating an initial solution using the mileage saving method is as follows:
[0096] First, we select an integer encoding method suitable for the vehicle routing problem. Specifically, we split the orders of takeaway customers by merchants to form N pairs of delivery demands, and then encode the delivery demands by integers in the order in which the riders meet them. The decoding process is the opposite of the encoding process, and we find the corresponding takeaway customers and takeaway merchants based on the corresponding relationship between the demands.
[0097] Next, construct the initial solution. The steps are as follows:
[0098] (405) Assume that D is the set of all takeaway customer demand pairs that have not been assigned vehicles;
[0099] (406) Calculate the minimum insertion cost and the second minimum insertion cost of each customer in D under the time window and load constraints, find the customer pair i with the largest difference between the second minimum insertion cost and the minimum insertion cost, and insert it into the current vehicle. If no customer can be inserted at present, arrange a new vehicle and continue to insert;
[0100] (407) removing the customer pair i found in step (402) from set D;
[0101] (408) If the D set is empty, the initial solution construction is completed, otherwise repeat steps (402) and (403).
[0102] Furthermore, the removal operator includes:
[0103] (1) Random removal operator
[0104] The random removal operator randomly removes a number of customers from the assigned routes and puts them into the removal list. The number of customers to be removed is controlled by the parameter N. A total of N pairs of customers are removed and put into the new list. The specific method is to first select N different delivery points as the objects to be removed, find the corresponding pickup points, remove all N pairs of customers and put them into the list to be inserted, and complete the removal process. The delivery points correspond to takeaway customers, and the pickup points correspond to takeaway merchants.
[0105] (2) Maximum distance removal operator
[0106] The maximum distance removal operator removes the customer combination that causes the largest increase in total distance. The distance of each customer combination is the difference between the total path distance before removal and the total path distance after removal. The number of customers removed is also controlled by the parameter N. Repeat the removal N times and put all removed customers into a new set.
[0107] (3) Path removal operator
[0108] The path removal operator randomly dismantles an already constructed path and adds all customers in the path to the removal set;
[0109] (4) Demand combination similarity removal operator
[0110] The demand similarity removal operator is an operator that removes based on the similarity of demand. First, a demand customer combination is randomly removed from the current solution, and then N-1 customer combinations with the smallest difference in demand size with the customer combination are removed. The final number of removals is determined by the parameter N. The demand similarity removal operator is used to find a set of customers that can be replaced or exchanged with each other. Removing customer points based on demand similarity can speed up the convergence of the algorithm.
[0111] (5) Arrival time window similarity removal operator
[0112] The time window similarity removal operator means first randomly removing a customer, and then removing N-1 customers whose vehicle arrival time at other customers is the smallest different from that at this customer;
[0113] (6) Centralized removal of operators
[0114] The centralized removal operator clusters takeaway customers according to their distance based on their locations, and then randomly removes N takeaway customers from a centralized area, and at the same time removes the takeaway merchants corresponding to the takeaway customers; the number of removals is N; the centralized removal operator requires the pre-design of a centralized area.
[0115] Furthermore, the insertion operator includes:
[0116] (1) Greedy Insertion Operator
[0117] The greedy insertion operator is to calculate the cost required to insert each customer in the removal set, insert the customer with the lowest cost into the partial solution path first, delete the customer from the removal set, and recalculate until the removal set is empty;
[0118] (2) Maximum cost difference insertion operator
[0119] The maximum cost difference insertion operator calculates the minimum cost and the second minimum cost required to insert each customer in the removal set, inserts the customer with the largest cost difference into the path, deletes the customer from the removal set, and recalculates until the removal set is empty.
[0120] Furthermore, in step S404, based on the actual distribution characteristics, a comprehensive scoring method is designed to calculate the score for each operator, and a volatility mechanism is added, so that the proportion of historical scores will become smaller and smaller. The specific design is as follows:
[0121] (1) Operator selection
[0122] Use a mixture of several removal operators and insertion operators for algorithm optimization. Each iteration selects which removal operator and insertion operator to use based on the score. The higher the score, the greater the probability that the operator will be selected. First, select which removal operator to use for removal based on the score, and then select which insertion operator to use for reinsertion.
[0123] (2) Comprehensive scoring method
[0124] The probability of selecting an operator is determined by the operator's score. The higher the operator's score, the easier it is to be selected. C1, C2, and C3 represent both the score bonus and the score level. n (C) represents the score of operator C in the next iteration, f n(Total) represents the sum of the final scores of all removal operators or insertion operators of the same type as operator C in the next iteration, where C1>C2>C3, and n refers to the nth generation; specifically, when the newly obtained solution is better than the historical optimal solution, the score of the removal operator and reinsertion operator currently used is increased by C1; when the new solution is not better than the historical optimal solution but better than the current solution, the score of the removal operator and reinsertion operator currently used is increased by C2; when the new solution is neither better than the historical optimal solution nor the current solution, but it has not appeared in the historical iteration, the score of the removal operator and reinsertion operator currently used is increased by C3, and no score is added in other cases;
[0125] (3) Volatilization mechanism
[0126] The volatility mechanism means that after each iteration, the scores of all operators need to be multiplied by the percentage h, 0 <h<1。
[0127] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for optimizing the delivery path of urban e-commerce food delivery based on a one-order-multiple-merchants scenario are implemented.
[0128] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for optimizing the urban e-commerce takeaway delivery path based on a one-order-to-multiple-merchants scenario.
[0129] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0130] 1. Based on the problems of high delivery costs of urban takeout and low customer satisfaction at the meal pickup end under the current consumption background, the present invention conducts optimization research from the perspective of the platform, analyzes the influencing factors of order allocation and route planning, and constructs a takeout delivery optimization model with splittable orders with time windows, enriching the theoretical model of vehicle routes.
[0131] 2. In view of the complexity of the takeaway delivery model with splittable orders and time windows, a large-scale search algorithm suitable for solving complex problems was selected. Based on the requirements of takeaway delivery for time efficiency, a centralized removal operator was designed, and a fast scoring strategy was introduced to improve the performance of the adaptive large-scale search algorithm. This enriches the research on route optimization of takeaway delivery vehicles and provides an algorithm reference for solving complex problems and models with high time efficiency requirements.
[0132] 3. In order to solve the dual problems of high delivery costs and low customer satisfaction of takeout customers, the present invention combines the relevant characteristics of takeout delivery, conducts theoretical modeling, obtains corresponding solutions, and can make dynamic adjustments according to different actual situations. This solution has certain practical reference significance for reducing delivery costs and improving customer satisfaction.
[0133] Among the meta-heuristics, taboo search is not as good as the large-scale search algorithm in solving complex problems. Therefore, the present invention selects an adaptive large-scale search algorithm to solve the model.
[0134] Based on this, the present invention starts from the platform perspective, takes the lowest delivery cost and the highest customer satisfaction as the goal, combines the delivery characteristics of "one order, multiple merchants", and constructs a pick-up and delivery route optimization model for orders with time windows that can be split. After an algorithm review, the algorithm is selected, and finally an adaptive large-scale search algorithm is used. BRIEF DESCRIPTION OF THE DRAWINGS
[0135] Figure 1.1 It is an order delivery flow chart.
[0136] Figure 1.2 This is a schematic diagram of the delivery demand of riders.
[0137] Figure 1.3 It is a delivery route map that can be split into orders.
[0138] Figure 1.4 It is a pairwise comparison chart of delivery demands.
[0139] Figure 1.5 It is a vehicle delivery route map for “pick up first, deliver later” delivery needs.
[0140] Figure 1.6 It is a delivery route map with time windows.
[0141] Figure 1.7 It is a delivery route map with time windows.
[0142] Figure 2 It is a takeaway delivery route map.
[0143] Figure 3 It is a framework diagram of the improved adaptive large-scale search algorithm.
[0144] Figure 4 It is a schematic diagram of the encoding process.
[0145] Figure 5 It is a schematic diagram of maximum distance removal.
[0146] Figure 6 This is a schematic diagram of path removal.
[0147] Figure 7 It is a schematic diagram of the similarity removal process of requirements.
[0148] Figure 8 It is a schematic diagram of the similarity removal process of arrival time.
[0149] Fig. 9 It is a schematic diagram of the centralized removal process.
[0150] Fig.10 This is a schematic diagram of the greedy insertion process.
[0151] Fig.11 This is a schematic diagram of the maximum cost insertion operator process.
[0152] Fig.12 It is a distribution map of takeaway merchants and users.
[0153] Fig.13 It is a schematic diagram of the city's takeaway delivery routes. DETAILED DESCRIPTION
[0154] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0155] Example 1
[0156] The problem to be solved in the takeaway delivery model studied in the present invention can be summarized as follows: a takeaway delivery platform carries the takeaway delivery task in a certain area. There is a total of 1 delivery station in the area during a certain period of time. The number of riders in the station is unlimited. There are m takeaway orders, and the orders can be split into n sub-orders (delivery requirements) according to the merchants. During the delivery process, in order to complete each sub-order, the rider must first pick up the meal from the corresponding takeaway merchant, and then deliver the meal to the corresponding takeaway customer under the time constraint. After completing the delivery tasks of all assigned sub-orders, return to the delivery station to complete the delivery. Among them, the delivery cost is affected by the number of riders and the total distance traveled by the riders, and customer satisfaction is affected by the number of times the takeaway customer picks up the meal and the time interval between multiple pick-ups.
[0157] The present invention aims to solve the problem of how to allocate n pairs of delivery demands (sub-orders) to appropriate takeaway riders for delivery, and obtain a delivery solution with low delivery cost and high customer satisfaction. The visualization solution of this problem is as follows: Figure 2 shown.
[0158] 1. Problem Assumption
[0159] Takeaway delivery has the characteristics of "pick up first and then deliver", which can be summarized as a pick-up and delivery problem. In this model, the delivery station is used as the distribution center in the pick-up and delivery problem, the takeaway merchant is the pick-up point, and the takeaway customer is the delivery point. The rider continuously picks up and delivers the goods, and finally returns to the station as a complete path. The specific assumptions are as follows:
[0160] (1) Riders need to return to the starting point after completing all tasks;
[0161] (2) The rider first picks up the food from the takeaway merchant and then delivers it to the takeaway customer;
[0162] (3) Takeaway customers can accept delivery services from different riders;
[0163] (4) The delivery speed of the food delivery rider is known;
[0164] (5) The information of the food delivery merchants, riders, and food delivery customers is known and can be obtained after the food delivery platform receives the order request;
[0165] (6) The distance information is known and can be calculated through the coordinate position;
[0166] (7) The rider’s vehicle type is fixed and the load capacity is known. During the delivery process, the sum of customer demands cannot exceed the maximum load capacity.
[0167] (8) Takeaway consumers and takeaway merchants have expected service time windows;
[0168] (9) When a rider completes multiple delivery requests in an order at the same time, the service time will be calculated as one time;
[0169] 2. Parameter Description
[0170] (3) Decision variable description
[0171] X ijz :0-1 variable, X ijz When it is 1, it means that rider z travels from point i to point j, otherwise it is 0.
[0172] 2.1. Objective function description
[0173] This embodiment takes into account the three factors of the delivery route length, the rider's dispatching cost, and customer satisfaction in the process of food delivery from the perspective of the platform and in combination with the characteristics of food delivery. The analysis of these three factors is as follows:
[0174] (1) Delivery route cost
[0175] The length of the delivery route is the length of the delivery route that the food delivery person needs to complete all the order pickup and delivery tasks from the current location. The length of the delivery route affects the average delivery time of orders on the food delivery platform, which in turn affects the delivery efficiency of the crowdsourced food delivery platform. At the same time, the length of the delivery route also affects the delivery cost of the food delivery person. From the perspective of the platform, optimizing the length of the delivery route is to improve the delivery efficiency of the platform on the one hand, and to reduce the delivery cost of the delivery person on the other hand, so as to ensure that the delivery person is provided with a good route planning service experience. ijk It is a 0-1 variable. When it is 1, it means that rider k travels from point i to point j, otherwise it is 0. ij represents the distance between point i and point j, and c0 represents the delivery cost per unit distance. The mathematical expression is:
[0176]
[0177] (2) Dispatch costs
[0178] The high cost of food delivery has always been a problem that has plagued the profitability or expansion of food delivery platforms. In order to more clearly understand the flow of delivery costs and find the key to reducing delivery costs, it is essential to analyze the specific composition of delivery costs. The cost of food delivery dispatch mainly includes the semi-fixed cost of riders and auxiliary support costs. The specific situation is as follows:
[0179] Riders’ semi-fixed costs: include fixed wages and supporting tool costs. Supporting tool costs include tooling costs, training costs, vehicle costs, and related equipment costs.
[0180] Auxiliary support costs: including technology research and development investment costs, system support costs, relevant personnel participation costs, advertising and marketing costs, etc.
[0181] For the convenience of representation, this embodiment uses C1 to represent the dispatch cost, which is the sum of the rider's semi-fixed cost and the auxiliary support cost. The dispatch cost is positively correlated with the number of riders and vehicles. k is a decision variable, which is 1 if rider k participates in the delivery, otherwise it is 0. Its mathematical expression is:
[0182]
[0183] (3) Cost of loss of customer satisfaction
[0184] In the current meal delivery environment where orders can be split, factors that affect customer satisfaction include: the time interval between batch deliveries to the same address and the number of deliveries to the same address by the rider; is the decision variable, represents that order r contains j delivery demand, otherwise it does not contain it. Where j∈C n , r∈Dm ; F j represents the actual delivery time of order j, It represents the time that customers expect order j to be delivered. The mathematical expression of customer satisfaction loss cost is:
[0185]
[0186] 3. Build a takeaway delivery optimization model
[0187] According to the above model parameters and the three factors of the delivery route length, vehicle cost, and the harvest interval at the same address considered by the platform, combined with the takeaway order pairing constraint and the maximum order quantity constraint during the takeaway delivery process, the mathematical expression of the takeaway delivery optimization model of this embodiment is as follows:
[0188] Objective function:
[0189]
[0190] Constraints:
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205] x ijk =0 or 1 (19)
[0206] Among them, V k represents the rider vehicle set, {1, 2, 3..., k}; B n represents the takeaway meal demand set, {1, 2, 3..., n}; C n represents the takeaway delivery demand set, {n+1, n+1, n+3..., 2n}; Dm represents the order set, {1,2,3..., m}; c represents the customer satisfaction loss cost conversion coefficient; Q0 represents the maximum load; q i ,q j A positive value represents the demand corresponding to the delivery demand i and j, and a negative value represents the supply corresponding to the pickup demand i and j; Q i k , Q j k Respectively represent the loading status of rider k at demand points i and j; Respectively represent the time when the i and j demands are completed by rider k, where i∈B n , C n , k∈V k ; W ij represents the waiting time of the takeaway merchant corresponding to demand i when demand i and demand j are successively satisfied by the same rider, where i, j∈B n , C n ;t k ij represents the time it takes for player k to move from position i to position j, where i,j∈B n , C n ; E i represents the earliest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; L i represents the latest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; M represents a large constant; takeaway merchants are also customers;
[0207] Formula (4) of the takeaway delivery optimization model represents the minimum total vehicle cost and customer satisfaction loss cost. Among them, formula (5) means that each delivery demand must be met; formula (6) means that if each rider's vehicle leaves the distribution center, it must eventually return to the distribution center; formulas (7) and (8) mean that the rider's vehicle can be idle; formula (9) represents the flow conservation restriction; formulas (10) and (11) are one-to-one correspondence constraints for takeaway delivery demands, and takeaway merchants must be visited before takeaway customers. Formula (12) vehicle access must meet the time window restriction of the demand point; formula (13) vehicle arrival time restriction; formulas (14) and (15) represent the loading constraints of each delivery point of the vehicle; formula (16) records whether k riders have started; formula (17) records the time when the vehicle completes the delivery demand; formula (18) records the earliest visit time of each order.
[0208] The problem of urban takeaway delivery has the characteristics of splittable orders and paired demands, which is more complex than the classic vehicle routing problem. Since it is necessary to consider the timeliness of delivery, the cost of delivery, and the time interval for delivery to the same address, on the one hand, the distribution center needs to be able to obtain high-quality solutions, and on the other hand, the distribution center needs to be able to respond quickly to order demands. Therefore, this embodiment uses an adaptive large-scale search algorithm suitable for solving complex problems. After introducing the algorithm idea, algorithm framework, removal operator and insertion operator, this embodiment proposes improvements to the algorithm's initial solution, operator design, and solution acceptance rules in combination with the characteristics of urban takeaway delivery. Finally, a standard test case of the delivery and pickup problem was selected for testing to verify the effectiveness of the improved algorithm.
[0209] The Adaptive Large Neighborhood Search heuristic (ALNS) is an improvement on the Large Neighborhood Search heuristic (LNS). Since it was first proposed by Shaw et al. (1998), it has been widely used and has great advantages in solving complex problems.
[0210] The core idea of the adaptive large-scale search algorithm is to improve the initial solution by continuously removing (removal operator) and reinserting (insertion operator). When the new solution is improved or satisfies the solution acceptance rule, the initial solution is replaced by the current new solution in the next iteration. Unlike the large-scale search algorithm, which has only one removal operator and one insertion operator, the adaptive large-scale search algorithm uses multiple removal operators and multiple insertion operators, and dynamically scores the operators according to the historical solution quality. In each iteration, according to the scores of different operators, it dynamically selects which removal operator and which reinsertion operator to use.
[0211] In order to effectively solve the model proposed in this embodiment, this embodiment makes certain improvements to the algorithm. The specific framework is as follows: Figure 3 As shown, the specific solution steps are:
[0212] S1: Set parameters. The parameters that need to be set include acceptance probability h, number of removals N, number of iterations Max_gen, and current generation Gen;
[0213] S2: Initialization. First, the initial solution needs to be generated using the mileage saving method, and the probability of selecting different removal operators and insertion operators needs to be initialized. The selection probability of the removal operator is Pyi, and the selection probability of the insertion operator is Pci. Suppose the current optimal solution is Xc, the optimal solution is Xb, and the initial solution is Xi. Let Xi→Xc, Xi→Xb;
[0214] S3: Iterative process:
[0215] S301: Select the removal operator Y currently required to be used to remove N demand points according to the probability Pyi;
[0216] S302: Select the reinsertion operator C currently needed to be used by probability Pci to reinsert the removed N demand points into the sequence to obtain a new solution Xc;
[0217] S303: Calculate the new solution value f(Xc) and the optimal value f(Xb), and update the current optimal solution according to the solution acceptance rule;
[0218] S304: Evaluate the operator combination according to the comprehensive scoring strategy of the algorithm, obtain the selection probability of each operator, and update it;
[0219] S305: Determine whether the new solution has appeared in the iteration process. If so, deduct points from the operator combination. If not, add points to the operator combination.
[0220] S306: Determine whether the current number of iterations is greater than the maximum allowed number of iterations. If not, update the number of iterations, Gen→Gen+1, repeat S301-S306, if yes, the iteration terminates.
[0221] Specifically, in step S2,
[0222] Algorithm coding is a way to convert the solution space of the urban takeaway delivery problem into a solution space that the algorithm can handle. Algorithm coding is the first step that needs to be solved in algorithm design, and it is also a key step. Different coding methods have a certain impact on the speed and quality of solution.
[0223] Since the delivery routes of takeout food are arranged in discrete order, this embodiment selects an integer encoding method suitable for the vehicle routing problem. The specific method is: split the orders of takeout customers by merchants to form N pairs of delivery requirements, and then encode the delivery requirements by integers according to the order in which the riders meet them. For example, there are 2 orders in a region, 3 takeout merchants, and 2 takeout customers, forming a total of 4 pairs (8) of delivery requirements. The specific information and encoding are as follows: Figure 4 The coded numbers mean: 0 represents the distribution station, 1-4 are the pick-up demand numbers, 5-8 are the delivery demand numbers, and the order of arrangement represents the order in which the demands are met.
[0224] The decoding process is the opposite of the encoding process. It is necessary to find the corresponding takeaway customers and takeaway merchants based on the corresponding relationship between the needs. Figure 4 Decoded as: Site-B1-B2-C1-C1-B2-B3-C2-C2-Site.
[0225] Initial solution construction: Different from the population algorithm, the adaptive large-scale search algorithm only needs one initial solution, and iterative optimization is performed from one initial solution. Therefore, a good initial solution is conducive to the convergence speed of the optimization algorithm. In order to obtain a better initial solution, this embodiment draws on the parsimony method proposed by Clarke et al. (1964). The specific construction method is as follows:
[0226] (1) Assume that D is the set of all takeaway customer demand pairs that have not been assigned vehicles;
[0227] (2) Calculate the minimum insertion cost and the second minimum insertion cost for each customer in D under the time window and load constraints, find the customer pair i with the largest difference between the second minimum insertion cost and the minimum insertion cost, and insert it into the current vehicle. If no customer can be inserted at the moment, arrange a new vehicle and continue to insert;
[0228] (3) Remove the customer pair i found in (2) from set D;
[0229] (4) If the set D is empty, the initial solution construction is completed; otherwise, repeat steps (2) and (3).
[0230] Specifically, the removal operator in step S2 is as follows:
[0231] The removal operator is one of the two most important operators in the adaptive large-scale search algorithm, which affects the global exploration ability and local search ability of the algorithm and can be said to be the key to the optimization of the algorithm. Using different removal operators for different processes can effectively improve the algorithm. There are six removal operators used in this embodiment, among which the centralized removal operator is an improved operator proposed in combination with the characteristics of the concentration of takeaway customers in the current takeaway scenario, as follows:
[0232] (1) Random removal operator
[0233] The random removal operator randomly removes customers from the assigned path and puts them into the removal list. The number of removals is controlled by the parameter N, and a total of N pairs of customers are removed and put into the new list. The specific method is to first select N different delivery points (takeaway customers) as the objects to be removed, find the corresponding pickup points (takeaway merchants), remove all N pairs of customers and put them into the list to be inserted, and complete the removal process. Due to the random characteristics of this operator, the diversity of solutions is increased, which can effectively improve the global search ability of the algorithm.
[0234] (2) Maximum distance removal operator
[0235] The maximum distance removal operator removes the customer combination that causes the largest increase in total distance. The distance of each customer combination is the difference between the total path distance before removal and the total path distance after removal, such as Figure 5 As shown in the figure, the left side is the path before removal, and the right side is the path after removing customer combination 1. The removal distance of customer combination 1 is the difference between the lengths of the two paths. The removal distances of the remaining customer combinations are calculated in turn, sorted from large to small, and the customer with the largest removal distance is selected for removal (right side). The number of removed customers is also controlled by the parameter N. Repeat the removal N times and put all removed customers into the new set.
[0236] (3) Path removal operator
[0237] The path removal operator randomly dismantles a constructed path and adds all customers in the path to the removal set. Figure 6 As shown, the left side is the initial vehicle path. Through the path removal operator, the path R2 is selected for removal, and the right side is the path after removal.
[0238] (4) Demand combination similarity removal operator
[0239] The demand similarity removal operator is an operator that removes based on the similarity of demand. First, a demand customer combination is randomly removed from the current solution, and then N-1 customer combinations that are similar to this customer combination in terms of demand combination are removed. Figure 7As shown in the figure, assuming that the demand of customer 1 is 25, the demand of customer 2 is 30, the demand of customer 3 is 15, and the demands of customers 4 and 5 are 10 and 40 respectively, when the operator first removes customer combination 1, since the demand of customer 1 is similar to that of customer 3, customer combination 3 will also be removed, and the final number of removals is determined by the parameter N. The main purpose of this operator is to find a set of customers that can be replaced or exchanged with each other. Removing customer points by similar demand can also speed up the convergence of the algorithm.
[0240] (5) Arrival time window similarity removal operator
[0241] The time window similarity removal operator is similar to the demand similarity removal operator. It first randomly removes a customer, and then removes N-1 customers whose vehicle arrival time is similar to that of the customer. Figure 8 As shown in the figure, the arrival time of customer combination 1 and 3 is close, so when customer combination 1 is removed first, customer combination 3 will also be removed. This operator has similar functions to the demand removal operator and is a supplement to the demand removal operator. It can also speed up the convergence of the algorithm.
[0242] (6) Centralized removal of operators
[0243] Different from the removal operator in the basic design of the algorithm, the concentrated removal operator is a new operator proposed in this embodiment based on the characteristic that the distribution of takeaway customers is concentrated. The concentrated distribution of takeaway customers means that in actual delivery, vehicles are prone to cross at the same address, and takeaway customers at the same address are prone to be integrated.
[0244] The specific approach is to cluster takeaway customers according to their location and distance, and then randomly remove N takeaway customers in a concentrated area, and at the same time remove the takeaway merchants corresponding to the takeaway customers. Fig. 9 As shown in the figure, takeaway customers 2 and 3 belong to area A. The left side is the initial path, and the right side is the partial solution obtained after removing customer combination 2 and customer combination 3 in area A. The probability of each customer in area A being removed is equal, and the number of removals depends on the setting of parameter N. The centralized removal operator requires the pre-design of the centralized area and is a smaller-scale random removal operator.
[0245] Specifically, the insertion operator in step S2 is as follows:
[0246] The insertion operator is also one of the two most important operators of the adaptive large-scale search algorithm. Its main function is to reinsert the removed customer set into the path according to certain rules. Different reinsert methods will directly affect the quality of the solution. There are two insertion operators used in this embodiment, as follows:
[0247] (1) Greedy Insertion Operator
[0248] The specific design of the greedy insertion operator is as follows: Calculate the cost required for inserting each customer in the removal set, insert the customer with the minimum cost first into the partial solution path, delete this customer from the removal set, and recalculate until the removal set is empty. Taking Fig.10 as an example, first obtain the partial solution and the set to be inserted after the removal operator processes. Calculate the cost of each customer in the set to be inserted at each insertion position in the partial solution. After comparison, select the customer with the minimum insertion cost as 5, and the minimum insertion position is between 5 and 3. Insert 5 in the set between 6 and 3 in the partial solution to form a new partial solution and the set to be inserted. Repeat the above steps until the set to be inserted is an empty set.
[0249] (2) The maximum cost difference insertion operator
[0250] The specific design of the maximum cost difference insertion operator is as follows: Calculate the minimum cost and the second minimum cost required for inserting each customer in the removal set, insert the customer with the largest cost difference into the path, delete this customer from the removal set, and recalculate until the removal set is empty. Taking Fig.11 as an example, after obtaining the partial solution and the set to be inserted, first calculate the insertion cost of the customers in the set to be inserted at all positions in the partial solution. Then, for each customer, calculate the difference between its second minimum and minimum insertion costs. The customer with the smallest difference is the customer to be inserted this time, and its minimum cost insertion position is its insertion position. Perform the insertion to form a new partial solution and the set to be inserted. Repeat the above until the set to be inserted is an empty set.
[0251] In addition, the rule for accepting solutions affects the diversity of algorithm solutions and the direction of solution optimization. To ensure the diversity of algorithm solutions, this embodiment uses a probability to accept new solutions. The specific operation is as follows: When the new solution is better than the current solution, accept the new solution; when the new solution is not better than the current solution, accept the new solution according to the probability f, where 0 < f < 1. The probability f has nothing to do with the current iteration number and is related to the difference between the new solution and the current solution. The specific setting needs to be determined through example tests.
[0252] Specifically, the design in step S304 has an algorithm optimization strategy:
[0253] Since food delivery in actual distribution not only requires a reasonable delivery route but also needs to respond to orders quickly, that is, food delivery has requirements for both the solution quality and the solution speed. Therefore, this embodiment combines the characteristics of food delivery in the current reality and makes corresponding improvements to the adaptive large-scale search algorithm. By changing the simulated annealing framework to accept worse solutions with the same probability and adding two centralized removal operators to improve the algorithm convergence and speed up the solution speed; by designing a comprehensive scoring method to score the performance of the operator to improve the algorithm solution quality. This section introduces the improvement strategies adopted by the algorithm.
[0254] Since different operators play different roles in different stages of the algorithm, it is necessary to dynamically adjust the probability of selecting each operator each time. The adaptive adjustment mechanism is a way to adjust the probability of each operator being selected through an adaptive method. Based on the characteristics of actual distribution, this embodiment designs a comprehensive evaluation scoring method to calculate the score for each operator and adds a volatility mechanism. The proportion of historical scores will become smaller and smaller. The specific design is as follows:
[0255] (1) Operator selection
[0256] In order to avoid using one operator and causing the algorithm to fall into a local optimum too early, this embodiment uses a mixture of multiple removal and insertion operators for algorithm optimization, and each iteration selects which removal operator and insertion operator to use according to the score. The higher the score, the greater the probability that the operator is selected. First, the removal operator is selected according to the score for removal, and then the insertion operator is selected for reinsertion.
[0257] (2) Comprehensive scoring method
[0258] The probability of selecting an operator is determined by the operator's score. The higher the operator's score, the easier it is to be selected. As shown in Table 2, C1, C2, and C3 represent both the score bonus and the score level. n (C) represents the score of operator C in the next iteration (nth generation), f n (Total) represents the final score sum of all removal operators or insertion operators of the same type as operator C in the next iteration (nth generation), where C1>C2>C3. The specific explanation is: when the new solution is better than the historical optimal solution, the score of the removal operator and reinsertion operator currently used increases by C1; when the new solution is not better than the historical optimal solution but better than the current solution, the score of the removal operator and reinsertion operator currently used increases by C2; when the new solution is neither better than the historical optimal solution nor the current solution, but it has not appeared in the historical iteration, the score of the removal operator and reinsertion operator currently used increases by C3, and no score is added in other cases.
[0259] Table 2 Comprehensive scoring of operator C
[0260]
[0261] (3) Volatilization mechanism
[0262] The volatility mechanism is similar to the pheromone volatility in the ant colony algorithm. Each iteration has a certain degree of reduction in the impact of the historical solution effect on the probability of current operator selection, which has a significant effect on expanding the diversity of solutions and improving the algorithm solution effect. The volatility mechanism under the adjustment mechanism means that after each iteration, the scores of all operators need to be multiplied by the percentage h, 0 <h<1。
[0263] In order to verify the effectiveness of the adaptive large-scale search algorithm in solving the takeaway delivery problem, this embodiment tests the effectiveness of the algorithm. This embodiment has no literature on the multi-objective pickup and delivery problem with splittable requirements. 56 test sets of the pickup and delivery problem standard with time windows similar to the model are selected, and compared with the currently published optimal solutions and shortest solution times. The results are analyzed, and the effectiveness of the algorithm is finally verified.
[0264] In order to test whether the algorithm used in this embodiment can effectively solve the problem of urban food delivery, this embodiment uses the PDPTW Benchmark example and the published optimal solution. The example comes from http: / / www.sintef.no / projectweb / TOP / Problems / PDPTW , and combined with traditional large-scale search algorithms for test evaluation. The examples include 3 categories, namely Lc, Lr and Lrc. In the example Lc, the customer locations are clustered, in the example Lr, the customer locations are randomly distributed, and in the example Lrc, the customer locations are randomly and mixedly distributed. There are 56 test sets in total, each of which contains 100 demand points. These benchmark data and optimal solutions are downloaded.
[0265] Considering that the food delivery problem is different from the standard pickup and delivery problem, this embodiment makes some improvements to the standard test set. The test problem can be described as follows: There is an existing food delivery platform that provides food pickup and meal delivery services to different food delivery merchants and food delivery customers through the same vehicle. The locations of food delivery merchants and food delivery customers are randomly generated within a rectangle with a side length of 10 kilometers. The same food delivery customer may have demands for multiple different food delivery merchants. Therefore, in order to test the algorithm for solving this problem with the standard pickup and delivery test set, 5 cross-merchant orders are randomly inserted on the basis of the test set data, and each order contains a food delivery customer and five food delivery merchants.
[0266] Considering that the concentrated demand points in the standard delivery test are generated in a rectangle with a side length of 100 kilometers, the delivery cost is 1 yuan / km, but there is no departure cost and customer satisfaction conversion cost. Therefore, in order to facilitate the solution, the driving and delivery cost and departure cost of the delivery tram in the actual situation of takeout were converted. The final driving cost was set to 1 yuan / m, the departure cost was set to 20 yuan / vehicle, and the customer satisfaction loss cost conversion coefficient c was set to a constant 1.
[0267] 1. Algorithm parameter settings
[0268] The ALNS algorithm used in this embodiment includes a total of 14 parameters. Through a large number of experiments, the parameter values with better effects are found, which are as follows:
[0269] i) Remove the number of customer requirements N = 20;
[0270] ii) Select a score that is better than the historical best value, C1=33;
[0271] iii) C2=9 which is better than the current solution;
[0272] iv) Worse than the current solution, but the final solution is accepted C3=13;
[0273] v) fractional decay weight h = 0.5;
[0274] vi) Maximum number of iterations max_gen = 500;
[0275] 2. Comparative analysis of results
[0276] This embodiment mainly tests the effectiveness of the algorithm from two aspects: algorithm solution quality and algorithm solution speed. The algorithm runs and solves each test set 10 times, with 500 generations of iterations each time. The results are retained to two decimal places. The average optimal solution and average running time of ten runs are compared with the solution results of the traditional large-scale search algorithm. Among them, the results obtained by the improved ALNS in 44 test sets are not inferior to those of the traditional large-scale search algorithm. The maximum GAP value (the gap between the optimal solutions) of each test set of the two does not exceed 7.51%. The average solution time distribution is relatively uniform, and is less affected by different test sets. The total average time used to obtain the optimal solution is one-third of that of the traditional large-scale search algorithm. The specific results are shown in Table 3:
[0277] Table 3. Test results of the delivery data set
[0278]
[0279]
[0280] Table 3. Test results of delivery data set (continued)
[0281]
[0282] Note: GAP% indicates the optimization percentage of the improved ALNS in this embodiment compared with the traditional large-scale search algorithm.
[0283] (1) Comparison of algorithm solution results
[0284] In terms of solution results, the adaptive large-scale search algorithm was able to obtain the optimal solution in 44 out of 56 test sets. Compared with the algorithm used by the traditional large-scale search algorithm, the improved adaptive large-scale search algorithm can obtain the same or better solutions, and has obvious advantages in solution quality.
[0285] From the perspective of solving the three-class test set, the adaptive large-scale search algorithm has particularly good optimization results in the Lc cluster test set, which is in line with the optimization goals and expectations of the algorithm design (in takeaway delivery, takeaway customers and takeaway merchants are concentrated). The algorithm is suitable for solving clustered pickup and delivery problems and has a certain degree of effectiveness in terms of solution quality.
[0286] In terms of solution speed, the average solution time distribution of the adaptive large-scale search algorithm in solving 56 test sets is relatively uniform, and is less affected by different test sets. The total average time used to obtain the optimal solution is one-third of that of the traditional large-scale search algorithm, which verifies that the algorithm has certain advantages in solution speed.
[0287] (2) Analysis of the impact of different scales on algorithms
[0288] In order to better study the impact of customer scale on cost, delivery interval, and delivery times, this embodiment selects the lc106, lc206, and lc406 test sets with customer scales of 100, 200, and 400, respectively, and mainly studies the performance of the model of this embodiment on customers of different scales. According to the model of this embodiment, the specific situation is shown in Table 4:
[0289] Table 4 Results of different customer sizes
[0290]
[0291] It can be observed from Table 4 that the larger the customer scale, the higher the cost, the smaller the delivery time difference, and the smaller the delivery times. The customer scale has a certain impact on all three. In-depth analysis found that the cost reduction ratio is higher than the scale expansion ratio. The customer scale has economies of scale for all three, and the algorithm solution effect is in line with expectations.
[0292] In summary, the test results of the algorithm in the test set are in line with realistic expectations and have certain effectiveness. At the same time, compared with the traditional large-scale search algorithm, the adaptive large-scale search algorithm used in this embodiment has certain effectiveness in solving the pickup and delivery problem in terms of solution quality and solution speed, and has certain applicability to examples of different scales, and performs better for concentrated distributed examples, which is suitable for solving this problem.
[0293] Example 2
[0294] This example first introduces the background and distribution model of Company M, and then sets the corresponding distribution location distribution, time window, demand, demand matching, service time and other data by investigating market data. Finally, by modeling the problem and solving it, it provides result analysis for the development of Company M and verifies the practicality of the algorithm.
[0295] This embodiment takes the city takeaway delivery of M Company as an example, and studies its delivery data in Nankai District, Tianjin. M Company is a company responsible for takeaway delivery scheduling. It has a large domestic business scale and has become one of the two major companies in my country's takeaway delivery industry. The takeaway industry is an industry with a low entry threshold. In order to better seize the market, most takeaway companies improve their competitiveness by reducing delivery costs and improving customer satisfaction.
[0296] Company M is aware of the particularity of food delivery (short-distance delivery). In order to reduce delivery costs, it has decided to optimize vehicle resources (vehicle costs) and vehicle driving and delivery costs as total costs. At the same time, it is aware that there is still room for improvement in customer service quality at the same address, so it has decided to improve the delivery experience at the same address. Fig.12 As shown in the figure, a takeaway delivery station of Company M is located in Nankai District, which is responsible for meeting the order needs in the nearby area. There are 10 merchants in the area, represented by B1-B10 in the figure, and 20 takeaway customers, represented by C1-C20 in the figure. The specific distribution is as follows Fig.12 .
[0297] 1. Related dataset information
[0298] This embodiment takes Company M as the research object and collects information related to the takeaway market, mainly including vehicle information, takeaway merchant-related data, and takeaway customer-related data, specifically including geographic location information, order demand information, matching demand information, and time window information.
[0299] 1. Vehicle information
[0300] Company M has only one departure center in Nankai District. The detailed information of each vehicle in the departure center is shown in Table 5:
[0301] Table 5 Vehicle information table
[0302]
[0303] 2. Location and time window related information
[0304] For the convenience of representation, after sorting out the longitude and latitude of each customer's location, this embodiment converts the longitude and latitude into horizontal and vertical coordinates. The specific sorted data is shown in Table 6.
[0305] Table 6 Takeaway location and time window information
[0306]
[0307]
[0308] 3. Order Information
[0309] Takeaway customers have different demands for different merchants, as shown in Table 7:
[0310] Table 7 Order Requirement Table
[0311]
[0312]
[0313] 4. Delivery matching demand information
[0314] The specific pairing of takeaway merchants and takeaway customers is shown in Table 8:
[0315] Table 8 Takeaway transport pairing information table
[0316]
[0317] Table 8 Takeaway transport pairing information table (continued)
[0318]
[0319] 2. Analysis of Solution Results of This Example
[0320] In order to verify the effectiveness of the algorithm and model, this embodiment uses a real case of a food delivery company for testing. The large-scale search algorithm used in this embodiment is implemented in Matlab, with a maximum number of iterations of 200, and the specific parameters are as described in the previous chapter.
[0321] According to the vehicle information, order information, and geographic location information of the M takeaway company, this embodiment uses an improved adaptive large-scale search algorithm to solve the problem. The final optimization result is shown in Table 9:
[0322] Table 9 Takeaway delivery route situation
[0323]
[0324]
[0325] In Table 9, C1-C20 represent takeaway customers, B1-B10 represent takeaway merchants, D represents the dispatch center, and C18-C18 in the path represents that the delivery needs of 18 takeaway customers are met at the same time.
[0326] from Fig.13It can be seen that each location in the takeaway delivery path is the intersection of many paths. The reason is that in the current delivery environment, takeaway customers and takeaway merchants are allowed to visit multiple times. At the same time, there are many intersections of vehicle paths. This is because the optimization goal of this embodiment is no longer the traditional one that only considers reducing the driving and delivery cost, but also considers the dispatching cost. Compared with the driving consumption cost, the vehicle resource cost is higher, and reducing the dispatching cost has a more obvious effect on reducing the total cost.
[0327] In order to verify the effectiveness of the takeaway delivery optimization method based on "one order, multiple merchants", this embodiment compares the driving delivery cost, departure cost, number of deliveries for the same order, and time interval for deliveries for the same order in the optimization results with the traditional takeaway delivery optimization method, where the traditional takeaway delivery is a method of reducing costs and increasing efficiency by reducing driving delivery costs. Since the case used in this embodiment is relatively small, in order to make the results more intuitive, the specific results are compared with the single average, and the results are retained to 3 decimal places. The specific comparison results are shown in Table 10.
[0328] Table 10 Comparison results with traditional methods
[0329]
[0330] As can be seen from Table 10, although the takeaway delivery optimization method based on "one order, multiple merchants" is not as good as the traditional takeaway delivery method in terms of driving delivery cost, it is still better than the traditional method in terms of total cost due to the successful reduction of the dispatch cost; at the same time, the number of deliveries and the time interval between deliveries related to customer satisfaction at the same address are better than the traditional takeaway delivery method. Therefore, compared with the traditional takeaway delivery optimization method (with the goal of reducing driving delivery costs), the takeaway delivery optimization method based on "one order, multiple merchants" provided by the present invention has better practicality, which can help enterprises improve customer satisfaction, reduce delivery costs, and thus improve competitiveness.
[0331] Preferably, the embodiment of the present application also provides a specific implementation of an electronic device capable of implementing all steps in the method for optimizing the delivery path of an urban e-commerce takeaway based on a one-order-multiple-business scenario in the above embodiment, and the electronic device specifically includes the following contents:
[0332] Processor, memory, communications interface and bus;
[0333] Among them, the processor, memory, and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between related devices such as server-side devices, metering devices, and user-side devices.
[0334] The processor is used to call the computer program in the memory, and when the processor executes the computer program, it implements all the steps in the urban e-commerce takeaway delivery path optimization method based on the one-order-multiple-merchants scenario in the above-mentioned embodiment.
[0335] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method for optimizing the delivery path of urban e-commerce takeaway food based on a one-order-to-multiple-merchants scenario in the above-mentioned embodiments. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps of the method for optimizing the delivery path of urban e-commerce takeaway food based on a one-order-to-multiple-merchants scenario in the above-mentioned embodiments are implemented.
[0336] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0337] Although the present application provides method operation steps such as embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0338] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0339] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0340] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0341] The present invention is not limited to the embodiments described above. The above description of the specific embodiments is intended to describe and illustrate the technical solution of the present invention. The above specific embodiments are merely illustrative and not restrictive. Without departing from the scope of the present invention and the scope of protection of the claims, a person of ordinary skill in the art can also make many forms of specific changes under the guidance of the present invention, which all fall within the scope of protection of the present invention.
Claims
1. A method for optimizing the delivery path of urban e-commerce takeaways based on the scenario of one order and multiple merchants. One order and multiple merchants refers to a consumption scenario where takeaway customers place orders from different merchants at the same time, characterized in that: include: S1. Based on the delivery path cost, dispatch cost, customer satisfaction loss cost and several constraints, a takeaway delivery optimization model is constructed. The objective function is to minimize the total cost. The total cost is the sum of the delivery path cost, dispatch cost and customer satisfaction loss cost. It includes: (101) The delivery path length in the delivery path cost is the length of the delivery route that the takeaway delivery person needs to complete all order pick-up and delivery tasks from the current location, x ijk is a 0-1 variable. When it is 1, it means that rider k travels from point i to point j, otherwise it is 0; d ij represents the distance between point i and point j, c0 represents the delivery cost per unit distance; the mathematical expression of the delivery path cost is: (102) The dispatching cost includes the semi-fixed cost of the rider and the auxiliary support cost; The semi-fixed costs of riders include fixed wages and supporting tool costs. The supporting tool costs include tooling costs, training costs, vehicle costs and related equipment costs. Auxiliary support costs include technology R&D investment costs, system support costs, relevant personnel participation costs, and advertising and marketing costs; C1 represents the dispatching cost, which is the sum of the semi-fixed cost of the rider and the auxiliary support cost. The dispatching cost is positively correlated with the number of riders and vehicles. k is a decision variable, which is 1 if rider k participates in the delivery, otherwise it is 0; its mathematical expression is: (103) Cost of loss of customer satisfaction In the current meal delivery environment where orders can be split, factors that affect customer satisfaction include: the time interval between batch deliveries to the same address and the number of deliveries to the same address by the rider; r j is the decision variable, Z r j =1, indicating that order r includes j delivery demand, otherwise it does not include it; where j∈C n , r∈D m ; F j represents the actual delivery time of meal delivery demand j, and Ejmin represents the expected delivery time of meal delivery demand j by customers; the mathematical expression of customer satisfaction loss cost is: The objective function of the takeaway delivery optimization model is The constraints are: Among them, V k represents the rider vehicle set, {1, 2, 3..., k}; B n represents the takeaway meal demand set, {1, 2, 3..., n}; C n represents the takeaway food delivery demand set, {n+1, n+1, n+3...,2n}; D m represents the order set, {1,2,3...,m}; c represents the customer satisfaction loss cost conversion coefficient; Q0 represents the maximum load; q j A positive value represents the demand corresponding to the meal delivery demand j, and a negative value represents the supply corresponding to the meal pickup demand j; Q i k , Q j k Respectively represent the loading status of rider k at demand points i and j; T i k 、T j k Respectively represent the time when the i and j demands are completed by rider k, where i∈B n , C n , k∈V k ; W ij represents the waiting time of the takeaway merchant corresponding to demand i when demand i and demand j are successively satisfied by the same rider, where i, j∈B n , C n ;t k ij represents the time it takes for player k to move from position i to position j, where i,j∈B n , Cn; Ei represents the earliest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; Li represents the latest service time of the takeaway merchant corresponding to the i demand, where i∈B n , C n ; M represents a large constant; takeaway merchants are also customers; Formula (4) indicates that the total cost of the vehicle is minimized; among them, formula (5) indicates that each delivery demand must be met; formula (6) indicates that if each rider's vehicle leaves the distribution center, it must eventually return to the distribution center; formulas (7) and (8) indicate that the rider's vehicle can be idle; formula (9) indicates the flow conservation restriction; formulas (10) and (11) indicate that the one-to-one correspondence constraints of takeaway delivery demands are met, and the takeaway merchants must be visited before the takeaway customers; formula (12) indicates that the vehicle visit must meet the time window restriction of the demand point; formula (13) indicates the vehicle arrival time restriction; formulas (14) and (15) indicate the loading constraints of each delivery point of the vehicle; formula (16) records whether k riders have started; formula (17) records the time when the vehicle completes the delivery demand; formula (18) records the earliest visit time of each order; S2. Set parameters, including acceptance probability h, number of removals N, number of iterations Max_gen, and current generation Gen; S3. Generate an initial solution using the mileage saving method and initialize the probabilities of selecting different removal operators and insertion operators. The selection probability of the removal operator is Pyi, and the selection probability of the insertion operator is Pci. Let the local optimal solution be Xc, the global optimal solution be Xb, and the initial solution be Xi. Let Xi→Xc, Xi→Xb; S4. The ALNS algorithm is used to continuously remove and reinsert to improve the initial solution. When the new solution is improved or satisfies the solution acceptance rule, the initial solution in the next iteration is replaced by the current new solution, and the iteration is finally completed; the details are as follows: S401. Select the removal operator Y currently required to be used to remove N demand points by selecting probability Pyi; S402. Select the reinsertion operator C currently needed to be used by selecting the probability Pci to reinsert the removed N demand points into the sequence to obtain the local optimal solution Xc; S403. Calculate the local optimal solution value f(Xc) and the optimal value f(Xb), and update the current optimal solution according to the accepted solution rule; S404. According to the comprehensive scoring strategy of the ALNS algorithm, the operator combination is evaluated, the selection probability of each operator is obtained, and then updated; S405. Determine whether this local optimal solution has appeared in the iteration process. If so, deduct points from the operator combination. If not, add points to the operator combination. S406. Determine whether the current number of iterations is greater than the maximum allowed number of iterations. If not, update the number of iterations, Gen→Gen+1, and repeat S401-S406. If so, the iteration terminates.
2. According to claim 1, a method for optimizing the delivery path of an urban e-commerce takeaway based on a one-order-multiple-business scenario, characterized in that: In step S3, the process of generating an initial solution using the mileage saving method is as follows: First, we select an integer encoding method suitable for the vehicle routing problem. Specifically, we split the orders of takeaway customers by merchants to form N pairs of delivery demands, and then encode the delivery demands by integers in the order in which the riders meet them. The decoding process is the opposite of the encoding process, and we find the corresponding takeaway customers and takeaway merchants based on the corresponding relationship between the demands. Next, construct the initial solution. The steps are as follows: (401) Assume that D is the set of all takeaway customer demand pairs that have not been assigned vehicles; (402) Calculate the minimum insertion cost and the second minimum insertion cost of each customer in D under the time window and load constraints, find the customer pair i with the largest difference between the second minimum insertion cost and the minimum insertion cost, and insert it into the current vehicle. If no customer can be inserted at present, arrange a new vehicle and continue to insert; (403) removing the customer pair i found in step (402) from set D; (404) If the D set is empty, the initial solution construction is completed, otherwise repeat steps (402) and (403).
3. According to claim 1, a method for optimizing the delivery path of an urban e-commerce takeaway based on a one-order-multiple-business scenario, characterized in that: The removal operator includes: (1) Random removal operator The random removal operator randomly removes a number of customers from the assigned routes and puts them into the removal list. The number of customers to be removed is controlled by the parameter N. A total of N pairs of customers are removed and put into the new list. The specific method is to first select N different delivery points as the objects to be removed, find the corresponding pickup points, remove all N pairs of customers and put them into the list to be inserted, and complete the removal process. The delivery points correspond to takeaway customers, and the pickup points correspond to takeaway merchants. (2) Maximum distance removal operator The maximum distance removal operator removes the customer combination that causes the largest increase in total distance. The distance of each customer combination is the difference between the total path distance before removal and the total path distance after removal. The number of customers removed is also controlled by the parameter N. Repeat the removal N times and put all removed customers into a new set. (3) Path removal operator The path removal operator randomly dismantles an already constructed path and adds all customers in the path to the removal set; (4) Demand combination similarity removal operator The demand similarity removal operator is an operator that removes based on the similarity of demand. First, a demand customer combination is randomly removed from the current solution, and then N-1 customer combinations with the smallest difference in demand size with the customer combination are removed. The final number of removals is determined by the parameter N. The demand similarity removal operator is used to find a set of customers that can be replaced or exchanged with each other. Removing customer points based on demand similarity can speed up the convergence of the algorithm. (5) Arrival time window similarity removal operator The time window similarity removal operator means first randomly removing a customer, and then removing N-1 customers whose vehicle arrival time at other customers is the smallest different from that at this customer; (6) Centralized removal of operators The centralized removal operator clusters takeaway customers according to their distance based on their locations, and then randomly removes N takeaway customers from a centralized area, and at the same time removes the takeaway merchants corresponding to the takeaway customers; the number of removals is N; the centralized removal operator requires the pre-design of a centralized area.
4. According to claim 1, a method for optimizing the delivery path of an urban e-commerce takeaway based on a one-order-multiple-business situation, characterized in that: The insertion operator includes: (1) Greedy Insertion Operator The greedy insertion operator is to calculate the cost required to insert each customer in the removal set, insert the customer with the lowest cost into the partial solution path first, delete the customer from the removal set, and recalculate until the removal set is empty; (2) Maximum cost difference insertion operator The maximum cost difference insertion operator calculates the minimum cost and the second minimum cost required to insert each customer in the removal set, inserts the customer with the largest cost difference into the path, deletes the customer from the removal set, and recalculates until the removal set is empty.
5. According to claim 1, a method for optimizing the delivery path of an urban e-commerce takeaway based on a one-order-multiple-business scenario, characterized in that: In step S404, based on the actual distribution characteristics, a comprehensive scoring method is designed to calculate the score for each operator, and a volatility mechanism is added, so that the proportion of historical scores will become smaller and smaller. The specific design is as follows: (1) Operator selection Use a mixture of several removal operators and insertion operators for algorithm optimization. Each iteration selects which removal operator and insertion operator to use based on the score. The higher the score, the greater the probability that the operator will be selected. First, select which removal operator to use for removal based on the score, and then select which insertion operator to use for reinsertion. (2) Comprehensive scoring method The probability of selecting an operator is determined by the operator's score. The higher the operator's score, the easier it is to be selected. C1, C2, and C3 represent both the score bonus and the score level. n (C) represents the score of operator C in the next iteration, f n (Total) represents the sum of the final scores of all removal operators or insertion operators of the same type as operator C in the next iteration, where C1>C2>C3, and n refers to the nth generation; specifically, when the newly obtained solution is better than the historical optimal solution, the score of the removal operator and reinsertion operator currently used is increased by C1; when the new solution is not better than the historical optimal solution but better than the current solution, the score of the removal operator and reinsertion operator currently used is increased by C2; when the new solution is neither better than the historical optimal solution nor the current solution, but it has not appeared in the historical iteration, the score of the removal operator and reinsertion operator currently used is increased by C3, and no score is added in other cases; (3) Volatilization mechanism The volatility mechanism means that after each iteration, the scores of all operators need to be multiplied by the percentage h, 0 <h<1。 6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for optimizing the urban e-commerce takeaway delivery path based on a one-order-multiple-merchants scenario as described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for optimizing the delivery path of urban e-commerce food delivery based on a one-order-multiple-merchants scenario as described in any one of claims 1 to 5 are implemented.
