Method for applying improved pigeon inspired optimization algorithm to single-warehouse multi-traveler problem
By introducing pigeon flock optimization algorithm and constraint K mean algorithm, combining probability heuristics and greedy cross operators, traditional methods are solved in the problem of low computational efficiency and susceptibility to local optimality in multi-travel merchants, and efficient and accurate path planning is achieved.
Patent Information
- Application Number
- CN202510506681.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-01
AI Technical Summary
When traditional particle swarm optimization and genetic algorithms deal with large-scale multi-traveller problems, they are incomputed and susceptible to local optimization, making it difficult to effectively solve the path planning problem from multiple garbage collection points to a single garbage disposal station.
A pigeon flock optimization algorithm was introduced, combining probability heuristic initialization, greedy cross operators and probability cross operators, and combining the constraint K-mean algorithm to build a path optimization model. Through data division, path construction and optimization, the efficiency and accuracy of path planning are improved.
It significantly improves the efficiency and accuracy of task allocation and path planning, reduces path redundancy, and improves the solution effect of multiple travel merchants.
Smart Images

Figure CN120409801A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention generally relate to the technical field of single - warehouse multi - traveling salesman, and particularly to an improved pigeon flock optimization algorithm applied to the method of single - warehouse multi - traveling salesman problem. Background Art
[0002] Many practical problems, such as route planning, production scheduling, and network communication, can be formulated as instances of the Traveling Salesman Problem (TSP). Although the classical traveling salesman problem is a powerful tool, it is not applicable to all scenarios. For example, in a large city, there may be multiple garbage collection points, but usually only one garbage disposal station. A feasible solution is for multiple garbage trucks to start from the garbage disposal station and finally return, ensuring that each collection point is visited by at least one vehicle. This scenario is similar to the traditional Multi - Traveling Salesman Problem (MTSP). MTSP extends the single salesman in the traveling salesman problem to multiple salesmen and introduces additional constraints to better meet the actual needs. Therefore, from the perspective of real - world applications, the multi - traveling salesman problem is more suitable for dealing with scenarios involving multiple salesmen, providing a more flexible and realistic solution.
[0003] Common methods for solving the multi - traveling salesman problem include a variety of heuristic and meta - heuristic algorithms, such as the Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Simulated Annealing (SA). Traditional methods, such as particle swarm optimization and genetic algorithms, often face problems of low computational efficiency and susceptibility to local optima when dealing with large - scale multi - traveling salesman problems. Summary of the Invention
[0004] To solve the above problems, the present invention introduces the pigeon flock optimization algorithm into the traveling salesman problem and its variants, designs a probabilistic heuristic initialization operator, a greedy crossover operator, and a probabilistic crossover operator. At the same time, combined with the constrained K - means algorithm, a path optimization model is constructed, significantly improving the efficiency and accuracy of task assignment and path planning, and effectively reducing path redundancy.
[0005] According to an embodiment of the present invention, there is provided a method for applying an improved pigeon flock optimization algorithm to the single - warehouse multi - traveling salesman problem.
[0006] In a first aspect of the present invention, there is provided a method for applying an improved pigeon flock optimization algorithm to the single - warehouse multi - traveling salesman problem. The method includes:
[0007] Step S01 Data Partition: Use the constrained K-means clustering algorithm to classify the coordinates, and divide the overall problem into multiple independent Traveling Salesman Problems;
[0008] Step S02 Construct Shortest Path: Generate a certain number of individuals and initial solutions based on the probability heuristic initialization operation, and iteratively update the initial solutions by applying the greedy crossover operator and the probability crossover operator in turn;
[0009] Step S03 Eliminate Path Crossings: Randomly select eight individuals from all individuals to form a group, and perform 2-opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
[0010] Furthermore, the specific content of Step S01 is as follows:
[0011] Step S011: Input the data set, prepare n data points X = {x1, x2, …, x i , …, x n}, set the number of clusters K to be divided, initialize the center points, randomly select K data points as the initial cluster centers C = {c1, c2, …, c j , …, c K}, and define the constraint conditions;
[0012] Step S012: Calculate the distances according to each data point x i and the centers c j of the K clusters, and assign the data point x i to the nearest cluster center c j ;
[0013] Step S013: Check whether the constraint conditions are satisfied;
[0014] Step S014: Update each cluster center to the average value of all data points in the cluster; If the difference between the position of the new cluster center and the previous iteration is less than the threshold, or the assignment of data points no longer changes, or the maximum number of iterations is reached, the algorithm stops;
[0015] Step S015: Output the center points of each cluster and the assignment of cluster members.
[0016] Furthermore, the constraint conditions described in Step S011 are: The radius range of each cluster cannot exceed the predefined maximum value; The number of members in each cluster must meet the minimum requirement.
[0017] Furthermore, the specific content of Step S013 is: If the number of members in a certain cluster is less than the minimum requirement, readjust the assignment of data points; If the radius of a certain cluster exceeds the maximum range, recalculate the cluster center or adjust the assignment of data points
[0018] Furthermore, the core concept of the probability heuristic initialization described in step S02 is that the initial solution of an individual is based on a probability vector P i , and each element of this vector represents the probability of moving from the current target point to the next target point. The calculation steps are as follows:
[0019] Construct a prior target distance matrix:
[0020]
[0021] where d ij represents the distance between the i-th target point and the j-th target point;
[0022] Based on the probability heuristic initialization of the previous target distance matrix, define a probability heuristic initialization matrix:
[0023]
[0024] The probability vector P i = [p i1 … p iv , where p iv = PHI(i, v) α , 1 ≤ i ≤ n, α = 5, v = length(ving), and 0 ≤ v ≤ (n - 1), ving represents the vector of the next target point to be visited, and i represents the i-th target point that has been visited.
[0025] Furthermore, after calculating the probability vector, select the target point to be visited: know the path selection through the cumulative probability matrix:
[0026]
[0027] where φ nm is the heuristic information, P nm is the normalized probability from city n to city m, and PCRC nm is the cumulative probability for path selection;
[0028] Each target point is assigned a ratio PRC i , representing its probability among all potential access points. PRC i = cumsum(PR i ), where
[0029] Furthermore, the specific content of the probability crossover operator described in step S02 is as follows:
[0030] Step S021: Define the position coordinate matrix LOC:
[0031]
[0032] Among them, n represents the number of cities, m represents n - 1, and l nm represents the distance between the nth city and its mth nearest city;
[0033] Step S022: Generate a probability crossover matrix PC based on the position coordinate matrix, where the matrix elements represent the probability of moving from the current target point to the next target point:
[0034]
[0035] p nm represents the probability of transitioning from city n to the city closest to city m;
[0036] Step S023: Each city is assigned a proportion representing the likelihood of being selected among all candidate cities, generating a probability crossover rate matrix PCR:
[0037]
[0038] Step S024: Guide the generation and optimization of solutions based on the cumulative sum matrix of crossover rates PCRC, where PCRC = [cumsum(PRC(1,:))... cumsum(PRC(n,:))] T , and each element represents the cumulative sum of itself and the previous column elements.
[0039] In the second aspect of the present invention, there is provided a device for applying an improved pigeon flock optimization algorithm to the single - warehouse multi - traveling salesman problem. The device includes:
[0040] Data partitioning module: used to classify coordinates using the constrained K - means clustering algorithm and divide the overall problem into multiple independent traveling salesman problems;
[0041] Shortest path construction module: used to generate a certain number of individuals and initial solutions based on probability - heuristic initialization operations, and iteratively update the initial solutions by sequentially applying the greedy crossover operator and the probability crossover operator;
[0042] Path crossover elimination module: used to randomly select eight individuals from all individuals to form a group, and perform 2 - opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
[0043] In the third aspect of the present invention, there is provided an electronic device. The electronic device includes: a memory and a processor, where a computer program is stored on the memory, and when the processor executes the program, it implements the method according to the first aspect of the present invention.
[0044] In a fourth aspect of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method according to the first aspect of the present invention.
[0045] The present invention introduces the pigeon flock optimization algorithm into the traveling salesman problem and its variants, designs a probabilistic heuristic initialization operator, a greedy crossover operator and a probabilistic crossover operator. At the same time, combined with the constrained K-means algorithm, a path optimization model is constructed, which significantly improves the efficiency and accuracy of task allocation and path planning, and effectively reduces path redundancy.
[0046] It should be understood that the content described in the summary of the invention is not intended to limit the key or important features of the embodiments of the present invention, nor to limit the scope of the present invention. Other features of the present invention will become readily apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In conjunction with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages and aspects of the embodiments of the present invention will become more apparent. Among them:
[0048] Figure 1 The flowchart shows the method of applying the improved pigeon flock optimization algorithm according to the embodiments of the present invention to the single-warehouse multi-traveling salesman problem;
[0049] Figure 2 The flowchart shows the steps of the constrained K-means algorithm according to the embodiments of the present invention;
[0050] Figure 3 The diagram shows an example of the constrained K-means according to the embodiments of the present invention;
[0051] Figure 4 The diagram shows an example of the greedy crossover operator according to the embodiments of the present invention;
[0052] Figure 5 The diagram shows an example of the probabilistic crossover operator according to the embodiments of the present invention (selecting corresponding elements);
[0053] Figure 6 The diagram shows an example of the probabilistic crossover operator according to the embodiments of the present invention (determining the insertion position);
[0054] Figure 7 The diagram shows an example of the probabilistic crossover operator according to the embodiments of the present invention (inserting the swapped segment);
[0055] Figure 8 The diagram shows an example of problem solving according to the embodiments of the present invention;
[0056] Figure 9The block diagram of the device applying the improved pigeon flock optimization algorithm according to an embodiment of the present invention to the single - warehouse multi - traveling salesman problem is shown;
[0057] Figure 10 The schematic diagram of the device applying the improved pigeon flock optimization algorithm according to an embodiment of the present invention to the single - warehouse multi - traveling salesman problem is shown. Specific embodiments
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0059] According to the embodiments of the present invention, a method for applying the improved pigeon flock optimization algorithm to the single - warehouse multi - traveling salesman problem is proposed. The pigeon flock optimization algorithm is introduced into the traveling salesman problem and its variants. A probability - heuristic initialization operator, a greedy crossover operator, and a probability crossover operator are designed. At the same time, the constrained K - means algorithm is combined to construct a path optimization model, which significantly improves the efficiency and accuracy of task allocation and path planning and effectively reduces path redundancy.
[0060] The principles and spirit of the present invention will be elaborated in detail below with reference to several representative embodiments of the present invention.
[0061] Figure 1 It is a schematic flowchart of the method for applying the improved pigeon flock optimization algorithm according to an embodiment of the present invention to the single - warehouse multi - traveling salesman problem. The method includes:
[0062] Step S01 Data division: Use the constrained K - means clustering algorithm to classify the coordinates and divide the overall problem into multiple independent traveling salesman problems;
[0063] Step S02 Construct the shortest path: Generate a certain number of individuals and initial solutions based on the probability - heuristic initialization operation, and iteratively update the initial solutions by applying the greedy crossover operator and the probability crossover operator in sequence;
[0064] Step S03 Eliminate path intersections: Randomly select eight individuals from all individuals to form a group, and perform 2 - opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
[0065] It should be noted that although the operations of the method of the present invention are described in a specific order in the above embodiments and accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.
[0066] In order to more clearly explain the method of applying the above improved pigeon flock optimization algorithm to the single - depot multi - traveling salesman problem, the following will be described in conjunction with a specific embodiment. However, it should be noted that this embodiment is only for better explaining the present invention and does not constitute an improper limitation of the present invention.
[0067] The following will further illustrate in more detail the method of applying the improved pigeon flock optimization algorithm to the single - depot multi - traveling salesman problem with a specific example:
[0068] In order to improve the route optimization quality of multiple salespersons, the present invention adopts the constrained K - means algorithm. As Figure 2 shown, this algorithm optimizes the design of constraints such as the fixed - radius range of the clustering center and the minimum number of members in each cluster. As Figure 3 shown, by combining these constraints, the K - means algorithm can be enhanced to make the distribution of the clustering centers more uniform. In addition, to provide more efficient and higher - quality solutions, how IPIO combines with the constrained K - means algorithm, explores their effectiveness in SDMTSP, and compares with traditional operations. By introducing an improved strategy combined with IPIO to address the challenges related to multi - salesperson route planning.
[0069] The single - depot multi - traveling salesman problem is formulated as an optimization problem with three constraints and one optimization objective. The objective is to minimize the total travel distance of all traveling salesmen while satisfying the following constraints:
[0070] The objective function is to minimize the total path length of all traveling salesmen, where the path length is the sum of the distances from the depot to each target point. G=(V, E) represents an undirected graph, where the vertex set V = {v0, v1, …, v n contains a starting point v0 and a series of cities to be visited: v1, v2, …, v n . The edge set E covers all possible connections between cities, and each e (i,j) is associated with a weight c (i,j) , representing the distance between city i and the city. The objective function:
[0071]
[0072] Each city must and can only be visited once by a traveling salesman. Unique visit constraint:
[0073]
[0074] The path of each traveling salesman must form a closed loop. Path closed-loop constraint:
[0075]
[0076] Each traveling salesman must start from the warehouse and return to the warehouse. Starting and ending point constraint:
[0077]
[0078] Definition of the fitness function for path length, where D(C i , C i+1 ) represents the distance between cities C i and C i+1 , and F is the total path length. Path length calculation:
[0079]
[0080] Calculation of the time complexity of the improved pigeon flock optimization algorithm, where T is the maximum number of iterations, N is the population size, and D is the number of cities.
[0081] C = O(T·N·D)
[0082] The coding method and the initialization process together define the solution space of the problem, where the order in which an individual visits cities determines the specific representation of the solution. Through probabilistic heuristic initialization, a certain number of individuals are generated as the initial population for problem solving.
[0083] In the application of the algorithm, there are N cities and S individuals, and each individual must satisfy the following constraint conditions:
[0084] 1. The length of each individual is N - 1 in uppercase, indicating that each entity must visit all cities except the starting point.
[0085] 2. To ensure that each city is visited only once, each element in the individual must be unique.
[0086] Specifically, data partitioning: Download coordinate data sets of multiple distributions from the TSP database, and use the constrained K-means clustering algorithm to preliminarily classify the coordinates. This algorithm optimizes the design of constraints such as the fixed radius range of the clustering center and the minimum number of members in each cluster. By combining these constraints, the K-means algorithm can be enhanced to make the distribution of the clustering centers more uniform. The overall problem is divided into multiple independent traveling salesman problems. The solution process is specifically divided into the following steps:
[0087] 1. Initialize the center, input the dataset, and prepare n data points X = {x1, x2, …, x n}. Set the number of clusters K to be divided. Initialize the center points, randomly select K data points as the initial cluster centers C = {c1, c1, …, c K}, define the constraints, and determine the constraints for each cluster:
[0088] The radius range of each cluster cannot exceed the predefined maximum value;
[0089] The number of members in each cluster must meet the minimum requirement;
[0090] 2. Assign data points to clusters. According to each data point x i and the centers c of K clusters j , calculate the distance and assign the data point x i to the nearest cluster center c j . The distance is usually calculated using the Euclidean distance or other similarity metric formulas:
[0091]
[0092] 3. Check if the constraints are satisfied. Ensure that the number of members in each cluster is within the predefined range and that the distance between the points within each cluster and the center does not exceed the set maximum radius R. If a certain cluster does not meet the constraint conditions:
[0093] (1) If the number of members in a certain cluster is less than the minimum requirement, re - adjust the assignment of data points;
[0094] (2) If the radius of a certain cluster exceeds the maximum range, recalculate the cluster center or adjust the data point assignment;
[0095] 4. Update the cluster centers. Calculate the mean value. Each cluster center is updated to the average of all data points in that cluster, where S j represents all data points within cluster j.
[0096]
[0097] 5. Check the stopping condition. If the difference in the positions of the new cluster centers from the previous iteration is less than the threshold, or the assignment of data points no longer changes, or the maximum number of iterations is reached, the algorithm stops:
[0098] ||C new -C old || < ∈
[0099] If not converged, go back to step 2 and continue the iteration.
[0100] 6. Output the clustering results, including the center points of each cluster and the assignment of cluster members, ensuring that the final results meet all the constraints.
[0101] Probabilistic Heuristic Initialization: To utilize the prior knowledge of the target point positions, a prior target distance matrix is constructed:
[0102]
[0103] where d ij represents the distance between the i-th target point and the j-th target point;
[0104] This method enhances the adaptability of the initialized individuals. Based on the previous target distance (TG) matrix, a probabilistic heuristic initialization matrix (PHI) is defined for probabilistic heuristic initialization:
[0105]
[0106] The core concept of probabilistic heuristic initialization is as follows: The initial solution of an individual is based on a probability vector. Each element of this vector represents the probability of moving from the current target point to the next target point. The probability vector P i = [p i1 ... p iv , where p iv = PHI(i, v) α , 1 ≤ i ≤ n, α = 5, v = length(ving), and 0 ≤ v ≤ (n - 1), ving represents the vector of the next target point to be visited, and i represents the i-th target point that has been visited. Therefore, P i represents the probability of moving from the i-th target point that has been visited to the next target point to be visited. As the initialization process progresses, the range of potential targets gradually shrinks. In other words, as the initialization continues, the size of P i gradually decreases from (n - 1) to 0.
[0107] After calculating the probability vector, the next step is to select the target point to be visited. The path selection is known through the cumulative probability matrix:
[0108]
[0109] where φ nm is the heuristic information (such as the reciprocal of the city distance), P nm is the normalized probability from city n to city m, and PCRC nm is the cumulative probability used for path selection.
[0110] At this stage, each target point is assigned a ratio PRC i , representing its probability among all potential access points, PRC i = cumsum(PR i ), where As the algorithm progresses, the number of target points to be accessed gradually decreases, resulting in dynamic changes in probability. A criterion is established to determine the next target point to be accessed.
[0111] Improving the quality of the solution: The initial solution generated is iteratively updated, applying the greedy crossover operation and the probabilistic crossover operation in sequence. The greedy crossover operation rapidly improves the quality of the solution through a local optimization strategy, while the probabilistic crossover operator introduces diversity through randomness, helping the algorithm avoid being trapped in local optimal solutions
[0112] Greedy crossover operation: In the improved pigeon flock algorithm, X gbest represents the current global best position. During the evolution of the algorithm, there is always only one Xx best . Compared with other individuals, X gbest contains more valuable information and provides more effective insights for other individuals. This indicates that X gbest plays a crucial guiding role in the entire population. Based on these characteristics of gbest, a greedy crossover operator is adopted to enhance its performance.
[0113] As Figure 3 shown, the greedy crossover operator operates based on the greedy target distance vector, which is represented as GTD = [gd1 … gd n T , n represents the length of the individual, and gd n represents the city closest to city n. The greedy crossover operator indicates that the insertion position of the selected exchange segment is fixed. However, this fixed characteristic does not mean that the insertion point of each element is the same; the selection method is relatively fixed. Specifically, the exchange segment is directly inserted after the closest element.
[0114] The first element of the exchange segment is called the head, and the closest element is determined by GTD as the closest element. Inserting the exchange segment immediately after the closest element can minimize the distance between the head and the closest element. This is a strategic insertion method aimed at improving the performance of the algorithm. However, it should be noted that a special situation may occur where the same element in the current array and the exchange segment has been removed. Therefore, if the closest element is within the exchange segment, it cannot be found in the current array. In this case, the exchange segment will be appended to the end of the current array sequence.
[0115] Probabilistic crossover operation: In the improved pigeon flock algorithm, the population sometimes encounters the problem of local convergence. To solve this problem, this study introduced a probabilistic crossover operator during the optimization process. First, a location coordinate (Loction, Loc) matrix is defined:
[0116]
[0117] where n represents the number of cities, m represents n - 1, and l nm represents the distance between the nth city and its mth nearest city;
[0118] Based on the location coordinate matrix, a probabilistic crossover matrix PC is generated, where the matrix elements represent the probability of moving from the current target point to the next target point:
[0119]
[0120] In this case, p nm represents the probability of transitioning from city n to the city nearest to city m, and these probabilities are derived from the probabilistic heuristic initialization matrix.
[0121] Next, the next city to be visited needs to be selected. At this stage, each city is assigned a proportion representing the likelihood of being selected among all candidate cities, and a Greedy Crossover Rate (PCR) matrix is generated:
[0122]
[0123] As Figures 5 - 7 shown, the core idea of the probabilistic crossover operation is based on the Greedy Crossover Rate Cumulative Sum (PCRC) matrix to guide the generation and optimization of solutions, defined as PCRC = [cumsum(PRC(1,:))... cumsum(PRC(n,:))] T , where each element represents the cumulative sum of itself and the previous column elements.
[0124] The elements in the PCRC matrix are assigned corresponding proportions. According to the first element of the exchange segment, the relevant element pnear can be selected from the PCRC matrix. By comparing the value of pnear with a given criterion, a set of potential insertion positions can be obtained from LOC. The elements in LOC are sorted in ascending order of proximity, and the first element near is selected as the insertion point for the exchange segment. This segment is then immediately inserted after near. One special case needs to be noted: If the same elements have been removed from the current batch and the exchange segment, and the near element in the exchange segment does not exist in the current batch, the exchange segment will be placed at the end of the current sequence.
[0125] Eliminating path intersections: Eliminating path intersections is a crucial step in solving the Traveling Salesman Problem. Considering the computational time required by the 2-opt local optimization algorithm, an improved method is proposed in this paper to optimize the individuals in the pigeon-inspired optimization algorithm. Specifically, eight individuals are randomly selected from all the individuals to form a group. The individual with the highest fitness ranking will undergo 2-opt local optimization, and the optimized sequence will then serve as the representative of the group.
[0126] As Figure 8 shown, the algorithm was tested on a case consisting of 100 cities and 5 salespersons, where each salesperson must visit at least 3 cities. The experiment was carried out with the PGA, IPGA, and PSO algorithms for 5000 iterations because the convergence tends to stabilize after this number of iterations. The test and the test solutions are presented, specifically the routes obtained using these algorithms. In this scenario, the running times of the algorithms are listed in Table 1. In Table 1, the value before "±" represents the average processing time of 35 tests, while the value after "±" represents the dispersion of the same 35 tests.
[0127] This experiment covered problems of different scales and numbers of salespersons. In particular, multiple instances such as kroA100, kroA150, kroA200, eil101, and att48 were used, which have been widely applied in previous studies on other types of MTSP problems. In Table 1, M represents the number of salespersons, ranging from 2 to 20. This selection is based on common practices in other MTSP algorithms, and scenarios involving 2 to 20 salespersons were tested. All the calculation results are listed in Table 1, and each data point represents the average optimal travel length obtained from 30 independent experiments. The best optimization results for each instance are shown in bold. The "Instance" column in the table shows the name of the test instance and the corresponding number of salespersons, demonstrating the significant advantage of IPIO in terms of solution quality.
[0128] Table 1
[0129]
[0130]
[0131] In subsequent tests, the minimum number of cities that a salesperson must visit was set to 1. The average best solution was obtained from the average of 35 test results, and the standard deviation was calculated based on the same 35 tests. The detailed results are shown in Table 2. Generally, as the number of sales representatives increases, the average best solution value tends to reach a maximum. However, in some cases, this value decreases, and the entries underlined and in bold in Table 2 have highlighted this.
[0132] Table 2
[0133]
[0134]
[0135] Based on the same inventive concept, the present invention also proposes a device for applying an improved pigeon flock optimization algorithm to the single - warehouse multi - traveling salesman problem. The implementation of this device can refer to the implementation of the above - mentioned method, and the repeated parts will not be described again. As Figure 9 shown, the device 100 includes:
[0136] A data partitioning module 101: used to classify coordinates using the constrained K - means clustering algorithm, and divide the overall problem into multiple independent traveling salesman problems;
[0137] A shortest - path construction module 102: used to generate a certain number of individuals and initial solutions based on a probability - heuristic initialization operation, and iteratively update the initial solutions by applying a greedy crossover operator and a probability crossover operator in sequence;
[0138] A path crossover elimination module 103: used to randomly select eight individuals from all individuals to form a group, and perform 2 - opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
[0139] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the described modules can refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
[0140] As Figure 10 shown, the device includes a central processing unit (CPU), which can execute various appropriate actions and processes according to computer program instructions stored in a read - only memory (ROM) or computer program instructions loaded from a storage unit into a random - access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0141] Multiple components in the device are connected to the I / O interface, including: an input unit, such as a keyboard, a mouse, etc.; an output unit, such as various types of displays, speakers, etc.; a storage unit, such as a disk, an optical disc, etc.; and a communication unit, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0142] The processing unit executes the various methods and processes described above, such as method steps S01 to S03. For example, in some embodiments, method steps S01 to S03 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more of the method steps S01 to S03 described above may be executed. Alternatively, in other embodiments, the CPU may be configured to execute method steps S01 to S03 by any other suitable means (e.g., by means of firmware).
[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] The program code for implementing the method of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, a special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on the remote machine or server.
[0145] In the context of the present invention, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0146] In addition, although the operations are depicted in a particular order, this should be understood as requiring that the operations be performed in the particular order shown or in sequential order, or that all of the illustrated operations be performed to achieve the desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details were included in the foregoing discussion, these should not be construed as limiting the scope of the invention. Certain features that are described in the context of separate embodiments may also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation may also be implemented separately or in any suitable subcombination in multiple implementations.
[0147] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An improved method for applying the pigeon flock optimization algorithm to the single-warehouse multi-traveling salesman problem, characterized in that, The method includes: Step S01 data partitioning: Classify the coordinates using the constrained K-means clustering algorithm, and divide the overall problem into multiple independent traveling salesman problems; Step S02 constructing the shortest path: Generate a certain number of individuals and initial solutions based on the probability heuristic initialization operation, and iteratively update the initial solutions by applying the greedy crossover operator and the probability crossover operator in sequence; Step S03 eliminating path intersections: Randomly select eight individuals from all individuals to form a group, and perform 2-opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
2. The method for applying the improved pigeon flock optimization algorithm to the single-warehouse multi-traveling salesman problem according to claim 1, wherein The specific content of step S01 is: Step S011: Input the data set, prepare n data points X = {x1, x2, …, x i , …, x n}, set the number of clusters K to be divided, initialize the center points, randomly select K data points as the initial cluster centers C = {c1, c2, …, c j , …, c K}, and define the constraint conditions; Step S012: According to each data point x i and the centers c of K clusters j , calculate the distances, and assign the data point x i to the nearest cluster center c j ; Step S013: Check whether the constraint conditions are met; Step S014: Update each cluster center to the average value of all data points in the cluster; If the difference between the new cluster center position and the previous iteration is less than the threshold, or the assignment of data points no longer changes, or the maximum number of iterations is reached, the algorithm stops; Step S015: Output the center points of each cluster and the cluster member assignments.
3. The method for applying the improved pigeon flock optimization algorithm described in claim 2 to the single-warehouse multi-traveling salesman problem is characterized in that, The constraint conditions described in step S011 are: The radius range of each cluster cannot exceed a predefined maximum value; The number of members in each cluster must meet the minimum requirements.
4. The method for applying the improved pigeon flock optimization algorithm to the single-warehouse multi-traveling salesman problem according to claim 3, characterized in that The specific content of step S013 is: If the number of members in a certain cluster is less than the minimum requirement, readjust the assignment of data points; If the radius of a certain cluster exceeds the maximum range, recalculate the cluster center or adjust the assignment of data points.
5. The method for applying the improved pigeon flock optimization algorithm to the single-warehouse multi-traveling salesman problem according to claim 1, characterized in that, The core concept of the probability heuristic initialization described in step S02 is that the initial solution of an individual is based on a probability vector P i , and each element of this vector represents the probability of moving from the current target point to the next target point. The calculation steps are as follows: Construct a prior target distance matrix: where d ij represents the distance between the i-th target point and the j-th target point; Define a probability heuristic initialization matrix based on the probability heuristic initialization of the previous target distance matrix: Probability vector P i = [p i1 … p iv , where p iv = PHI(i, v) α , 1 ≤ i ≤ n, α = 5, v = length(ving), and 0 ≤ v ≤ (n - 1), ving represents the vector of the next target point to be visited, and i represents the i-th target point that has been visited.
6. The method for applying the improved pigeon flock optimization algorithm to the single-warehouse multi-traveling salesman problem according to claim 5, characterized in that, Select the target point to be visited after calculating the probability vector: Know the path selection through the cumulative probability matrix: Among them, φ nm is heuristic information, P nm is the normalized probability from city n to city m, and PCRC nm is the cumulative probability for path selection; Each target point is assigned a ratio PRC i , representing its probability among all potential access points, PRC i = cumsum(PR i ), where 7. The method for applying the improved pigeon flock optimization algorithm described in claim 1 to the single-warehouse multi-traveling salesman problem is characterized in that The specific content of the probability crossover operator described in step S02 is: Step S021: Define the position coordinate matrix LOC: Among them, n represents the number of cities, m represents n - 1, and l nm represents the distance between the nth city and its mth nearest city; Step S022: Generate a probability crossover matrix PC based on the position coordinate matrix, where the matrix elements represent the probability of moving from the current target point to the next target point: p nm represents the probability of transitioning from city n to the city closest to city m; Step S023: Each city is assigned a ratio representing the possibility of being selected among all candidate cities, and a probability crossover rate matrix PCR is generated: Step S024: Generate and optimize the solution based on the cumulative sum matrix of the crossover rate PCRC, where PCRC = [cumsum(PRC(1,:))... cumsum(PRC(n,:))], and each element represents the cumulative sum of itself and the previous column elements. T , where each element represents the cumulative sum of itself and the previous column elements.
8. Device for improving pigeon flock optimization algorithm applied to single - warehouse multi - traveling salesman problem, characterized in that, The device implements the method described in any one of claims 1 to 7, including: A data partitioning module: used to initially classify the coordinates using the constrained K-means clustering algorithm, and divide the overall problem into multiple independent traveling salesman problems; A shortest path construction module: used to generate a certain number of individuals and initial solutions based on the probability heuristic initialization operation, and iteratively update the initial solutions by applying the greedy crossover operator and the probability crossover operator in sequence; A path intersection elimination module: used to randomly select eight individuals from all individuals to form a group, and perform 2-opt local optimization on the individual with the highest fitness ranking within the group. The optimized sequence is used as the representative of the group to complete the task of allocating the optimal path.
9. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1 to 7.