School site selection method and device based on fast convergence ant colony algorithm

By introducing distance guidance factor, directional coupling factor and greedy factor into the school site selection algorithm, the convergence speed and search ability of the ant colony algorithm are improved, and the problems of large calculation volume and slow convergence in the existing technology are solved, achieving more efficient and Accurate school site selection path planning.

CN119273393BActive Publication Date: 2025-02-25NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411796909.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-02-25
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The algorithms used for school site selection in the prior art have too high computational volume or slow convergence, which is easy to fall into the problem of local optimality, and it is difficult to meet the computing efficiency and robustness requirements of practical applications.

Method used

Adopt the school site selection method based on the fast convergence ant colony algorithm. By introducing distance guidance factor and direction coupling factor, the intelligence of ants in node decision-making is improved, and the global search ability of the algorithm is enhanced through greedy factors to quickly find the best path. .

Benefits of technology

It effectively accelerates the convergence speed of the algorithm, improves the calculation efficiency and the accuracy of path planning, avoids local optimal traps, and enhances the robustness of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273393B_ABST
    Figure CN119273393B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for selecting a school site based on a fast-convergence ant colony algorithm. The fast-convergence ant colony algorithm in the method includes: using intersections as nodes and roads as edges to obtain an undirected graph; using the location of sample residents as the starting point and the address of an alternative school as the end point; after multiple rounds of iterations, outputting the path with the shortest distance between the starting point and the end point as the best path; in the state transfer stage, introducing a distance guidance factor and a direction coupling factor to calculate the transfer probability of the ant moving to the next node; in the pheromone update stage, introducing a greedy factor in the probability function. The above technical solution is adopted to introduce a distance guidance factor and a direction coupling factor, so as to improve the intelligence of the ant in making decisions at each node, accelerate the convergence of the algorithm, improve the computing efficiency, and improve the accuracy of path planning; introducing a greedy factor enables the algorithm to obtain a greater breadth search capability in the early stage of the search, thereby ensuring the global search capability of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urban planning, and in particular to a method and device for selecting a school site based on a fast-convergence ant colony algorithm. Background Art

[0002] The choice of school address is a relatively important part of urban planning management. There is a strong relationship between the school address and the residents. In daily life scenarios, residents usually need to pick up and drop off their children to and from school. Therefore, the transportation convenience of the school address in the city needs to be given special consideration.

[0003] However, there is a lack of a quantitative analysis framework for the degree of fit between population distribution and school location, as well as for the analysis of accessibility around schools. This makes school location selection subjective and arbitrary to a certain extent, and is difficult to adapt to the changing trends in the existing urban resident structure.

[0004] In the existing technology, path planning algorithms for graph search are also chosen, but this algorithm has certain limitations when facing urban scenarios, because the amount of calculation of the algorithm increases exponentially with the increase of the number of nodes on the graph. In addition, classic intelligent algorithms such as ant colony algorithms and simulated annealing algorithms often have problems such as slow convergence and easy to fall into local optimality, resulting in the algorithm's computational efficiency and robustness being difficult to meet the requirements of actual applications. Summary of the invention

[0005] Purpose of the invention: The present invention provides a school site selection method and device based on a fast-convergence ant colony algorithm, aiming to solve the problem that the algorithms used for school site selection in the prior art have too high computational complexity, slow convergence, and are prone to falling into local optimal calculations.

[0006] Technical solution: The present invention provides a school site selection method based on a fast-convergence ant colony algorithm, including: performing preliminary site selection on a school to obtain a plurality of candidate school addresses, setting a corresponding school service area for each candidate school address, and generating sample residents within the school service area; calculating the optimal path between each sample resident and the corresponding candidate school address within the school service area through the fast-convergence ant colony algorithm, and selecting the actual school address from the plurality of candidate school addresses according to the optimal path distribution of each school service area; the fast-convergence ant colony algorithm includes: obtaining an undirected graph using intersections within the school service area as nodes and roads connecting the intersections as edges; obtaining an undirected graph using the locations of the sample residents on the undirected graph as the starting point and the candidate school address as the end point; after multiple rounds of iterations, when the stopping condition is met, outputting the path with the shortest distance between the starting point and the end point as the optimal path; each round The iteration includes a state transfer phase and a pheromone update phase, wherein: in the state transfer phase, the ants are set to move from the starting point to the end point; during the movement process, a distance guidance factor and a direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node; the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction; in the pheromone update phase, a probability function is introduced to calculate the pheromone concentration left by the selected ants on the edge in the undirected graph, and the higher the pheromone concentration of the edge, the higher the transfer probability of the ants moving through the corresponding edge to the next node; a greedy factor is introduced in the probability function, and the greedy factor represents the attenuation degree of the pheromone concentration as the number of iteration rounds increases.

