A multi-logistics vehicle service scheduling optimization method and device based on a multi-information matrix ant colony system
By using a multi-pheromone matrix ant colony system, efficient optimization of logistics vehicle service scheduling is achieved, solving the problem of insufficient path preference in the scheduling of multiple logistics vehicles in the existing ant colony system algorithm, and improving the accuracy and efficiency of the scheduling scheme.
Patent Information
- Application Number
- CN202610211642.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-13
- Publication Date
- 2026-07-03
Smart Images

Figure CN122335128A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of logistics scheduling optimization technology, and in particular relates to a method and apparatus for scheduling optimization of multi-logistics vehicle services based on a multi-pheromone matrix ant colony system. Background Technology
[0002] Driven by the wave of Internet of Things (IoT) technology, the number of logistics service scheduling tasks has increased dramatically, and modern logistics scheduling optimization methods are developing towards greater intelligence. Multi-vehicle collaborative services have become the norm in the field of logistics scheduling, involving both the optimization of logistics task allocation and the optimization of the service sequence of logistics tasks.
[0003] Ant colony optimization (ACO) algorithms are highly efficient at solving complex scheduling tasks and have therefore been applied to the field of multi-vehicle service scheduling optimization. However, current research on ACO algorithms often uses a single pheromone matrix as the ant selection technique, failing to mine preferences and ignoring the trajectories of different vehicles during task allocation. This results in low-quality solution construction, leading to slow optimization speed and poor service scheduling optimization. Furthermore, with increasing path complexity and the number of vehicles, the path preference information mined by a single pheromone matrix is insufficient. ACO algorithms based on a single pheromone matrix struggle to adapt to new logistics service scenarios, ultimately impacting the operational efficiency of the entire supply chain system and making it difficult for traditional algorithms based on a single pheromone matrix to guarantee their optimization efficiency. Summary of the Invention
[0004] This invention provides a method and apparatus for optimizing the scheduling of multi-logistics vehicle services based on a multi-pheromone matrix ant colony system. By optimizing the multi-pheromone matrix ant colony system algorithm, it addresses the increasingly complex problem of multi-logistics vehicle service scheduling and achieves the goal of fast and efficient multi-logistics vehicle service scheduling.
[0005] To achieve the above objectives / to solve the above technical problems, the present invention is implemented using the following technical solution:
[0006] In a first aspect, the present invention provides a multi-logistics vehicle service scheduling optimization method based on a multi-pheromone matrix ant colony system, comprising:
[0007] Construct an ant colony system containing multiple ant colonies based on the multi-logistics vehicle service scheduling task. Each ant colony contains an equal number of ants as the number of logistics vehicles.
[0008] Initialize the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix, with each ant corresponding to a pheromone matrix;
[0009] Based on the ant colony system, the ant colony system algorithm is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles until the iteration termination condition is met, and the globally optimal service scheduling scheme is output.
[0010] In conjunction with the first aspect, further initialization of the heuristic information matrix and pheromone matrix includes:
[0011] A logistics task map G=(V, E) is generated based on the location of the logistics tasks, where V represents the set of all logistics tasks and E is the set of edges between all logistics tasks. Each edge of the logistics task map is assigned a weight, and the weight cost is... i,j This represents the service cost between logistics task i and logistics task j;
[0012] Calculate the heuristic information between two logistics tasks based on the service cost between them:
[0013] ;
[0014] Where, η i,j This represents the heuristic information between logistics task i and logistics task j, if cost i,j If η is 0, then η i,j Also set to 0;
[0015] A heuristic information matrix η is constructed using the heuristic information among all logistics tasks:
[0016] ;
[0017] A greedy service scheduling scheme is constructed using a greedy algorithm based on the principle of minimizing service cost. The fitness value of the greedy service scheduling scheme is used as the initial value of each element in all pheromone matrices.
[0018] Building upon the first aspect, further, based on ant colony systems, an ant colony system algorithm is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles. Each iteration includes:
[0019] Based on the multipheromone matrix, a service path for a logistics vehicle is constructed using each ant in each ant colony. All service paths of logistics vehicles constitute a service scheduling scheme, resulting in service scheduling schemes for multiple ant colonies.
[0020] Based on the local optimization strategy of deleting and inserting logistics tasks, each service path in each service scheduling scheme is locally optimized to obtain multiple locally optimized service scheduling schemes.
[0021] The pre-built evaluation model is used to evaluate the locally optimized service scheduling scheme, and the globally optimal service scheduling scheme and multiple pheromone matrices are updated based on the evaluation results and the similarity matrix between schemes.
[0022] In conjunction with the first aspect, further, service scheduling schemes based on multi-pheromone matrices include:
[0023] Let the number of ant colonies be NP, and each ant colony contain M ants. M pheromone matrices are maintained. The k-th ant in each ant colony selects the logistics task to be served based on the k-th pheromone matrix and calculates its expected service cost. Based on the expected service cost, the service cost of each ant in the ant colony is balanced during the service path construction process to obtain the ant colony's service scheduling scheme.
[0024] Building upon the first aspect, further, based on the local optimization strategy of deleting and inserting logistics tasks, local optimization is performed on each service path in each service scheduling scheme, including:
[0025] Obtain the service path with the highest service cost from the service scheduling scheme. And randomly select one of the logistics tasks t c , For service path The last logistics task in the process;
[0026] Select logistics task t from the logistics task set V. c Let S be the set of the top 10% of logistics tasks with the lowest service cost, and let the service path be... Let R be the set of logistics tasks in the middle, and generate a new set Q = SS ∩ R;
[0027] Randomly select logistics task t from set Q. d Let the logistics task t be... d The service path is , For service path The last logistics task in the process;
[0028] Logistics task t c From the service path Delete and remove the logistics task t c Insert service path The two service paths have been changed. , ,or , The revised service scheduling scheme was obtained.
[0029] Calculate the reduction in maximum service cost of the modified service scheduling scheme. If the reduction is positive, retain the modified service scheduling scheme; if the reduction is negative, discard the modified service scheduling scheme.
[0030] Select the next logistics task from set Q and perform deletion and insertion operations until the traversal of set Q is completed;
[0031] Repeat the above operations until deleting or inserting any logistics task in the service path with the highest service cost cannot reduce the maximum service cost of the service scheduling scheme. Then, a local optimization of the service scheme is completed.
[0032] Building upon the first aspect, furthermore, a pre-built evaluation model is used to evaluate the locally optimized service scheduling scheme. Based on the evaluation results and the similarity matrix between schemes, the globally optimal service scheduling scheme and multiple pheromone matrices are updated, including:
[0033] The pre-built evaluation model is used to evaluate the locally optimized service scheduling schemes, obtain the fitness value of each service scheduling scheme, and select the service scheduling scheme with the smallest fitness value as the optimal service scheduling scheme for this iteration.
[0034] If the fitness value of the optimal service scheduling scheme in this iteration is less than the fitness value of the current globally optimal service scheduling scheme, calculate the similarity matrix sim_matrix between the optimal service scheduling scheme in this iteration and the globally optimal service scheduling scheme. The formula for calculating each element in sim_matrix is as follows:
[0035] ;
[0036] in, This represents the element in row k1 and column k2 of the similarity matrix sim_matrix. new_best This represents the optimal service scheduling scheme in this iteration, or solution. best This represents the globally optimal service scheduling scheme. and They represent solutions respectively new_best Service routes and solutions for logistics vehicle K1 best The service route of the K2 logistics vehicle. M represents the total number of logistics vehicles;
[0037] Based on the similarity matrix sim_matrix, the service paths of the current iteration's optimal service scheduling scheme are matched one by one with the global optimal service scheduling scheme, and the global optimal service scheduling scheme is updated.
[0038] During the global pheromone update phase, the kth pheromone matrix is updated using the service path of the kth logistics vehicle in the globally optimal service scheduling scheme.
[0039] Secondly, the present invention provides a multi-logistics vehicle service scheduling optimization device based on a multi-pheromone matrix ant colony system, comprising:
[0040] The ant colony system construction module is used to build an ant colony system containing multiple ant colonies based on the multi-logistics vehicle service scheduling task. Each ant colony contains an equal number of ants as the number of logistics vehicles.
[0041] The initialization module is used to initialize the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix. Each ant corresponds to a pheromone matrix.
[0042] The iterative optimization module is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles based on the ant colony system algorithm until the iteration termination condition is met, and output the globally optimal service scheduling scheme.
[0043] In conjunction with the second aspect, furthermore, in the iterative optimization module, each iteration of optimization includes:
[0044] Based on the multipheromone matrix, a service path for a logistics vehicle is constructed using each ant in each ant colony. All service paths of logistics vehicles constitute a service scheduling scheme, resulting in service scheduling schemes for multiple ant colonies.
[0045] Based on the local optimization strategy of deleting and inserting logistics tasks, each service path in each service scheduling scheme is locally optimized to obtain multiple locally optimized service scheduling schemes.
[0046] The pre-built evaluation model is used to evaluate the locally optimized service scheduling scheme, and the globally optimal service scheduling scheme and multiple pheromone matrices are updated based on the evaluation results and the similarity matrix between schemes.
[0047] During the global pheromone update phase, the kth pheromone matrix is updated using the service path of the kth logistics vehicle in the globally optimal service scheduling scheme.
[0048] Building upon the second aspect, further, based on the local optimization strategy of deleting and inserting logistics tasks, local optimization is performed on each service path in each service scheduling scheme, including:
[0049] Obtain the service path with the highest service cost from the service scheduling scheme. And randomly select one of the logistics tasks t c , For service path The last logistics task in the process;
[0050] Select logistics task t from the logistics task set V. c Let S be the set of the top 10% of logistics tasks with the lowest service cost, and let the service path be... Let R be the set of logistics tasks in the middle, and generate a new set Q = SS ∩ R;
[0051] Randomly select logistics task t from set Q.d Let the logistics task t be... d The service path is , For service path The last logistics task in the process;
[0052] Logistics task t c From the service path Delete and remove the logistics task t c Insert service path The two service paths have been changed. , ,or , The revised service scheduling scheme was obtained.
[0053] Calculate the reduction in maximum service cost of the modified service scheduling scheme. If the reduction is positive, retain the modified service scheduling scheme; if the reduction is negative, discard the modified service scheduling scheme.
[0054] Select the next logistics task from set Q and perform deletion and insertion operations until the traversal of set Q is completed;
[0055] Repeat the above operations until deleting or inserting any logistics task in the service path with the highest service cost cannot reduce the maximum service cost of the service scheduling scheme. Then, a local optimization of the service scheme is completed.
[0056] Thirdly, the present invention provides a computer device, comprising:
[0057] Memory, used to store computer programs / instructions;
[0058] A processor for executing the computer program / instructions to implement the steps of the multi-vehicle service scheduling optimization method provided in the first aspect.
[0059] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0060] This invention proposes a method and apparatus for optimizing multi-logistics vehicle service scheduling based on a multi-pheromone matrix ant colony system. This invention maintains an independent pheromone matrix for each logistics vehicle and independently constructs its service path based on this matrix. This enables the discovery of logistics task preferences for logistics vehicle allocation, improving path construction quality and accelerating optimization speed. This invention utilizes an ant colony algorithm to iteratively optimize the multi-logistics vehicle service scheduling scheme. In each iteration, it updates the globally optimal service scheduling scheme and the multi-pheromone matrix. Through the effective updating of the pheromone matrix corresponding to each logistics vehicle, it accumulates the preferences of logistics tasks for logistics vehicle allocation, thereby achieving more accurate logistics task allocation. This invention can minimize the total cost of all logistics vehicles serving logistics tasks and the difference in service costs between logistics workshops, thus maintaining the balance of logistics tasks served by each logistics vehicle, and ultimately efficiently and accurately constructing the optimal service scheduling scheme for multiple logistics vehicles. Attached Figure Description
[0061] Figure 1 The diagram shows the steps of a multi-logistics vehicle service scheduling optimization method based on a multi-pheromone matrix ant colony system provided by the present invention.
[0062] Figure 2 The diagram shown is a schematic representation of the distribution of logistics tasks in an embodiment of the present invention.
[0063] Figure 3 The diagram shown is a schematic diagram of ants selecting logistics tasks based on a multi-pheromone matrix in an embodiment of the present invention, and a heat map of the three pheromone matrices that support the ant colony in making decisions.
[0064] Figure 4 The diagram shown is a schematic of a service scheduling scheme constructed by the ant colony system algorithm in an embodiment of the present invention;
[0065] Figure 5 The diagram shown is a schematic of a locally optimized service scheduling scheme based on the deletion and insertion of logistics tasks in an embodiment of the present invention.
[0066] Figure 6 The diagram shown illustrates the correspondence between the current globally optimal service scheduling scheme and the pheromone matrix heatmap in an embodiment of the present invention.
[0067] Figure 7 The diagram shown illustrates the process of calculating the similarity matrix between the current iteration's optimal service scheduling scheme and the globally optimal service scheduling scheme in an embodiment of the present invention.
[0068] Figure 8 The diagram shown is a schematic representation of the final output of the globally optimal service scheduling scheme in an embodiment of the present invention.
[0069] Figure 9The diagram shown is a structural schematic of a multi-logistics vehicle service scheduling optimization device based on a multi-pheromone matrix ant colony system provided by the present invention. Detailed Implementation
[0070] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0071] Example 1
[0072] This embodiment introduces a multi-logistics vehicle service scheduling optimization method based on a multi-pheromone matrix ant colony system. The method treats logistics vehicles as ants, transforming the multi-logistics vehicle service scheduling optimization problem into a pathfinding problem involving multiple ant colonies. The invention constructs an ant colony system with multiple ant colonies, each containing the same number of ants as the logistics vehicles. It initializes the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix, with each ant corresponding to a pheromone matrix. This allows for path discovery based on the multi-pheromone matrix, improving path discovery efficiency. The ant colony system algorithm iteratively optimizes the multi-logistics vehicle service scheduling scheme until the iteration termination condition is met, outputting the final globally optimal service scheduling scheme. This final globally optimal service scheduling scheme is the optimal multi-logistics vehicle service scheduling scheme required by this invention.
[0073] like Figure 1 As shown, the method of the present invention specifically includes the following steps:
[0074] Step 1: Construct an evaluation model for the fitness value of the service scheduling scheme, which will be used to evaluate the service scheduling scheme built by the ant colony in the subsequent multi-logistics vehicle service scheduling optimization process.
[0075] Step 2: Initialize the ant colony system algorithm parameters, and initialize the heuristic information matrix and pheromone matrix of the ant colony system algorithm according to the logistics service scheduling data. Specifically, initialize the heuristic information matrix according to the service cost information between logistics tasks, and at the same time, construct a greedy service scheduling scheme using a greedy algorithm, and initialize the pheromone matrix corresponding to all logistics vehicles according to the fitness value of the scheme.
[0076] Step 3: Based on the ant colony system, use each ant in each ant colony to construct a service path for a logistics vehicle, thereby obtaining a service scheduling scheme for multiple ant colonies.
[0077] In the ant colony system of the present invention, each ant colony contains the same number of ants as the logistics vehicle. Each ant in the ant colony is responsible for constructing a service path for one logistics vehicle, and the service paths of all logistics vehicles constitute a service scheduling scheme.
[0078] During the service path construction process, each ant in each ant colony selects the next logistics task to serve based on the heuristic information matrix and its corresponding pheromone matrix, while simultaneously updating each pheromone matrix locally.
[0079] Step 4: Based on the local optimization strategy of deleting and inserting logistics tasks, perform local optimization on the logistics vehicle service path constructed by each ant in the ant colony to improve the quality of the entire service scheduling scheme.
[0080] Step 5: Use the evaluation model to evaluate the locally optimized service scheduling scheme, update the globally optimal service scheduling scheme based on the evaluation results, and globally update all pheromone matrices based on the globally optimal service scheduling scheme.
[0081] Step 6: Repeat steps 3 to 5 until the iteration termination condition is met, and output the final globally optimal service scheduling scheme.
[0082] In this embodiment of the invention, step 1 specifically includes the following steps:
[0083] Step 1-1: Read logistics service scheduling data from the logistics service scheduling system based on the multi-logistics vehicle service scheduling tasks. The data includes, but is not limited to, the number of logistics vehicles, the number of logistics tasks, the location information of logistics tasks, the location information of logistics warehouses, and the service cost information between logistics tasks.
[0084] Let the number of logistics vehicles be M, the number of logistics tasks be N, and the location information of the logistics tasks be (x i ,y i ), where x i , y i Represent the x and y coordinates of the i-th logistics task, respectively; designate one logistics task from all logistics tasks as the logistics warehouse v. depot The location information of the logistics warehouse is (x depot ,y depot ), where x depot , y depot These represent the x-coordinate and y-coordinate of the logistics warehouse, respectively.
[0085] This invention generates a logistics task map based on the location information of different logistics tasks. Specifically, the logistics task map is modeled as a complete undirected graph G=(V, E), where V={(x i ,y i The set E = {e | 1 ≤ i ≤ N} represents the set of all logistics tasks.ij |i, j∈V} is the edge set between all logistics tasks, e ij This represents the edge between logistics task i and logistics task j; each edge is assigned a weight, cost. i,j Weight cost i,j This refers to the service cost between logistics task i and logistics task j.
[0086] Steps 1-2: Based on logistics service scheduling data, construct an evaluation model for the fitness value of the service scheduling scheme.
[0087] The optimization objective of the method of this invention is to find the optimal service scheduling scheme by minimizing the maximum service cost of logistics vehicles. Therefore, the optimization objective model of this invention can be expressed as:
[0088] ;
[0089] ;
[0090] ;
[0091] ;
[0092] Where "solution" represents a service scheduling scheme, and "route" represents a service scheduling scheme. k Let C(Route) represent the service path of the k-th logistics vehicle in a service scheduling scheme. k N represents the service cost of the service path for the k-th logistics vehicle. k Route represents the number of logistics tasks served by the k-th logistics vehicle. k [i] and Route k [i+1] represent the i-th and i+1-th logistics tasks served by the k-th logistics vehicle, respectively. k [1] and Route k [N k ] represent the first and last logistics tasks served by the k-th logistics vehicle, respectively, and cost(Route) k [i], Route k [i+1]) represents the service cost for the k-th logistics vehicle from the i-th logistics task to the (i+1)-th logistics task in its service route. k [1], v depot ) represents the service cost of the k-th logistics vehicle from the first logistics task in its service path to the logistics warehouse, cost(v depot Route k [N k]) represents the service cost for the k-th logistics vehicle from the last logistics task in its service path to the logistics warehouse.
[0093] In this embodiment of the invention, the cost, or expense, required to move from one logistics task to another can be assessed through service cost, via C(Route). k As can be seen from the calculation formula, the service cost of a logistics vehicle is calculated as the sum of the service costs of all logistics tasks along its service path, while the service cost of a service scheduling scheme can be fed back from the service costs of all logistics vehicles. Therefore, this invention can evaluate the merits of a service scheduling scheme by assessing its service cost.
[0094] In step 2, the ant colony system algorithm parameters are initialized, including: ant colony size NP, pheromone factor α, heuristic pheromone factor β, local pheromone evaporation rate ξ, global pheromone evaporation rate ρ, and pseudo-random probability q0. The values of the ant colony system algorithm parameters can be obtained through extensive experimentation and optimization.
[0095] The heuristic information matrix and pheromone matrix of the ant colony system algorithm are initialized based on logistics service scheduling data. The specific operation is as follows:
[0096] Step 2-1: Heuristic information is generated based on the service cost between two logistics tasks. The heuristic information η between any two logistics tasks i and j... i,j Calculated using the following formula:
[0097] ;
[0098] Where, η i,j This represents the heuristic information between logistics task i and logistics task j, if cost i,j If η is 0, then η i,j Also set to 0.
[0099] A heuristic information matrix η is constructed using the heuristic information among all logistics tasks:
[0100] ;
[0101] Step 2-2: In this invention, an independent pheromone matrix is maintained for each logistics vehicle. Therefore, a total of M pheromone matrices need to be maintained. Initially, since there is no prior knowledge, each element in all pheromone matrices is initialized to the same value, which is the fitness value of the service scheduling scheme constructed based on a greedy algorithm.
[0102] A service scheduling scheme is constructed using a greedy algorithm, and the pheromone matrix is initialized, including the following steps:
[0103] Step 2-2-1: Initialize an ant colony containing M ants, responsible for building a greedy service scheduling scheme.
[0104] Step 2-2-2: The ant colony initializes a set of served logistics tasks called `visited`, which includes `v`. depot Initialize the service cost of each ant in the ant colony to 0. Have all ants in the colony choose the logistics warehouse v. depot Starting from this point, the next logistics task to be served is selected based on the heuristic information between the various logistics tasks, and the service path of each logistics vehicle is greedily constructed.
[0105] Step 2-2-3: Each ant in the ant colony obtains the set of logistics tasks to be served (tasks) based on the set of logistics tasks already served (visited). Then, each ant pre-selects the logistics task with the greatest heuristic information from the set of logistics tasks to be served (tasks) as the pre-selected service task, and calculates the expected service cost for each ant.
[0106] The set of logistics tasks to be served, tasks, can be represented as:
[0107] ;
[0108] Let c be the logistics task currently being served by the k-th ant. Then, the k-th ant pre-selects a logistics task pre from the set of pending logistics tasks tasks that has the maximum heuristic information to the current logistics task c. k It can be represented as:
[0109] ;
[0110] in, η c,j This represents the heuristic information between the current logistics task c and logistics task j.
[0111] The estimated service cost for the k-th ant is:
[0112] ;
[0113] Among them, pre_C k Let represent the estimated service cost of the k-th ant, 'c' represent the current logistics task of the k-th ant, and 'pre' represent the current logistics task of the k-th ant. k This represents the pre-selected logistics task for the k-th ant. This indicates the transition from the current logistics task c to the pre-selected logistics task pre. k The cost of the service.
[0114] Step 2-2-4: Select the ant with the lowest expected service cost in the ant colony to construct a service path, add the ant's pre-selected logistics task to the constructed service path, update the ant's service cost to the expected service cost, add the ant's pre-selected logistics task to the visited set of served logistics tasks, and update the number of logistics tasks in its service path; other ants abandon their pre-selected logistics tasks.
[0115] Selecting the ant in the colony with the lowest expected service cost can be represented as:
[0116] ;
[0117] in, This refers to the ant in the colony with the lowest expected service cost.
[0118] Step 2-2-5: Repeat steps 2-2-3 to 2-2-4 until the set of logistics tasks to be served is empty, indicating that all logistics tasks are served by logistics vehicles, thus obtaining a greedy service scheduling scheme.
[0119] Step 2-2-6: Calculate the fitness value of the greedy service scheduling scheme using the evaluation model, and initialize the elements in all pheromone matrices based on the fitness value τ0.
[0120] The formula for calculating the fitness τ0 of a greedy service scheduling scheme is:
[0121] ;
[0122] ;
[0123] In this embodiment of the invention, step 3 specifically includes the following steps:
[0124] Step 3-1: Construct NP ant colonies, each containing M ants, with each ant representing a logistics vehicle.
[0125] Step 3-2: Each ant colony initializes a set of served logistics tasks (visited). The service cost of each ant in all colonies is initialized to 0. In the initial stage, the set of served logistics tasks (visited) only contains the logistics warehouse (v). depot .
[0126] Step 3-3: Each ant in the colony pre-selects the next logistics task based on the heuristic information matrix and pheromone matrix.
[0127] Specifically, based on the visited set of serviced logistics tasks, obtain the pending logistics task set `tasks`. Using the last logistics task `c` of the k-th service path in the current service scheduling scheme as the current logistics task, calculate the probability of selecting logistics task `i` from the pending logistics task set `tasks` using the following formula:
[0128] ;
[0129] in, Let represent the probability that the k-th ant chooses logistics task i as its next logistics task. This represents the pheromone concentration in the k-th pheromone matrix corresponding to the k-th ant, connecting logistics task i and the current logistics task c. η represents the pheromone concentration in the k-th pheromone matrix corresponding to the k-th ant, connecting logistics task j and the current logistics task c. c,i η represents the heuristic information between current logistics task c and logistics task i. c,j This represents the heuristic information between the current logistics task c and logistics task j.
[0130] Based on the selection probability of each logistics task in tasks chosen by the k-th ant, the pre-selected logistics task for the k-th ant is obtained. k :
[0131] ;
[0132] Where q represents a random number between 0 and 1, q0 is a pseudo-random probability, and J is the roulette wheel selection mechanism.
[0133] This selection technique means that Ant will greedily select the logistics task with the highest probability as the pre-selected task with a probability of q0, and select the pre-selected logistics task according to the roulette wheel selection mechanism with a probability of (1-q0).
[0134] Steps 3-4: Select one ant to construct the service path based on the principle of minimizing the expected service cost, while other ants abandon their pre-selected logistics tasks; at the same time, call the local pheromone update rule to update the pheromone on the edge currently traversed in the pheromone matrix corresponding to the selected ant in a timely manner.
[0135] First, calculate the estimated service cost for all ants, using the following formula:
[0136] ;
[0137] Secondly, after calculating the estimated service cost of all ants, the ant k with the lowest estimated service cost is selected according to the following formula. m Build the service path:
[0138] ;
[0139] Finally, the kth m Pre-selected logistics tasks for ants Add the ant to its service path and update the number of logistics tasks in its service path, including the k-th task. m The service cost of an ant Updated to estimated service cost , will the kth m Pre-selected logistics tasks for ants Add the k-th serviced logistics task to the visited set. m The kth ant m Local pheromone updates are performed on each pheromone matrix.
[0140] In this invention, ant k m The corresponding local update formula for the pheromone matrix and the update formula for the number of logistics tasks in the service path are as follows:
[0141] ;
[0142] ;
[0143] in, Indicates the kth m The pheromone matrix connects logistics task c and logistics task c. The pheromone concentration of the edge, where τ0 represents the initial pheromone concentration. Indicates the kth m The number of logistics tasks served in the service path of a single ant.
[0144] Step 3-5: Repeat steps 3-3 and 3-4 until all logistics tasks are selected and entered into the visited set of served logistics tasks, thus obtaining a service scheduling scheme.
[0145] Steps 3-6: Repeat steps 3-2 to 3-5 until all ant colonies have built service scheduling schemes, resulting in service scheduling schemes for multiple ant colonies.
[0146] In this embodiment of the invention, step 4 specifically includes the following steps:
[0147] Step 4-1: Before using the local optimization strategy of deleting and inserting logistics tasks, we can first perform 2-opt optimization on each service path in each service scheduling scheme built by each ant colony in Step 3.
[0148] Step 4-2, Local optimization strategy based on logistics task deletion and insertion, specifically includes the following steps:
[0149] Choose a service scheduling scheme, calculate the service cost of all service paths in it, and select the service path with the highest service cost. and from the service path A logistics task t is randomly selected from the data. c ,in, For service path The last logistics task in the process.
[0150] Calculate other logistics tasks and logistics task t in sequence. c The service costs between them are determined, and the logistics tasks are arranged in ascending order of service cost. Then, the logistics task t is selected from the logistics task set V. c Let S be the set of the top 10% of logistics tasks with the lowest service costs. Let the service path... Let R be the set of logistics tasks, and generate a new set Q = SS∩R.
[0151] Randomly select logistics task t from set Q. d Let the logistics task t be... d The service path is ,in, For service path The last logistics task in the process.
[0152] Logistics task t c From the service path Delete and remove the logistics task t c Insert service path , t c You can insert t d Before or after the insertion operation is completed, the two service paths change to , ,or , The revised service scheduling scheme was obtained.
[0153] Calculate the reduction in maximum service cost of the modified service scheduling scheme. If the reduction is positive, retain the modified service scheduling scheme; if the reduction is negative, discard the modified service scheduling scheme. The formula for calculating the reduction in maximum service cost ΔC is as follows:
[0154] ;
[0155] or
[0156] ;
[0157] Select the next logistics task from set Q and perform deletion and insertion operations until the traversal of set Q is complete.
[0158] Step 4-3: Repeat step 4-2 until deleting or inserting any logistics task in the service path with the highest service cost cannot reduce the maximum service cost of the service scheduling scheme. This completes one local optimization of the service scheme. In this embodiment of the invention, step 5 specifically includes the following steps:
[0159] Step 5-1: Evaluate the fitness value of each locally optimized service scheduling scheme and compare them to obtain the optimal service scheduling scheme for this iteration. Compare it with the globally optimal service scheduling scheme obtained in the previous iteration. If the optimal service scheduling scheme for this iteration is better than the globally optimal service scheduling scheme, then update the globally optimal service scheduling scheme.
[0160] Updating the globally optimal service scheduling scheme involves the following steps:
[0161] Step 5-1-1: Use the evaluation model to evaluate the fitness of all service scheduling schemes after local optimization, obtain the fitness value of each service scheduling scheme, and select the service scheduling scheme with the smallest fitness value as the optimal service scheduling scheme for this iteration.
[0162] Step 5-1-2: Compare the optimal service scheduling scheme of this iteration with the current globally optimal service scheduling scheme. If the fitness value of the optimal service scheduling scheme of this iteration is less than that of the globally optimal service scheduling scheme, it means that the optimal service scheduling scheme of this iteration is better than the globally optimal service scheduling scheme. Then, calculate the similarity matrix sim_matrix between the optimal service scheduling scheme of this iteration and the globally optimal service scheduling scheme. The value of each element in the similarity matrix is shown below:
[0163] ;
[0164] in, This represents the element in row k1 and column k2 of the similarity matrix sim_matrix. new_best This represents the optimal service scheduling scheme in this iteration, or solution. best This represents the globally optimal service scheduling scheme. and They represent solutions respectively new_best Service routes and solutions for logistics vehicle K1 best The service route of the K2 logistics vehicle. M represents the total number of logistics vehicles.
[0165] As can be seen from the above formula, this invention uses the number of intersection elements of the logistics task sets in the service paths of the two logistics vehicles in the current iteration's optimal service scheduling scheme and the global optimal service scheduling scheme as the similarity measure of the two paths, and fills the obtained number of intersection elements into the corresponding position of the similarity matrix.
[0166] Step 5-1-3: Traverse all elements in the similarity matrix and find the maximum element. Let the coordinates of the maximum element be (k...). 1max ,k 2max ); then, based on the row k where the largest element is located. 1max and column k 2max Find the solutions separately new_best and solution best The corresponding service path and Finally, using the solution new_best Service path in Update solution best Service path in .
[0167] Step 5-1-4: Delete the k-th element in the similarity matrix sim_matrix. 1max row and kth 2max All elements of the column.
[0168] Step 5-1-5: Repeat steps 5-1-3 to 5-1-4 until all elements in the similarity matrix sim_matrix are deleted, and the solution is also deleted. new_best The optimized service path has been completely updated to the solution. best In the process, the globally optimal service scheduling scheme is updated.
[0169] Step 5-2: Use the updated global optimal service scheduling scheme to globally update multiple pheromone matrices.
[0170] During the global pheromone update phase, the k-th pheromone matrix is updated using the service path of the k-th logistics vehicle in the globally optimal service scheduling scheme. The pheromone concentration update formula is as follows:
[0171] ;
[0172] in, Let fit(solution) be the pheromone concentration from logistics task i to logistics task j in the k-th pheromone matrix. best () represents the fitness value of the globally optimal service scheduling scheme. and .
[0173] In this embodiment of the invention, the iteration termination condition in step 6 can be the maximum fitness value evaluation count or the maximum number of iterations. Each evaluation count is consumed when the service scheduling scheme of the ant colony is evaluated. The iteration terminates when the maximum fitness value evaluation count is reached, or when the number of iterations reaches the maximum number of iterations.
[0174] The present invention provides a path construction strategy based on a multi-pheromone matrix, a local optimization strategy based on the deletion and insertion of logistics tasks, a pheromone matrix matching strategy based on path similarity, and a global update strategy for the multi-pheromone matrix. By effectively combining multiple strategies, a new multi-logistics vehicle service scheduling optimization technology is formed, which can efficiently and accurately construct multi-logistics vehicle service scheduling schemes.
[0175] Example 2
[0176] This embodiment uses 100 logistics tasks and 3 logistics vehicles as an example to illustrate the specific operation of the method of the present invention. This example needs to minimize the maximum service cost among the 3 logistics vehicles while serving all logistics tasks. In this embodiment, the distribution of logistics tasks is as follows: Figure 2 As shown.
[0177] Step 1: Obtain multi-logistics vehicle service scheduling scheme planning instance information, construct a service scheme planning model for logistics task information, and establish a fitness value evaluation function to evaluate the quality of the service scheduling scheme.
[0178] Instance information includes the number of logistics tasks N=100, and the coordinates of the logistics tasks (x, y, y). i , y i ), Logistics warehouse coordinates (x depot ,y depot The number of logistics vehicles is M=3, and the specific data of the logistics task coordinates are shown in Table 1. In this embodiment, the Euclidean distance between logistics tasks is used as the service cost between logistics tasks. The greater the distance between logistics tasks, the greater the service cost. In this embodiment, logistics task 58 is designated as the logistics warehouse v. depot .
[0179] Table 1
[0180] Serial number x-axis y-axis Serial Number x-axis y-axis 1 1380 939 51 2482 1183 2 2848 96 52 3854 923 3 3510 1671 53 376 825 4 457 334 54 2519 135 5 3888 666 55 2945 1622 6 984 965 56 953 268 7 2721 1482 57 2628 1479 8 1286 525 <![CDATA[58(v depot )]]> 2097 981 9 2716 1432 59 890 1846 10 738 1325 60 2139 1806 11 1251 1832 61 2421 1007 12 2728 1698 62 2290 1810 13 3815 169 63 1115 1052 14 3683 1533 64 2588 302 15 1247 1945 65 327 265 16 123 862 66 241 341 17 1234 1946 67 1917 687 18 252 1240 68 2991 792 19 611 673 69 2573 599 20 2576 1676 70 19 674 21 928 1700 71 3911 1673 22 53 857 72 872 1559 23 1807 1711 73 2863 558 24 274 1420 74 929 1766 25 2574 946 75 839 620 26 178 24 76 3893 102 27 2678 1825 77 2178 1619 28 1795 962 78 3822 899 29 3384 1498 79 378 1048 30 3520 1079 80 1178 100 31 1256 61 81 2599 901 32 1424 1728 82 3416 143 33 3913 192 83 2961 1605 34 3085 1528 84 611 1384 35 2573 1969 85 3113 885 36 463 1670 86 2597 1830 37 3875 598 87 2586 1286 38 298 1513 88 161 906 39 3479 821 89 1429 134 40 2542 236 90 742 1025 41 3955 1743 91 1625 1651 42 1323 280 92 1187 706 43 3447 1830 93 1787 1009 44 2936 337 94 22 987 45 1621 1830 95 3640 43 46 3373 1646 96 3756 882 47 1393 1368 97 776 392 48 3874 1318 98 1724 1642 49 938 955 99 198 1810 50 3022 474 100 3950 1558
[0181] In step 1, the algorithm's optimization objective is to find a service scheduling scheme that minimizes the maximum service cost among the three logistics vehicles, ensuring that each logistics task must be accessed and can only be accessed by one logistics vehicle. The service path of each logistics vehicle is a sequence of logistics tasks, with the sequence starting from the logistics warehouse v. depot The task serves as both the starting point and the end point.
[0182] Step 2: First, initialize the ant colony optimization algorithm parameters. In this example, the ant colony size NP is set to 30, the global pheromone evaporation rate ρ and the local pheromone evaporation rate ξ are both set to 0.09, the heuristic pheromone factor α and the pheromone factor β are set to 1 and 2.4 respectively, the pseudo-random parameter q0 is set to 0.95, and the maximum fitness evaluation count max Eval is set to 5000. All of the above parameters have been experimentally optimized and represent the best parameter combination among all available combinations.
[0183] Subsequently, a greedy service scheduling scheme is constructed using a greedy algorithm, including the following steps:
[0184] Step 2-1: Initialize an ant colony containing 3 ants; the initial service scheduling scheme is greedy_solution = {[v depot ], [v depot ], [v depot ]}. Ant colony initialization of the served logistics task set visited ={v depot}, initialize the service cost for each ant to 0.
[0185] Step 2-2, each ant in the colony selects its starting logistics warehouse v. depot Starting with a logistics task, the next logistics task to be served is selected based on heuristic information between the logistics tasks, and a greedy algorithm is used to construct a logistics vehicle service scheduling scheme.
[0186] Steps 2-3: Each ant in the ant colony pre-selects the logistics task j that has the most heuristic information from the set of logistics tasks to be served, which is its current logistics task i.
[0187] Suppose that after several logistics task selections by 3 ants in the ant colony, the currently constructed greedy service scheduling scheme greedy_solution = {[v depot 28 67 8 92 75 19 53 79 18 24 38 36 99],[v depot 93 1 63 6 49 90 10 84 72 21 74 59 17 15 11 32 91 98 23 45], [v depot [6125 81 69 73 50 44 2 54 40 64 68 85 39 30 96]}, the next logistics tasks pre-selected by the three ants are 94, 47, and 78 respectively. Based on the service paths already constructed by the three ants and the pre-selected logistics tasks, the estimated service costs for the three ants are calculated to be 4432.76, 4330.6, and 4046.92 respectively.
[0188] In steps 2-4, since the estimated service costs of the three ants are 4432.76, 4330.6 and 4046.92 respectively, ant 3 has the lowest estimated service cost, so ant 3 is selected for service path construction.
[0189] In this example, the updated service cost for ant 3 is 4046.92; other ants abandon their pre-selected logistics tasks. At this point, the currently constructed greedy service scheduling scheme `greedy_solution = {[v` depot 28 67 8 92 75 19 5379 18 24 38 36 99], [v depot 93 1 63 6 49 90 10 84 72 21 74 59 17 15 11 32 91 9823 45], [v depot 61 25 81 69 73 50 44 2 54 40 64 68 85 39 30 96 78]};
[0190] Steps 2-5 are repeated, from steps 2-3 to 2-4, until all logistics tasks are served, thus obtaining a greedy multi-vehicle service scheduling scheme. In this example, the greedy service scheduling scheme is: greedy_solution = {[v depot 28 67 8 92 75 19 53 79 18 24 38 36 99 94 22 16 88 70 66 65 4 97 56 80 31 8942 26 v depot ], [v depot 93 1 63 6 49 90 10 84 72 21 74 59 17 15 11 32 91 98 23 4547 77 60 62 86 27 12 20 57 7 9 87 51 55 83 34 29 v depot ], [v depot 61 25 81 69 7350 44 2 54 40 64 68 85 39 30 96 78 52 5 37 33 76 13 95 82 48 100 71 41 14 346 43 35 v depot ]}.
[0191] Steps 2-6: Calculate the fitness value τ0 of the greedy multi-vehicle service scheduling scheme, and then initialize the pheromones in the M pheromone matrices to τ0. In this example, each pheromone matrix is a 100×100 two-dimensional matrix. ]100×100, .
[0192] Step 3: There are 30 ant colonies in total. Build a service scheduling scheme for each ant colony.
[0193] Step 3-1: Initialize a set of served logistics tasks (visited), which contains the starting point of all ants in the ant colony, i.e., the logistics warehouse v. depot The service cost for each ant is initialized to 0.
[0194] Step 3-2: Take the last logistics task in the current service scheduling scheme built by the ants as the current logistics task. Each ant in the ant colony first obtains its own set of logistics tasks to be served (tasks) based on the set of logistics tasks already served, and then pre-selects the next logistics task to be served from the tasks according to the probability selection mechanism.
[0195] Assume the current service scheduling scheme is solution1 = {[v depot 67 8 42 89 31 80 56 97 4 6526 66], [v depot 28 93 47 1 63 6 49 90 10 84 72 21 74 59], [v depot According to the probability selection mechanism, the next logistics task pre-selected by the three ants is determined to be 70, 17, and 71. Figure 3 The diagram illustrates the ant selection technique based on a multi-pheromone matrix in an example, as well as the heatmap of the three pheromone matrices that support the ant colony's decision-making.
[0196] Step 3-3: The estimated service costs of the three service paths in service scheduling scheme solution 1 are 3674.44, 3432.30, and 3403.25, respectively. The ant with the lowest estimated service cost (i.e., ant 3) is selected from the ant colony to construct the service path. The pheromone matrix corresponding to ant 3 is then locally updated. The service scheduling scheme after construction becomes solution 1 = {[v depot 67 8 42 89 31 80 56 97 4 65 26 66], [v depot 28 93 47 1 63 649 90 10 84 72 21 74 59], [v depot 69 73 68 85 39 30 29 46 43 3 14 71]}.
[0197] The ant selection technique based on the expected service cost described above can fully take into account the changes in the search environment, and while minimizing the service cost, it can also balance the differences in the service costs of various services in the service scheduling scheme.
[0198] Since Ant 3's service path has added a new logistics task 71, it is necessary to update the pheromones on the edge from logistics task 14 to logistics task 71 in the third pheromone matrix corresponding to Ant 3, and not to operate on the other pheromone matrices.
[0199] Steps 3-4, repeat steps 3-2 to 3-3, until all logistics tasks are completed, and finally each logistics vehicle returns to the logistics warehouse. depot This leads to a multi-vehicle service scheduling solution.
[0200] In this example, the resulting multi-vehicle service scheduling solution is: solution1 = {[v depot 67 8 42 8931 80 56 97 4 65 26 66 70 22 16 88 94 99 36 38 24 18 79 53 19 75 92 v depot ],[v depot 28 93 47 1 63 6 49 90 10 84 72 21 74 59 17 15 11 32 45 91 98 23 77 6062 35 86 20 12 55 83 34 7 9 57 87 51 81 25 61 27v depot ],[ v depot 69 73 68 85 3930 29 46 43 3 14 71 41 100 48 52 78 96 5 37 33 76 13 95 82 50 44 2 54 40 64v depot ]},like Figure 4 As shown, the service routes include logistics vehicle 1, logistics vehicle 2, and logistics vehicle 3, with service costs of 8071.95, 9531.07, and 8098.69 respectively.
[0201] Steps 3-5 are repeated from steps 3-1 to 3-4 until all ant colonies have built multi-vehicle service scheduling schemes, ultimately resulting in 30 multi-vehicle service scheduling schemes.
[0202] Step 4: Adopt a local optimization strategy based on the deletion and insertion of logistics tasks.
[0203] Suppose the service solution to be locally optimized is {[v depot67 8 42 89 31 80 56 97 4 65 26 66 7022 16 88 94 18 24 38 99 36 84 10 6 49 90 79 53 19 75 92 v depot ],[v depot 61 81 2551 87 57 9 7 34 83 55 12 20 27 86 35 62 60 77 23 98 91 45 32 47 11 15 17 5974 21 72 63 1 93 28 v depot ],[ v depot 69 64 40 54 2 44 73 50 82 95 13 76 33 37 596 78 52 48 100 41 71 14 3 43 46 29 30 39 85 68 v depot The service costs of the three service paths are 9544.26, 7562.67, and 8163.11, respectively. The first service path has the highest service cost. We select logistics task 8 from the first service path to obtain the set of logistics tasks with the lowest service cost, S={92, 42, 89, 56,1, 80, 75, 31, 97, 6}. After excluding the logistics tasks in the first service path, Q={1}. We insert logistics task 8 into the second service path where logistics task 1 is located, and at the same time delete logistics task 8 from service path 2. The maximum reduction in service cost is 179.18, so this swap is applied.
[0204] At this point, the three service paths in this solution are {[v depot 67 42 89 31 80 56 97 4 65 26 66 7022 16 88 94 18 24 38 99 36 84 10 6 49 90 79 53 19 75 92 v depot ],[ v depot 61 8125 51 87 57 9 7 34 83 55 12 20 27 86 35 62 60 77 23 98 91 45 32 47 11 15 1759 74 21 72 63 8 1 93 28 v depot ],[v depot69 64 40 54 2 44 73 50 82 95 13 76 3337 5 96 78 52 48 100 41 71 14 3 43 46 29 30 39 85 68 v depot The service costs for the three service paths are: 9365.08, 8253.17, and 8163.11. Figure 5 A schematic diagram illustrates a local optimization method based on the deletion and insertion of logistics tasks.
[0205] Step 5: Evaluate the locally optimized service scheduling scheme, update the globally optimal service scheduling scheme, and globally update all pheromone matrices based on the globally optimal service scheduling scheme.
[0206] In this embodiment, the optimal service scheduling scheme for this iteration is: solution new_best = {[v depot 28 8 9275 19 53 79 18 24 38 36 99 94 88 16 22 70 66 26 65 4 97 56 80 31 89 42 67v depot ],[ v depot 93 1 63 6 49 90 10 84 72 21 74 59 17 15 11 32 47 91 45 98 23 7760 62 35 86 27 20 12 55 83 34 7 9 57 87 51 61 25 81 v depot ],[v depot 69 73 68 8529 46 43 3 14 71 41 100 48 30 39 96 78 52 5 37 33 76 13 95 82 50 44 2 54 4064 v depot Global optimal service scheduling solution: best ={[v depot 28 92 75 19 53 79 18 24 3836 99 94 88 16 22 70 66 26 65 4 97 56 80 31 89 42 8 67 v depot ],[ v depot 93 1 636 49 90 10 84 72 21 74 59 17 15 11 32 47 91 45 98 23 77 60 62 35 86 27 20 1255 83 34 29 9 7 57 87 51 vdepot ],[v depot 61 25 81 73 68 85 46 43 3 14 71 41 10048 30 39 96 78 52 5 37 33 76 13 95 82 50 44 2 54 40 64 69 v depot ]}. Figure 6 The correspondence between the globally optimal service scheduling scheme and the pheromone matrix is shown.
[0207] The optimal service scheduling solution for this iteration new_best The three service paths and the globally optimal service scheduling solution best The similarity between each pair of the three service paths is calculated, and the corresponding similarity scores are filled into the similarity matrix. Figure 7 This demonstrates the process of calculating the similarity matrix between the optimal service scheduling scheme in this iteration and the globally optimal service scheduling scheme. The similarity matrix is as follows:
[0208] ;
[0209] The largest element in the similarity matrix is 38, located in the second row and second column, indicating that this is the optimal service scheduling solution in this iteration. new_best The second service path and the globally optimal service scheduling solution best The second service path has the highest similarity, therefore the optimal service scheduling solution for this iteration is used. new_best The second service path in the solution updates the globally optimal service scheduling scheme. best The second service path in the process.
[0210] Deleting the elements in the second row and second column of the similarity matrix yields the following new similarity matrix:
[0211] ;
[0212] Repeat the above steps until the globally optimal multi-vehicle service scheduling scheme is updated. The updated globally optimal service scheduling scheme is called the solution. best ={[v depot 28 92 75 19 53 79 18 24 38 36 99 94 8816 22 70 66 26 65 4 97 56 80 31 89 42 8 67 v depot ],[ v depot93 1 63 6 49 90 1084 72 21 74 59 17 15 11 32 47 91 45 98 23 77 60 62 35 86 27 20 12 55 83 34 299 7 57 87 51 v depot ],[v depot 61 25 81 73 68 85 46 43 3 14 71 41 100 48 30 39 9678 52 5 37 33 76 13 95 82 50 44 2 54 40 64 69 v depot ]}.
[0213] During the pheromone update phase, the pheromone matrix is updated using the updated global optimal service scheduling scheme. Each service path in the global optimal service scheduling scheme is responsible for updating its corresponding pheromone matrix.
[0214] Step 6: Each evaluation of the ant colony's service planning method consumes an evaluation count. The algorithm terminates when the number of evaluation counts is exhausted, and outputs the final globally optimal service scheduling scheme.
[0215] In this example, the final globally optimal service scheduling scheme is solution. best ={[v depot 67 42 89 3180 56 97 4 65 26 66 70 22 16 88 94 18 24 38 99 36 79 53 19 75 92 8 v depot ],[v depot 28 93 1 47 63 6 49 90 10 84 72 21 74 59 17 15 11 32 45 91 98 23 77 6062 35 86 27 20 12 55 83 34 7 9 57 87 51 25 81 61v depot ], [v depot 69 73 68 85 3930 29 46 43 3 14 71 41 100 48 52 78 96 5 37 33 76 13 95 82 50 44 2 54 40 64v depot ]}.
[0216] Figure 8The invention demonstrates the global optimal service scheduling scheme output by the example of the present invention, which includes service paths constructed by logistics vehicle 1, logistics vehicle 2, and logistics vehicle 3, with service costs of 8062.91, 8084.47, and 8098.69 for each service path, respectively.
[0217] The service scheduling optimization method for multi-logistics vehicle services based on the multi-pheromone matrix ant colony system yields feasible service scheduling schemes that satisfy the constraints. Furthermore, thanks to the various mechanisms within the algorithm, the resulting service scheduling schemes are all of high quality. There is no overlap in service scheduling schemes between different logistics vehicles, and no overlap in logistics tasks within the same logistics vehicle's service scheduling scheme. Simultaneously, the service costs among the logistics vehicles are relatively balanced.
[0218] Example 3
[0219] Based on the same inventive concept as Embodiment 1, this embodiment introduces a multi-logistics vehicle service scheduling optimization device based on a multi-pheromone matrix ant colony system, such as... Figure 9 As shown, it includes:
[0220] The ant colony system building module is used to build an ant colony system containing multiple ant colonies based on multi-logistics vehicle service scheduling tasks. Each ant colony contains an equal number of ants as the number of logistics vehicles.
[0221] The initialization module is used to initialize the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix. Each ant corresponds to a pheromone matrix.
[0222] The iterative optimization module is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles based on the ant colony system algorithm until the iteration termination condition is met, and output the final globally optimal service scheduling scheme.
[0223] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.
[0224] Example 4
[0225] Based on the same inventive concept as other embodiments, this embodiment describes a computer device including a memory and a processor.
[0226] The memory is used to store computer programs / instructions; the processor is used to execute the computer programs / instructions to implement the steps of the multi-logistics vehicle service scheduling optimization method described in Embodiment 1.
[0227] In summary, the present invention can efficiently and accurately construct an optimal service scheduling scheme for multiple logistics vehicles, specifically:
[0228] This invention optimizes the service scheduling scheme for the multi-logistics vehicle service scheduling scheme planning problem by constructing a multi-pheromone matrix, a logistics task selection mechanism based on the multi-pheromone matrix, an ant selection technique based on the shortest expected service cost, a global update method of the multi-pheromone matrix based on the service scheme similarity matrix, and ultimately aims to minimize the maximum value of the service cost of all logistics vehicles.
[0229] This invention proposes a path construction strategy based on a multi-pheromone matrix, a local optimization strategy based on the deletion and insertion of logistics tasks, a pheromone matrix matching strategy based on path similarity, and a multi-pheromone matrix update strategy. It considers the planning problem of service scheduling schemes for multiple logistics vehicles based on actual conditions, and solves the service scheme planning for all logistics vehicles. By minimizing the maximum service cost of all logistics vehicles, it can minimize the cost of all services while ensuring the length balance among the service scheduling schemes.
[0230] This invention employs an ant colony optimization algorithm, designs a multi-pheromone matrix construction strategy, a logistics task selection mechanism based on the multi-pheromone matrix, an ant selection technique based on expected service costs, and a global update method for the multi-pheromone matrix based on path similarity. These advancements significantly improve the quality of service scheduling schemes while greatly reducing the time consumed in constructing the scheduling schemes. Applying these innovations to solving the multi-logistics vehicle service scheduling problem can yield high-quality multi-logistics vehicle service scheduling schemes in a shorter time, thereby improving the efficiency of service scheme planning and reducing the service costs for all logistics vehicles.
[0231] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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.
[0232] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0234] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0235] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A multi-logistics vehicle service scheduling optimization method based on a multi-phermone matrix ant colony system, characterized in that, include: Construct an ant colony system containing multiple ant colonies based on the multi-logistics vehicle service scheduling task. Each ant colony contains an equal number of ants as the number of logistics vehicles. Initialize the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix, with each ant corresponding to a pheromone matrix; Based on the ant colony system, the ant colony system algorithm is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles until the iteration termination condition is met, and the globally optimal service scheduling scheme is output.
2. The multi-logistics vehicle service scheduling optimization method according to claim 1, characterized in that, Initialize the heuristic information matrix and pheromone matrix, including: According to the logistics task position, a logistics task graph G=(V, E) is generated, wherein V represents a set of all logistics tasks, E is an edge set between all logistics tasks, each edge of the logistics task graph is configured with a weight, and the weight cost i,j represents a service cost between the logistics task i and the logistics task j. Calculate the heuristic information between two logistics tasks based on the service cost between them: ; wherein η i,j represents the heuristic information between logistic task i and logistic task j, and if cost i,j is 0, then η i,j is also set to 0; A heuristic information matrix η is constructed using the heuristic information among all logistics tasks: ; A greedy service scheduling scheme is constructed using a greedy algorithm based on the principle of minimizing service cost. The fitness value of the greedy service scheduling scheme is used as the initial value of each element in all pheromone matrices.
3. The multi-logistics vehicle service scheduling optimization method according to claim 1, characterized in that, Based on ant colony systems, an ant colony system algorithm is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles. Each iteration includes: Based on the multipheromone matrix, a service path for a logistics vehicle is constructed using each ant in each ant colony. All service paths of logistics vehicles constitute a service scheduling scheme, resulting in service scheduling schemes for multiple ant colonies. Based on the local optimization strategy of deleting and inserting logistics tasks, each service path in each service scheduling scheme is locally optimized to obtain multiple locally optimized service scheduling schemes. The pre-built evaluation model is used to evaluate the locally optimized service scheduling scheme, and the globally optimal service scheduling scheme and multiple pheromone matrices are updated based on the evaluation results and the similarity matrix between schemes.
4. The multi-logistics vehicle service scheduling optimization method according to claim 3, characterized in that, The service scheduling scheme based on the multi-pheromone matrix includes: Let the number of ant colonies be NP, and each ant colony contain M ants. M pheromone matrices are maintained. The k-th ant in each ant colony selects the logistics task to be served based on the k-th pheromone matrix and calculates its expected service cost. Based on the expected service cost, the service cost of each ant in the ant colony is balanced during the service path construction process to obtain the ant colony's service scheduling scheme.
5. The multi-logistics vehicle service scheduling optimization method according to claim 3, characterized in that, Based on a local optimization strategy for logistics task deletion and insertion, local optimization is performed on each service path in each service scheduling scheme, including: Obtain the service path with the highest service cost from the service scheduling scheme. And randomly select one of the logistics tasks t c , For service path The last logistics task in the process; Select logistics task t from the logistics task set V. c Let S be the set of the top 10% of logistics tasks with the lowest service cost, and let the service path be... Let R be the set of logistics tasks in the middle, and generate a new set Q = SS ∩ R; Randomly select logistics task t from set Q. d Let the logistics task t be... d The service path is , For service path The last logistics task in the process; Logistics task t c From the service path Delete and remove the logistics task t c Insert service path The two service paths have been changed. , ,or , The revised service scheduling scheme was obtained. Calculate the reduction in maximum service cost of the modified service scheduling scheme. If the reduction is positive, retain the modified service scheduling scheme; if the reduction is negative, discard the modified service scheduling scheme. Select the next logistics task from set Q and perform deletion and insertion operations until the traversal of set Q is completed; Repeat the above operations until deleting or inserting any logistics task in the service path with the highest service cost cannot reduce the maximum service cost of the service scheduling scheme. Then, a local optimization of the service scheme is completed.
6. The multi-logistics vehicle service scheduling optimization method according to claim 3, characterized in that, The locally optimized service scheduling scheme is evaluated using a pre-built evaluation model. Based on the evaluation results and the similarity matrix between schemes, the globally optimal service scheduling scheme and multiple pheromone matrices are updated, including: The pre-built evaluation model is used to evaluate the locally optimized service scheduling schemes, obtain the fitness value of each service scheduling scheme, and select the service scheduling scheme with the smallest fitness value as the optimal service scheduling scheme for this iteration. If the fitness value of the optimal service scheduling scheme in this iteration is less than the fitness value of the current globally optimal service scheduling scheme, calculate the similarity matrix sim_matrix between the optimal service scheduling scheme in this iteration and the globally optimal service scheduling scheme. The formula for calculating each element in sim_matrix is as follows: ; in, This represents the element in row k1 and column k2 of the similarity matrix sim_matrix. new_best This represents the optimal service scheduling scheme in this iteration, or solution. best This represents the globally optimal service scheduling scheme. and They represent solutions respectively new_best Service routes and solutions for logistics vehicle K1 best The service route of the K2 logistics vehicle. M represents the total number of logistics vehicles; Based on the similarity matrix sim_matrix, the service paths of the current iteration's optimal service scheduling scheme are matched one by one with the global optimal service scheduling scheme, and the global optimal service scheduling scheme is updated. During the global pheromone update phase, the kth pheromone matrix is updated using the service path of the kth logistics vehicle in the globally optimal service scheduling scheme.
7. A multi-logistics vehicle service scheduling optimization device based on a multi-pheromone matrix ant colony system, characterized in that, include: The ant colony system construction module is used to build an ant colony system containing multiple ant colonies based on the multi-logistics vehicle service scheduling task. Each ant colony contains an equal number of ants as the number of logistics vehicles. The initialization module is used to initialize the ant colony system algorithm parameters, heuristic information matrix, and pheromone matrix. Each ant corresponds to a pheromone matrix. The iterative optimization module is used to construct and iteratively optimize a service scheduling scheme for multiple logistics vehicles based on the ant colony system algorithm until the iteration termination condition is met, and output the globally optimal service scheduling scheme.
8. The multi-logistics vehicle service scheduling optimization device according to claim 7, characterized in that, In the iterative optimization module, each iteration includes: Based on the multipheromone matrix, a service path for a logistics vehicle is constructed using each ant in each ant colony. All service paths of logistics vehicles constitute a service scheduling scheme, resulting in service scheduling schemes for multiple ant colonies. Based on the local optimization strategy of deleting and inserting logistics tasks, each service path in each service scheduling scheme is locally optimized to obtain multiple locally optimized service scheduling schemes. The locally optimized service scheduling scheme is evaluated using a pre-built evaluation model. The globally optimal service scheduling scheme and multiple pheromone matrices are updated based on the evaluation results and the similarity matrix between schemes. Specifically, during the global pheromone update phase, the service path of the kth logistics vehicle in the globally optimal service scheduling scheme is used to update the kth pheromone matrix.
9. The multi-logistics vehicle service scheduling optimization device according to claim 8, characterized in that, Based on a local optimization strategy for logistics task deletion and insertion, local optimization is performed on each service path in each service scheduling scheme, including: Obtain the service path with the highest service cost from the service scheduling scheme. And randomly select one of the logistics tasks t c , For service path The last logistics task in the process; Select logistics task t from the logistics task set V. c Let S be the set of the top 10% of logistics tasks with the lowest service cost, and let the service path be... Let R be the set of logistics tasks in the middle, and generate a new set Q = SS ∩ R; Randomly select logistics task t from set Q. d Let the logistics task t be... d The service path is , For service path The last logistics task in the process; Logistics task t c From the service path Delete and remove the logistics task t c Insert service path The two service paths have been changed. , ,or , The revised service scheduling scheme was obtained. Calculate the reduction in maximum service cost of the modified service scheduling scheme. If the reduction is positive, retain the modified service scheduling scheme; if the reduction is negative, discard the modified service scheduling scheme. Select the next logistics task from set Q and perform deletion and insertion operations until the traversal of set Q is completed; Repeat the above operations until deleting or inserting any logistics task in the service path with the highest service cost cannot reduce the maximum service cost of the service scheduling scheme. Then, a local optimization of the service scheme is completed.
10. A computer device, characterized in that, include: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the multi-logistics vehicle service scheduling optimization method according to any one of claims 1-6.