[0007] Specifically, the area formed by the address of the alternative school as the center and the standard distance as the radius is the school service area.

[0008] Specifically, the location distribution of sample residents is consistent with the distribution of actual residents within the school service area, and the number of sample residents is proportional to the number of actual residents within the school service area.

[0009] Specifically, the introduction of the distance guidance factor and the direction coupling factor to calculate the transfer probability of the ant moving to the next node includes: the transfer probability is calculated using the following formula:

[0010] P ij =(τ ij α η ij β ρ j σ ij ) / (∑ k∈K τ ik α η ikβ ρ k ),

[0011] Among them, P ij represents the transition probability of an ant moving from node i to node j, τ ij represents the pheromone concentration on the edge between node i and node j, α represents the information heuristic factor, η ij represents the expected value of moving from node i to node j, β represents the expected value heuristic factor, and ρ j represents the distance guidance factor corresponding to node j, σ ij represents the directional coupling factor corresponding to moving from node i to node j, K represents the set of nodes k that the ant can move to next when it is at node i, and the set K does not include the nodes that the ant has moved to; η ij =1 / C ij , C ij =d ij / v ij , C ij represents the cost value of the edge between node i and node j, d ij represents the length of the edge between node i and node j, v ij It indicates that the movement speed of sample residents through the edge between node i and node j is positively correlated with the smoothness of the edge between node i and node j.

[0012] Specifically, the distance guidance factor is calculated using the following formula:

[0013] When j≠t, use: ρ j =1 / L jt ;

[0014] When j=t, use: ρ j =1,

[0015] Among them, L jt represents the straight-line distance from node j to end point t;

[0016] The directional coupling factor is calculated using the following formula:

[0017] σ ij =e^(x i,j x i,t / ||x i,j || 0.5 ||x i,t || 0.5 ),

[0018] Where e represents the natural logarithm, x i,j represents the vector from node i to node j, x i,t Represents the vector pointing from node i to end point t.

[0019] Specifically, the pheromone concentration is calculated using the following formula:

[0020] τ ij (s+1)=(1-r) τ ij (s+1)+△τ ij (s),

[0021] Among them, τ ij (s+1) represents the pheromone concentration on the edge between node i and node j in the s+1th iteration, r represents the pheromone volatility coefficient, △τ ij (s) represents the pheromone concentration left on the edge between node i and node j by the ant selected in the sth iteration.

[0022] Specifically, the pheromone concentration left by the selected ant m on the edge between node i and node j is calculated using the following formula:

[0023] △τ ij m (s) = Q / C m (s),

[0024] Among them, △τ ij m (s) represents the pheromone concentration left by ant m on the edge between node i and node j in the sth iteration, Q represents the total amount of pheromone, C m (s) represents the sum of the cost values ​​of the complete moving path of ant m on the undirected graph in the sth iteration, which is calculated using the following formula:

[0025] C=d / v,

[0026] Among them, C represents the cost value, d represents the length of the complete moving path of the ant on the undirected graph in one round of iteration, and v represents the moving speed of the sample residents.

[0027] Specifically, the probability function adopts the following formula:

[0028] When ant m reaches the end point and the moving path is the shortest, use: Z m (s)=1;

[0029] When ant m reaches the end point and the moving path is not the shortest, use: Z m (s) = ελ s ,

[0030] Among them, Z m (s) represents the probability of ant m being selected in the sth iteration, ε represents the initial coefficient of the greed factor, and λ s Represents the greed factor attenuation coefficient.

[0031] Specifically, the alternative school address in the school service area with the shortest average distance of the best path is selected as the actual school address.

[0032] Specifically, the location of the sample residents on the undirected graph is taken as the starting point, the address of the alternative school is taken as the first end point, and the work place of the sample residents is taken as the second end point; the undirected graph includes the work places of the sample residents, and the work places of the sample residents are consistent with the distribution of actual office buildings in the school service area, and the number of work places is consistent with the number of sample residents; the path with the shortest distance between the output starting point and the end point is taken as the optimal path, and also includes: the path between the starting point and the first end point is taken as the first path, the path between the first end point and the second end point is taken as the second path, and the path with the shortest sum of the first path and the second path is taken as the optimal path; in the state transfer stage, the ants are set to move from the starting point to the first end point, and after reaching the first end point, they start to move to the second end point.

[0033] The present invention also provides a school site selection device based on a fast-converging ant colony algorithm, comprising: a site selection unit, a screening unit and an ant colony algorithm unit, wherein: the site selection unit is used to perform preliminary site selection on the school, obtain multiple candidate school addresses, set a corresponding school service area for each candidate school address, and generate sample residents in the school service area; the screening unit is used to calculate the best path between each sample resident in the school service area and the corresponding candidate school address through the fast-converging ant colony algorithm, and select the actual school address from multiple candidate school addresses according to the best path distribution of each school service area; the ant colony algorithm unit is used to execute the fast-converging ant colony algorithm, including: using intersections in the school service area as nodes and roads connecting the intersections as edges to obtain an undirected graph; using the locations of the sample residents on the undirected graph as the starting point and the candidate school addresses as the end point; after multiple rounds of iterations, when the stop condition is met, output The path with the shortest distance between the starting point and the end point is taken as the optimal path; each round of iteration includes a state transfer stage and a pheromone update stage, wherein: in the state transfer stage, the ants are set to move from the starting point to the end point; during the movement process, a distance guidance factor and a direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node; the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction; in the pheromone update stage, a probability function is introduced to calculate the pheromone concentration left by the selected ants on the edge in the undirected graph, and the higher the pheromone concentration of the edge, the higher the transfer probability of the ant moving through the corresponding edge to the next node; a greedy factor is introduced in the probability function, and the greedy factor represents the attenuation degree of the pheromone concentration with the increase of the number of iteration rounds.

[0034] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: the introduction of distance guidance factors and direction coupling factors can improve the intelligence of ants when making decisions at each node, effectively filter out obvious inferior solutions, accelerate algorithm convergence, improve computing efficiency, and improve the accuracy of path planning; the introduction of greedy factors enables the algorithm to obtain a greater breadth search capability in the early stage of the search, with a greater possibility of jumping out of the local minimum, ensuring the global search capability of the algorithm, and at the same time, it does not fall into a blind search of a huge solution space in the middle and late stages of the search process, thereby increasing the robustness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the flow of the school site selection method based on the fast-convergence ant colony algorithm provided by the present invention;

[0036] Figure 2 A schematic diagram of an undirected graph provided by the present invention;

[0037] Figure 3 A schematic diagram of the best path on the undirected graph provided by the present invention;

[0038] Figure 4 A convergence diagram of the fast-convergence ant colony algorithm provided by the present invention. DETAILED DESCRIPTION

[0039] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.

[0040] See also Figure 1 , which is a flow chart of the school site selection method based on the fast-convergence ant colony algorithm provided by the present invention.

[0041] In the embodiment of the present invention, a preliminary site selection is performed on the school to obtain a plurality of candidate school addresses, a corresponding school service area is set for each candidate school address, and sample residents are generated within the school service area.

[0042] In the specific implementation, the site selection conditions are used to screen out the candidate school addresses that meet the site selection conditions. The site selection conditions include: (1) the land use type cannot be industrial, commercial, residential or green space; (2) the distance to the existing school is greater than 1,500 meters; (3) the population density is greater than 2,000 people / square kilometer.

[0043] In the specific implementation, further, the distance from the existing school to each candidate school address is determined, the area of ​​each candidate school address is determined, all candidate school addresses are grouped into a candidate address set, and the candidate school addresses are preliminarily stratified and screened according to the site selection conditions. The site selection screening conditions include: land use type, school type, distance from the existing school, and school size. The specific screening steps include: (1) screening out site selection units that meet the requirements for establishing school facilities based on the land use type; (2) based on the type of school and the distance to schools of the same type, the distance should be greater than the preset distance threshold; screening based on school size, the school size is based on the school's land area.

[0044] In the embodiment of the present invention, an area formed with the address of the candidate school as the center and a standard distance (usually 300 to 1000 meters) as the radius is the school service area.

[0045] In the embodiment of the present invention, the location distribution of the sample residents is consistent with the distribution of the actual residents in the school service area, and the number of the sample residents is proportional to the number of the actual residents in the school service area.

[0046] In specific implementation, the actual distribution of resident concentrations in the school service area can be obtained, and sample residents can be generated accordingly based on the distribution of resident concentrations. For example, if there are more residents in a certain range, more sample residents will be generated in the corresponding range. The number of sample residents in this range is proportional to the actual number of residents. Generally speaking, the total number of sample residents is proportional to the total number of actual residents in the school service area.

[0047] In an embodiment of the present invention, a fast-converging ant colony algorithm is used to calculate the optimal path between each sample resident in the school service area and the corresponding alternative school address, and the actual school address is selected from multiple alternative school addresses based on the optimal path distribution of each school service area.

[0048] In the embodiment of the present invention, the candidate school address in the school service area with the shortest average distance of the best path is selected as the actual school address.

[0049] In specific implementation, by calculating the optimal path between each sample resident in the school service area and the corresponding alternative school address, the average distance of the optimal path in the school service area can be further obtained. Among multiple school service areas, the optimal path with the shortest average distance is selected, and the corresponding alternative school address is used as the actual school address.

[0050] In an embodiment of the present invention, in a fast-converging ant colony algorithm, intersections within the school service area are used as nodes, and roads connecting the intersections are used as edges to obtain an undirected graph; the locations of sample residents on the undirected graph are used as starting points, and the addresses of alternative schools are used as end points.

[0051] In the embodiment of the present invention, after multiple rounds of iterations, when the stopping condition is met, the path with the shortest distance between the starting point and the end point is output as the optimal path; each round of iteration includes a state transfer phase and a pheromone update phase.

[0052] In the specific implementation, the starting point is the location of a sample resident, and the end point is the location of the alternative school address. After multiple rounds of iterations, the ant colony algorithm outputs the path with the shortest distance between the starting point and the end point as the optimal path; the optimal path between each sample resident and the alternative school address is calculated one by one, thereby obtaining the optimal path distribution of the corresponding school service area.

[0053] In a specific implementation, the stopping condition of the ant colony algorithm can be set accordingly according to the actual scenario, and can generally be set to the number of iterations of the ant colony algorithm (for example, 500 times), or the shortest path obtained by a specific number of consecutive iterations (for example, 5 times) can be set to remain unchanged or the change amplitude is less than a preset domain value.

[0054] In an embodiment of the present invention, in the state transfer stage, ants (the number of ants can be set according to the actual application scenario) are set to move from the starting point to the end point; during the movement process, a distance guidance factor and a direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node.

[0055] In an embodiment of the present invention, the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction.

[0056] In the embodiment of the present invention, the transition probability is calculated using the following formula:

[0057] P ij =(τ ij α η ij β ρ j σ ij ) / (∑ k∈K τ ik α η ik β ρ k ),

[0058] Among them, P ij represents the transition probability of an ant moving from node i to node j, τ ij represents the pheromone concentration on the edge between node i and node j, α represents the information heuristic factor, η ijrepresents the expected value of moving from node i to node j, β represents the expected value heuristic factor, and ρ j represents the distance guidance factor corresponding to node j, σ ij represents the directional coupling factor corresponding to moving from node i to node j, and K represents the set of the next movable node k when the ant is at node i. The set K does not include the nodes that the ant has already moved to.

[0059] In the specific implementation, k represents the next possible node that the ant may move to when it is at node i, and is directly connected to node i through an edge. The information heuristic factor α represents the influence of pheromone concentration on the transition probability, which can be set according to the actual application scenario. The expected value heuristic factor β represents the influence of weight cost on the transition probability, which can also be set according to the actual application scenario.

[0060] In a specific implementation, η ij The calculation is done using the following formula:

[0061] η ij =1 / C ij ,

[0062] Among them, C ij represents the cost value of the edge between node i and node j, C ij =d ij / v ij , where d ij represents the length of the edge between node i and node j, v ij represents the moving speed of the sample residents passing through the edge between node i and node j, v ij It is positively correlated with the smoothness of the edge between node i and node j.

[0063] In the specific implementation, by introducing the moving speed which is positively correlated with the smoothness of the road, the cost value in the formula is associated with the moving speed, and the expected value is further associated with the speed of travel, and finally the transfer probability can be associated with the moving speed. The effect is that the ants are more inclined to choose nodes with faster moving speed and smoother roads. Compared with the traditional algorithm, the best (shortest) path finally output by the algorithm is not only the shortest total actual distance of the road, but also takes into account the faster moving speed and shorter time consumption based on the length of the road. In this way, the best path finally obtained is more in line with the actual application scenario. In actual applications, the path with a shorter distance may take longer, because some residents now choose to drive to pick up their children to school, and some popular roads are usually congested. The choice of school address should avoid busy traffic areas.

[0064] In the embodiment of the present invention, the distance guidance factor is calculated using the following formula:

[0065] ρ j =1 / L jt (j≠t, used when node j and end point t are not in the same position), ρ j =1 (j=t, used when node j and end point t are at the same location), where L jt represents the straight-line distance from node j to end point t.

[0066] In the embodiment of the present invention, the directional coupling factor is calculated using the following formula:

[0067] σ ij =e^(x i,j x i,t / ||x i,j || 0.5 ||x i,t || 0.5 ),

[0068] Where e represents the natural logarithm, x i,j represents the vector from node i to node j (first direction), x i,t represents the vector pointing from node i to end point t (second direction), and ||·|| represents the 2-norm.

[0069] In the specific implementation, the distance guidance factor and direction coupling factor are added to improve the intelligence of ants when deciding to move to the next node. In the classic ant colony algorithm, ants make decisions purely based on pheromones and the distance between nodes, which may cause ants to fall into a local optimal solution, often resulting in serious waste of calculations. Therefore, by introducing the distance guidance factor and direction coupling factor, ants tend to choose nodes that are closer to the destination and in the same direction as the destination, thereby accelerating the convergence speed of the algorithm and improving the algorithm's computational efficiency. At the same time, it also makes the algorithm more adaptable to the traffic conditions of different roads in the city and improves the accuracy of path planning.

[0070] In an embodiment of the present invention, in the pheromone update stage, a probability function is introduced to calculate the pheromone concentration left by the selected ant on the edge in the undirected graph. The higher the pheromone concentration of the edge, the higher the transfer probability of the ant moving through the corresponding edge to the next node; a greedy factor is introduced into the probability function, and the greedy factor represents the degree of attenuation of the pheromone concentration as the number of iterations increases.

[0071] In the embodiment of the present invention, the pheromone concentration is calculated using the following formula:

[0072] τ ij (s+1)=(1-r) τ ij (s+1)+△τ ij (s),

[0073] Among them, τ ij (s+1) represents the pheromone concentration on the edge between node i and node j in the s+1th iteration, r represents the pheromone volatility coefficient (which can be set according to the actual application scenario), △τ ij (s) represents the pheromone concentration left on the edge between node i and node j by the ant selected in the sth iteration.

[0074] In a specific implementation, if the pheromone concentration on the edge between node i and node j is higher, the corresponding transfer probability will be higher, that is, when the ant is at node i, the transfer probability that the next moving node is node j is higher.

[0075] In the embodiment of the present invention, if the selected ant m leaves the pheromone concentration on the edge between node i and node j, the following formula is used to calculate:

[0076] △τ ij m (s) = Q / C m (s),

[0077] Among them, △τ ij m (s) represents the pheromone concentration (pheromone concentration increment) left by ant m on the edge between node i and node j in the sth iteration, Q represents the total amount of pheromone (which can be set according to the actual application scenario), and C m (s) represents the sum of the cost values ​​of the complete moving path of ant m on the undirected graph in the sth round of iteration, which is calculated using the following formula: C=d / v, where C represents the cost value, d represents the length of the complete moving path of the ant on the undirected graph in one round of iteration, and v represents the (average) moving speed of the complete moving path of the sample residents on the undirected graph.

[0078] In the specific implementation, only the selected ants will leave the pheromone concentration on the edge of the undirected graph, and the probability function is introduced to calculate the probability of each ant being selected.

[0079] In the embodiment of the present invention, the probability function adopts the following formula:

[0080] Z m (s) = 1 (used when ant m reaches the end point and the moving path is the shortest), Z m (s) = ελ s (Used when ant m reaches the end point and the moving path is not the shortest), where Z m (s) represents the probability of ant m being selected in the sth iteration, ε represents the initial coefficient of the greed factor (which can be set according to the actual application scenario), and λ represents the attenuation coefficient of the greed factor (which can be set according to the actual application scenario).

[0081] In the specific implementation, if the ant does not reach the end point, the probability of being selected is 0 and no pheromone will be left.

[0082] In the specific implementation, introducing the idea of ​​greedy algorithm to optimize the update rules of pheromones helps the algorithm to jump out of the local minimum, expand the search range of the solution space, and ensure the global search ability of the algorithm; the role of the greedy factor attenuation coefficient is that through attenuation, the algorithm will not blindly search in an overly large solution space, effectively improving the convergence speed of the algorithm and increasing robustness, so that the optimal path finally obtained can be closer to the global optimal result.

[0083] In an embodiment of the present invention, the location of the sample residents on the undirected graph is taken as the starting point, the address of the alternative school is taken as the first end point, and the workplace of the sample residents is taken as the second end point; the undirected graph includes the workplace of the sample residents, and the workplace of the sample residents is consistent with the distribution of actual office buildings in the school service area, and the number of workplaces is consistent with the number of sample residents; the path between the starting point and the first end point is taken as the first path segment, the path between the first end point and the second end point is taken as the second path segment, and the path with the shortest sum of the first path segment and the second path segment is taken as the optimal path; in the state transfer stage, the ants are set to move from the starting point to the first end point, and after reaching the first end point, they start to move to the second end point.

[0084] In the specific implementation, the solution provided by the present invention is further expanded. Considering that in actual application scenarios, most residents need to go to the office to work after picking up their children, the choice of school address should not only consider the proximity to the residents' residence, but also the proximity to both the residents' residence and the workplace, which is more in line with the actual situation.

[0085] In the specific implementation, the distribution of actual office buildings in the school service area can be obtained, and the corresponding workplaces can be distributed according to the actual office building clusters. For example, if there are more office buildings in a certain range, more workplaces will be generated in the corresponding range, and the number of workplaces in the range is proportional to the number of actual office buildings. In general, the total number of workplaces is proportional to or consistent with the total number of sample residents. For a sample resident, a corresponding location (address) and a workplace can be set.

[0086] In a specific implementation, when the work place is taken as the second end point, in a round of iteration, in the state transfer phase, the ant starts from the starting point and moves to the first end point, and after reaching the first end point, it starts to move to the second end point, and after reaching the second end point, the state transfer phase ends and enters the pheromone update phase. In addition, when moving from the starting point to the first end point, the end point in the distance guidance factor and the direction coupling factor is the first end point, and when moving from the first end point to the second end point, the end point in the distance guidance factor and the direction coupling factor is the second end point. The complete moving path of the ant moving on the undirected graph is the sum of the first path and the second path.

[0087] See also Figure 2 , which is a schematic diagram of an undirected graph provided by the present invention (the units of the horizontal and vertical axes represent distances); see Figure 3 , which is a schematic diagram of the optimal path on the undirected graph provided by the present invention (the units of the horizontal and vertical axes represent distances); see Figure 4 , which is a convergence diagram of the fast-convergence ant colony algorithm provided by the present invention.

[0088] In the specific implementation, Figure 2 The undirected graph structure shown is used to simulate the road network structure. There are 31 nodes (circles) and 50 edges (dashed lines) in the figure, and the two red circles are the starting point and the end point respectively.

[0089] In a specific implementation, the school site selection method based on the fast-convergence ant colony algorithm provided by the present invention completes convergence after about 100 iterations. Figure 4 As shown in Figure 2. In fact, this convergence situation describes the optimal result that all ants tend to find under the influence of pheromones. If we only consider the optimal result itself, it can be found after about 30 rounds of iterations. The final shortest path length is 2957.7 meters, as shown in Figure 2. Figure 3 Shown by the red line.

[0090] The present invention also provides a school site selection device based on a fast-converging ant colony algorithm, comprising: a site selection unit, a screening unit and an ant colony algorithm unit, wherein: the site selection unit is used to perform preliminary site selection on the school, obtain multiple candidate school addresses, set a corresponding school service area for each candidate school address, and generate sample residents in the school service area; the screening unit is used to calculate the best path between each sample resident in the school service area and the corresponding candidate school address through the fast-converging ant colony algorithm, and select the actual school address from multiple candidate school addresses according to the best path distribution of each school service area; the ant colony algorithm unit is used to execute the fast-converging ant colony algorithm, including: using intersections in the school service area as nodes and roads connecting the intersections as edges to obtain an undirected graph; using the locations of the sample residents on the undirected graph as the starting point and the candidate school addresses as the end point; after multiple rounds of iterations, when the stop condition is met, output The path with the shortest distance between the starting point and the end point is taken as the optimal path; each round of iteration includes a state transfer stage and a pheromone update stage, wherein: in the state transfer stage, the ants are set to move from the starting point to the end point; during the movement process, a distance guidance factor and a direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node; the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction; in the pheromone update stage, a probability function is introduced to calculate the pheromone concentration left by the selected ants on the edge in the undirected graph, and the higher the pheromone concentration of the edge, the higher the transfer probability of the ant moving through the corresponding edge to the next node; a greedy factor is introduced in the probability function, and the greedy factor represents the attenuation degree of the pheromone concentration with the increase of the number of iteration rounds.

[0091] In a specific implementation, the school site selection device based on the fast-convergence ant colony algorithm provided by the present invention, wherein the unit for executing methods, steps or functions, and the methods, steps or functions executed by them, can refer to the school site selection method based on the fast-convergence ant colony algorithm provided by the present invention.

Claims

1. A school site selection method based on fast convergence ant colony algorithm, characterized in that: include: Conduct a preliminary site selection for the school to obtain multiple candidate school addresses, set a corresponding school service area for each candidate school address, and generate sample residents within the school service area; The fast-converging ant colony algorithm is used to calculate the optimal path between each sample resident in the school service area and the corresponding alternative school address. According to the optimal path distribution of each school service area, the actual school address is selected from multiple alternative school addresses. The fast convergence ant colony algorithm comprises: The intersections within the school service area are taken as nodes, and the roads connecting the intersections are taken as edges to obtain an undirected graph; the locations of the sample residents on the undirected graph are taken as the starting point, and the addresses of the candidate schools are taken as the end point; After multiple rounds of iterations, when the stopping condition is met, the path with the shortest distance between the starting point and the end point is output as the best path; each round of iteration includes a state transfer phase and a pheromone update phase, in which: In the state transfer stage, the ants are set to move from the starting point to the end point; during the movement process, the distance guidance factor and the direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node; the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction; In the pheromone update phase, a probability function is introduced to calculate the pheromone concentration left by the selected ants on the edges in the undirected graph. The higher the pheromone concentration of the edge, the higher the transfer probability of the ant moving through the corresponding edge to the next node. A greedy factor is introduced into the probability function, and the greedy factor represents the attenuation degree of the pheromone concentration as the number of iterations increases.

2. The school site selection method based on fast convergence ant colony algorithm according to claim 1 is characterized in that: The setting of a corresponding school service area for each candidate school address includes: The area formed with the alternative school address as the center and the standard distance as the radius is the school service area.

3. The school site selection method based on fast convergence ant colony algorithm according to claim 1 is characterized in that: The sample residents generated within the school service area include: The location distribution of sample residents is consistent with the distribution of actual residents within the school service area, and the number of sample residents is proportional to the number of actual residents within the school service area.

4. The school site selection method based on fast convergence ant colony algorithm according to claim 1 is characterized in that: The introduction of the distance guidance factor and the direction coupling factor to calculate the transfer probability of the ant moving to the next node includes: The transition probability is calculated using the following formula: P ij =(τ ij α or ij β r j s ij ) / (∑ k∈K t ik α or ik β r k ), Among them, P ij represents the transition probability of an ant moving from node i to node j, τ ij represents the pheromone concentration on the edge between node i and node j, α represents the information heuristic factor, η ij represents the expected value of moving from node i to node j, β represents the expected value heuristic factor, and ρ j represents the distance guidance factor corresponding to node j, σ ij represents the directional coupling factor corresponding to moving from node i to node j, K represents the set of nodes k that the ant can move to next when it is at node i, and the set K does not include the nodes that the ant has moved to; η ij =1 / C ij , C ij =d ij / v ij , C ij represents the cost value of the edge between node i and node j, d ij represents the length of the edge between node i and node j, v ij It indicates that the movement speed of sample residents through the edge between node i and node j is positively correlated with the smoothness of the edge between node i and node j.

5. The method for selecting a school site based on a fast-converging ant colony algorithm according to claim 4 is characterized in that: The distance guidance factor is calculated using the following formula: When j≠t, use: ρ j =1 / L jt ; When j=t, use: ρ j =1, Among them, L jt represents the straight-line distance from node j to end point t; The directional coupling factor is calculated using the following formula: s ij =e^(x i,j x i,t / ||x i,j || 0.5 ||x i,t || 0.5 ), Where e represents the natural logarithm, x i,j represents the vector from node i to node j, x i,t Represents the vector pointing from node i to end point t.

6. The method for selecting a school site based on a fast-converging ant colony algorithm according to claim 4, characterized in that: The introduction of the probability function to calculate the pheromone concentration left by the selected ants on the edge of the undirected graph includes: The pheromone concentration is calculated using the following formula: t ij (s+1)=(1-r) τ ij (s+1)+△τ ij (s), Among them, τ ij (s+1) represents the pheromone concentration on the edge between node i and node j in the s+1th iteration, r represents the pheromone volatility coefficient, △τ ij (s) represents the pheromone concentration left on the edge between node i and node j by the ant selected in the sth iteration.

7. The method for selecting a school site based on a fast-converging ant colony algorithm according to claim 6, characterized in that: The pheromone concentration left by the selected ant m on the edge between node i and node j is calculated using the following formula: △τ ij m (s)=Q / C m (s), Among them, △τ ij m (s) represents the pheromone concentration left by ant m on the edge between node i and node j in the sth iteration, Q represents the total amount of pheromone, C m (s) represents the sum of the cost values ​​of the complete moving path of ant m on the undirected graph in the sth iteration, which is calculated using the following formula: C=d / v, Among them, C represents the cost value, d represents the length of the complete moving path of the ant on the undirected graph in one round of iteration, and v represents the moving speed of the sample residents.

8. The method for selecting a school site based on a fast-converging ant colony algorithm according to claim 7, characterized in that: The probability function adopts the following formula: When ant m reaches the end point and the moving path is the shortest, use: Z m (s)=1; When ant m reaches the end point and the moving path is not the shortest, use: Z m (s) = ελ s , Among them, Z m (s) represents the probability of ant m being selected in the sth iteration, ε represents the initial coefficient of the greed factor, and λ s Represents the greed factor attenuation coefficient.

9. The method for selecting a school site based on a fast-converging ant colony algorithm according to claim 1, characterized in that: The method of taking the location of the sample residents on the undirected graph as the starting point and the address of the candidate school as the end point also includes: The location of the sample residents on the undirected graph is taken as the starting point, the address of the alternative school is taken as the first end point, and the work place of the sample residents is taken as the second end point; the undirected graph includes the work places of the sample residents, the work places of the sample residents are consistent with the distribution of actual office buildings in the school service area, and the number of work places is consistent with the number of sample residents; The outputting of the path with the shortest distance between the starting point and the end point as the best path also includes: The path between the starting point and the first end point is taken as the first path segment, the path between the first end point and the second end point is taken as the second path segment, and the path with the shortest sum of the first path segment and the second path segment is taken as the optimal path; In the state transfer stage, the ants are set to move from the starting point to the first end point, and then move to the second end point after reaching the first end point.

10. A school site selection device based on a fast-convergence ant colony algorithm, characterized in that: include: Site selection unit, screening unit and ant colony algorithm unit, where: The site selection unit is used to perform preliminary site selection for the school, obtain multiple candidate school addresses, set a corresponding school service area for each candidate school address, and generate sample residents within the school service area; The screening unit is used to calculate the best path between each sample resident in the school service area and the corresponding candidate school address through a fast convergence ant colony algorithm, and select the actual school address from multiple candidate school addresses according to the best path distribution of each school service area; The ant colony algorithm unit is used to execute the fast convergence ant colony algorithm, including: The intersections within the school service area are taken as nodes, and the roads connecting the intersections are taken as edges to obtain an undirected graph; the locations of the sample residents on the undirected graph are taken as the starting point, and the addresses of the candidate schools are taken as the end point; After multiple rounds of iterations, when the stopping condition is met, the path with the shortest distance between the starting point and the end point is output as the best path; each round of iteration includes a state transfer phase and a pheromone update phase, in which: In the state transfer stage, the ants are set to move from the starting point to the end point; during the movement process, the distance guidance factor and the direction coupling factor are introduced to calculate the transfer probability of the ants moving to the next node; the distance guidance factor represents the straight-line distance between the node and the end point; the direction of the current node toward the next node is the first direction, and the direction of the current node toward the end point is the second direction, and the direction coupling factor represents the degree of deviation between the first direction and the second direction; In the pheromone update phase, a probability function is introduced to calculate the pheromone concentration left by the selected ants on the edges in the undirected graph. The higher the pheromone concentration of the edge, the higher the transfer probability of the ant moving through the corresponding edge to the next node. A greedy factor is introduced into the probability function, and the greedy factor represents the attenuation degree of the pheromone concentration as the number of iterations increases.

Citation Information

Patent Citations

  • Micro park site selection method based on optimized ant colony algorithm

    CN115965171A

  • Vehicle alarm control method and device based on hybrid ant colony algorithm

    CN117727197A