Single-passenger tour route planning method based on maximum and minimum ant system
Through the method based on the maximum and minimum ant system, modeling as constraint optimization problems and designing heuristic information and local search strategies is solved, and the problem of failure to effectively consider travel expenses and ticket expenses in the existing technology is achieved, achieving the best travel experience under cost constraints.
Patent Information
- Application Number
- CN202411888195.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing tourist route planning methods fail to effectively consider factors such as travel expenses between attractions, attractions ticket prices and user travel budgets, which leads to the inability to meet the actual needs of users.
Using a method based on the largest and smallest ant system, the tourism route planning problem is modeled as a constraint optimization problem through a new modeling method, taking into account travel expenses and ticket fees between attractions, and introducing user budgets as cost constraints. Heuristic information that integrates the experience value of the attraction, travel expenses and ticket fees, as well as a local search strategy that combines 2-opt and point insertion, is designed to optimize travel routes to maximize users' travel experience.
It realizes the maximization of user travel experience while meeting user travel cost constraints, and outputs the best travel route that meets user budget and maximizes user travel experience.
Smart Images

Figure CN119940669A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of travel route planning and computational intelligence technology, and in particular relates to a single-traveler travel route planning method based on a maximum-minimum ant system. Background Art
[0002] The tourist route planning problem is a combinatorial optimization problem with multiple constraints, which is essentially an NP-hard problem. In real life, tourist route planning problems usually involve multiple factors such as travel expenses between attractions, ticket prices for attractions, and the user's total travel budget. However, most of the existing tourist route planning methods do not consider this important information when modeling such problems, resulting in the inability of existing tourist route planning methods to meet the actual needs of users.
[0003] Ant Colony Optimization (ACO) has the advantages of strong parallelism, high adaptability, and strong robustness. However, ACO mostly focuses on solving logistics scheduling optimization and vehicle dispatch optimization problems, and relatively little research on travel route planning. Therefore, the existing ACO algorithm cannot directly solve the travel route planning problem modeled by the present invention. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a single-passenger travel route planning method based on the maximum-minimum ant system, including the following two invention contents:
[0005] 1. Problem modeling: Different from the existing travel route planning methods, the present invention proposes a new modeling method, which models the travel route planning problem as a constrained optimization problem. On the basis of considering the travel expenses between attractions and the ticket fees of attractions, the user's budget funds are introduced as cost constraints, minimizing the difference between the user's actual travel cost and the budget funds while maximizing the user's travel experience.
[0006] 2. Algorithm design: The present invention designs a single-passenger travel route planning method based on the maximum-minimum ant system, including the following innovative points:
[0007] 1) Designed heuristic information that integrates the tourist experience value of scenic spots, travel expenses between scenic spots, and ticket fees of scenic spots;
[0008] 2) A pheromone update method that integrates the total experience value of the travel route and the total experience value of all attractions is proposed;
[0009] 3) A new local search strategy integrating 2-opt and point insertion is designed to further maximize the user's travel experience while satisfying the user's travel cost constraints, and finally output an optimal travel route that meets the user's budget and maximizes the user's travel experience.
[0010] Technical solution: The single-passenger travel route planning method based on the maximum-minimum ant system of the present invention comprises the following steps:
[0011] S1, obtain tourist attraction information and user information, where the tourist attraction information includes the number of tourist attractions N, the location coordinates of the tourist attractions (x, y), the tourist attraction experience value score, the tourist attraction ticket and the travel cost between the tourist attractions; the user information includes the user's departure location C0 and the user's budget C max ;
[0012] S2, the travel route planning problem is modeled as a constrained optimization problem. On the basis of considering the travel expenses between attractions and the ticket fees of scenic spots, the user's budget is introduced as a cost constraint. While minimizing the user's actual travel cost and budget, the user's total travel experience value is maximized. The tourist attractions that meet the user's budget and have the highest total experience value of the path are visited in turn, and finally return to the original departure point.
[0013] S3, the total experience value of the tourist route constructed by the greedy algorithm is used to initialize the pheromone matrix and the parameters of the ant colony algorithm, where the parameters of the maximum and minimum ant system include: ant colony size NP, pheromone concentration weight α, heuristic information weight β, pheromone evaporation rate ρ, evolutionary stagnation judgment generation rs and maximum fitness value evaluation times Max_FV;
[0014] S4, for each ant, starting from the user's departure point, under the constraint of budget funds, according to the pheromone concentration and heuristic information between tourist attractions, the tourist attraction with the maximum total experience value of the user is selected to construct a tourist route;
[0015] S5, using the designed new local search method integrating 2-opt and point insertion to optimize the constructed travel route, so as to further maximize the user's travel experience under the premise of satisfying the user's travel cost constraint;
[0016] S6, repeating steps S4 to S5 until all ants have constructed travel routes that meet the budget constraints; evaluating the travel route plans constructed by all ants in the entire ant colony, and updating the global optimal travel route with the highest user total travel experience value;
[0017] S7, based on the designed new pheromone updating method that integrates the total experience value of the travel path and the total experience value of all attractions, updates the pheromone matrix in the maximum and minimum ant system and checks the pheromone size;
[0018] S8, if the iteration termination condition is not met, go to step S4; if the iteration termination condition is met, output the global optimal travel route planning scheme;
[0019] Further, in step S1, tourist attraction information and user information are obtained, wherein the tourist attraction information includes the number of tourist attractions N, the location coordinates of the tourist attractions (x, y), the tourist attraction experience value score, the tourist attraction ticket ticket and the travel cost between the tourist attractions; the user information includes the user's departure location C0 and the user's budget C max ; At the same time, construct the ant structure object ant{candidates, tour, tour_cost, tour_score}, which respectively stores the candidate tourist attraction numbers that meet the budget constraint, the constructed tourist routes, the cost of the currently constructed tourist route, and the total user travel experience value of the current route; construct the tourist attraction structure object spot{coordinates, ticket, score}, which respectively stores the coordinate information of the tourist attraction, the ticket price, and the travel experience value of the tourist attraction.
[0020] Furthermore, in step S2, the travel route planning problem is modeled as a constrained optimization problem. On the basis of considering the travel expenses between scenic spots and the ticket fees of scenic spots, the user's budget is introduced as a cost constraint, and the user's total travel experience value is maximized while minimizing the user's actual travel cost and budget. Specifically, the following steps are included:
[0021] S201, establish the constraint conditions of the travel route, the specific expression is as follows:
[0022]
[0023] Among them, cost(i, j) is the travel cost between attractions i and j, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in, spot[i].ticket is the ticket price of attraction i, C max The travel budget given by the user.
[0024] S202, establishing a total travel experience value function for the travel route, the specific expression is as follows:
[0025]
[0026] Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in , spot[i].score is the tourist experience value of attraction i.
[0027] S203, the constraints and the objective function are combined into a constrained optimization problem, and the optimization model is as follows:
[0028]
[0029] Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in, spot[i].score is the tourist experience value of attraction i, cost(i, j) is the travel cost between attraction i and attraction j, spot[i].ticket is the ticket price of attraction i, C max The user is given a travel budget; the user visits the tourist attractions that meet the budget and have the highest total experience value of the path in turn, and finally returns to the original departure point.
[0030] Furthermore, in step S3, the parameters of the ant colony algorithm are initialized, including the ant colony size NP, the pheromone concentration weight α, the heuristic information weight β, the pheromone evaporation rate ρ, the evolutionary stagnation determination generation rs, and the maximum fitness value evaluation times Max_FV; a complete travel route that meets the user's budget cost constraint is obtained through a greedy algorithm, and the total travel experience value of the user on the travel route is divided by the total experience value of all tourist attractions to initialize the pheromone matrix. The specific implementation steps are as follows:
[0031] S301, starting from the user's departure point, traverse the tourist attractions that have not been visited in sequence, and add the numbers of the attractions that meet the cost constraint into the candidate attraction set greedy_candidates to construct a set of tourist attractions that meet the cost constraint and have not been visited;
[0032] S302, if the number of tourist attractions in the candidate node set greedy_candidates is greater than 0, then go to step S303, otherwise, there are no tourist nodes that meet the budget constraint requirements, and the greedy path construction is completed;
[0033] S303, taking the tourist experience value of the scenic spot and the quotient of the travel expenses between the two scenic spots and the ticket fee of the next scenic spot as the evaluation criteria, greedily select the candidate tourist spot with the largest ratio as the next tourist spot to be visited, and the calculation formula of the greedy ratio is as follows:
[0034]
[0035] Among them, spot[j].score is the tourism experience value of attraction j, cost(i, j) is the travel cost between two tourist attractions i and j, and spot[j].ticket is the ticket fee of tourist attraction j. The greedy algorithm determines the next tourist attraction j to be visited by calculating the ratio between the current tourist attraction i and each candidate tourist attraction.
[0036] S304, add the next tourist attraction j selected by the ant to the greedy path greedytour and update the total cost and total experience value of the greedy path. The formula is as follows:
[0037] greedytour_cost←greedytour_cost+cost(i,j)+spot[j].ticket
[0038] greedytour_score←greedytour_score+spot[j].score
[0039] Where greedytour_cost is the total cost of the constructed greedy path, cost(i, j) is the travel cost between attractions i and j, spot[j].ticket is the ticket price of attraction j; greedytour_score is the total experience value of the constructed greedy path, spot[j].score is the travel experience value of attraction j;
[0040] S305, after the greedy path is constructed, the total experience value of the path is divided by the sum of the experience values of all tourist attractions to calculate the maximum pheromone value τ max , thereby initializing the pheromone matrix; the initial value of pheromone τ max and the minimum pheromone value τ min The specific calculation formula is as follows:
[0041]
[0042] Among them, greedytour_score is the total experience value of the constructed greedy path, Sumscore is the sum of the experience values of all tourist attractions, and N is the total number of tourist attractions.
[0043] Furthermore, in step S4, the ants select the tourist attraction that maximizes the total user experience value based on the pheromone concentration and heuristic information between the tourist attractions; the detailed steps of constructing the tourist route are as follows:
[0044] S401, ant k traverses the tourist attractions that have not been visited yet, and adds the attractions that meet the cost constraint into the candidate attraction set candidates[k] to construct a set of tourist attractions that meet the cost constraint and have not been visited yet;
[0045] S402, if the number of attractions in the candidate attraction set candidates[k] is greater than 0, then go to step S403, otherwise, there are no tourist attractions that meet the cost constraint, and the tourist route construction is completed;
[0046] S403, ant k determines the next tourist attraction j to be visited by the state transition equation at the current position; the state transition probability expression between the current attraction i and the candidate attraction j is as follows:
[0047]
[0048] Among them, p ij is the state transition probability from the current scenic spot i to the next scenic spot j, τ ij is the pheromone concentration between the current scenic spot i and the next scenic spot j, η ij is the heuristic information between the current tourist attraction i and the next tourist attraction j, α and β are the weights of controlling pheromone concentration and heuristic information respectively, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint;
[0049] Based on the actual situation, the present invention designs heuristic information that integrates the tourist experience value of scenic spots, the travel expenses between scenic spots and the ticket fees of scenic spots. The specific expression is as follows:
[0050]
[0051] Among them, spot[i].score and spot[j].score are the travel experience values of attractions i and j respectively, cost(i,j) is the travel cost between attractions i and j, and spot[i].ticket and spot[j].ticket are the ticket fees of attractions i and j respectively.
[0052] S404, selecting the next tourist attraction J to be visited in a roulette selection manner, the specific operation is to first calculate the cumulative probability according to the state transition probability, the calculation formula is as follows:
[0053]
[0054] Among them, p ij is the state transition probability from the current scenic spot i to the candidate scenic spot j, p select [j] represents the sum of the state transition probabilities from the first candidate attraction to the jth candidate attraction, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint.
[0055] Based on the above cumulative probability, select the next tourist attraction J to be visited in the following way and add this attraction to the tour route tourk middle:
[0056] J=j,if rand(0,1)≤P select [j]
[0057] S405, updating the cost of the constructed travel path, the formula is as follows:
[0058] tour k _cost←tour k _cost+cost(i,j)+spot[j].ticket
[0059] Among them, tour k _cost is the cost of the constructed travel route, cost(i, j) is the travel cost between tourist attraction i and tourist attraction j, and spot[j].ticket is the ticket fee for tourist attraction j;
[0060] Furthermore, in step S5, the constructed travel route is further optimized using the designed new local search method integrating 2-opt and point insertion. The specific steps are as follows:
[0061] S501, perform 2-opt operation; traverse all tourist attractions in the tourist route constructed by ant k, and find the two tourist attractions i and j that cause the largest change in the tourist cost reduction Δcost. The calculation formula for the tourist cost reduction Δcost is as follows:
[0062] Δcost(i,j)=[cost(i-1,j)+cost(i,j+1)]-[cost(i-1,i)+cost(j,j+1)]
[0063] Exchange the order of tourist attractions i and j on the tourist path, and at the same time, reverse the order of attractions between the two points in turn, as follows Figure 3 As shown; continue to execute until there are no exchangeable points in the path that can reduce the cost, the 2-opt operation is completed, and the cost of the constructed travel path is updated. The formula is as follows:
[0064] tour k _cost←tour k _cost-∑Δcost
[0065] S502, perform point insertion operation; after step S501, the user's travel cost may be reduced. At this time, under the condition of meeting the user's budget requirements, new tourist attractions can be inserted to improve the user's total travel experience value. The specific implementation is: traverse all the attractions in the candidate attractions set that meet the cost constraint, and find the candidate tourist attraction p with the largest travel experience value; traverse all the tourist attractions in the travel path constructed by ant k, and find the two tourist attractions m and n that make the travel cost increase Δcost change the least. The calculation formula of the travel cost increase Δcost is as follows:
[0066] Δcost(i,j)=spot[p].ticket+[cost(m,p)+cost(p,n)]-cost(m,n)
[0067] Insert the candidate attraction p with the largest tourism experience value between tourist attractions m and n as follows Figure 4 As shown; continue to perform this operation until no new tourist attractions can be inserted, the point insertion operation is completed, and the cost of the constructed tourist path is updated. The formula is as follows:
[0068] tour k _cost←tour k _cost+∑Δcost
[0069] Furthermore, in step S6, the travel route plans constructed by all ants in the entire ant colony are evaluated, and the global optimal travel route with the highest user travel experience value is updated. The specific implementation steps are as follows:
[0070] S601, calculating the total user travel experience value of the travel route planning scheme constructed by each ant through the objective function, and the expression of the objective function is as follows:
[0071]
[0072] Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in k [i]].score indicates tourist attractions tour k [i] experience value;
[0073] S602, mark the path with the maximum total travel experience value as the current optimal solution best, which is expressed as follows:
[0074] best=argmax{f(tour k )|1≤k≤NP}
[0075] When f(gbest) < f(best), replace the global optimal solution gbest with the scheduling plan of the current optimal solution best;
[0076] When f(gbest) ≥ f(best), the global optimal solution gbest remains unchanged.
[0077] Furthermore, in step S7, the pheromone matrix is updated by using the designed total experience value of the integrated tourism path and the total experience value of all scenic spots. The specific update formula is as follows:
[0078]
[0079] where τ ij is the pheromone on the edge (i, j), ρ is the pheromone evaporation rate, and V is the set of all scenic spots; is the pheromone released on the edge (i, j) of the global optimal path.
[0080] Update the maximum pheromone value τ max and the minimum pheromone value τ min , and the specific formula is as follows:
[0081]
[0082] where gbest_score is the total experience value of the global optimal path, Sumscore is the total experience value of all tourist scenic spots, and N is the total number of tourist scenic spots; check whether the pheromone is within the specified range of [τ min , τ max , and perform out-of-bounds processing on the pheromone concentration that does not meet the constraint conditions. The specific operation method is as follows:
[0083]
[0084] When the algorithm enters a stagnant state, that is, when the global optimal solution gbest remains unchanged for rs consecutive generations, use τ max to re-initialize the pheromone matrix, as follows:
[0085]
[0086] where gbest_score is the total experience value of the global optimal path, Sumscore is the sum of the experience values of all tourist scenic spots, N is the total number of tourist scenic spots, τ ij is the pheromone on the edge (i, j), and V is the set of all scenic spots.
[0087] The present invention also discloses a computer device, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.
[0088] The present invention also discloses a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method of the present invention are implemented.
[0089] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0090] 1. The present invention takes into account a variety of important information in actual application scenarios, such as ticket fees for scenic spots, travel expenses between scenic spots, and user economic budgets, and models the travel route planning problem as a constrained optimization problem; on the basis of considering the travel expenses between scenic spots and ticket fees for scenic spots at the same time, the user's budget funds are introduced as cost constraints, minimizing the difference between the user's actual travel cost and the budget funds while maximizing the user's travel experience. This new modeling method is more in line with the travel route planning problem in real life, more in line with actual application needs, and has higher modeling accuracy.
[0091] 2. The present invention proposes an effective algorithm to effectively solve the modeled travel route planning problem, and designs a new heuristic information and pheromone update method; at the same time, it designs a new local search strategy to further maximize the user's travel experience while satisfying the user's travel cost constraints, thereby greatly improving the user's travel experience and satisfaction.
[0092] 3. The present invention designs a single-travel route planning method based on the maximum-minimum ant system, proposes heuristic information that integrates the tourist experience value of scenic spots, travel expenses between scenic spots and ticket fees of scenic spots, designs a pheromone update method that integrates the total experience value of the tourist path and the total experience value of all scenic spots, and proposes a new local search strategy that integrates 2-opt and point insertion to further maximize the user's travel experience under the premise of satisfying the user's travel cost constraints, and finally outputs an optimal travel route that meets the user's budget and maximizes the user's travel experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 This is the main process of the single-passenger travel route planning method based on the maximum-minimum ant system of the present invention;
[0094] Figure 2 A schematic diagram of modeling the travel route planning problem of the present invention;
[0095] Figure 3 This is a schematic diagram of 2-opt operation;
[0096] Figure 4 This is a schematic diagram of point insertion operation;
[0097] Figure 5 Schematic diagram of the global optimal single-passenger travel path obtained by optimizing the maximum-minimum ant system.
[0098] in, Figure 5 The first number in the title represents the travel budget given by the user, the second number represents the total experience value of the constructed travel route, and the third number represents the difference between the total cost of the constructed travel route and the user's budget; the black five-pointed star in the figure represents the user's departure place, and the black dots represent tourist attractions. The size of the circle is proportional to the experience value of the tourist attraction. The larger the dot, the higher the experience value of the tourist attraction. The first dimension of the tuple above the dot represents the experience value of the tourist attraction, and the second dimension represents the ticket price of the attraction. The arrow represents the order in which tourists visit the tourist attractions. DETAILED DESCRIPTION
[0099] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation examples. This implementation example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following implementation examples.
[0100] The single-passenger travel route planning method based on the maximum-minimum ant system in this implementation example is as follows: Figure 1 As shown, the following steps are included:
[0101] Step 1: Get tourist attraction information and user information. The tourist attraction information includes the number of tourist attractions N, the location coordinates of tourist attractions (x, y), the tourist attraction experience score, the tourist attraction ticket, and the travel cost (i, j) between tourist attractions. The user information includes the user's departure location C0 and the user's budget C max At the same time, the ant structure object ant{candidates, tour, tour_cost, tour_score} is constructed to store the candidate tourist attraction numbers that meet the budget constraint, the constructed tourist routes, the cost of the currently constructed tourist route, and the total user travel experience value of the current route; the tourist attraction structure object spot{coordinates, ticket, score} is constructed to store the coordinate information of the tourist attraction, the ticket price, and the experience value of the tourist attraction. In this embodiment, the number of tourist attractions N = 100, the coordinates of the user's departure point are C0 = (0, 0), and the user's budget C max = 5000 yuan, the travel expenses between tourist attractions are defined as the Euclidean distance between tourist attractions multiplied by the cost per unit distance, and the specific calculation is shown in formula (1):
[0102]
[0103] In this embodiment, the unit distance cost Q is set to 0.1; the specific data of the tourist attractions are shown in Table 1.
[0104] Table 1 Location coordinates, ticket prices and travel experience values of all attractions
[0105]
[0106]
[0107] Step 2: Model the travel route planning problem as a constrained optimization problem. On the basis of considering the travel expenses between attractions and the ticket fees for attractions, the user's budget is introduced as a cost constraint. The user's total travel experience value is maximized while minimizing the gap between the user's actual travel cost and the budget. The specific optimization model is as follows:
[0108]
[0109] Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in, spot[i].score is the tourist experience value of attraction i, cost(i, j) is the travel cost between attraction i and attraction j, spot[i].ticket is the ticket price of attraction i, C max The user is given a travel budget; the user visits the tourist attractions that meet the budget and have the highest total experience value of the path in turn, and finally returns to the original departure point.
[0110] Step 3, the initialized ant colony algorithm parameters are shown in Table 2, including ant colony size NP, pheromone concentration weight α, heuristic information weight β, pheromone evaporation rate ρ, evolutionary stagnation judgment generation rs and maximum fitness value evaluation times Max_FV;
[0111] Table 2 Maximum and minimum ant system parameter settings
[0112] Ant population size NP 20 Pheromone weight α 2.5 Heuristic information weight β 7.5 Pheromone evaporation rate ρ 0.2 Evolutionary stagnation determination algebra rs 20 Iteration number Max_FV 10000
[0113] Construct a greedy path; take the quotient of the travel experience value and the travel cost between two attractions as the evaluation criterion, greedily select the tourist attraction with the largest ratio as the next visit node, and successively obtain a complete travel route that meets the user's budget cost constraint. Calculate the maximum pheromone value τ by dividing the total travel experience value of the user on the travel path by the sum of the experience values of all tourist attractions max To initialize the pheromone matrix PheromoneMatrix, the greedy ratio calculation method is shown in formula (3), the initial value of pheromone τ maxand the minimum pheromone value τ min The calculation method is shown in formula (4).
[0114]
[0115]
[0116] First, a greedy algorithm is used to solve a path greedy_tour that meets the user cost constraint: [0, 26, 65, 4, 16, 38, 99, 21, 11, 59, 72, 79, 18, 84, 49, 28, 67, 93, 77, 60, 35, 55, 43, 3, 71, 96, 50, 44, 64, 40, 69, 87, 57, 23, 91, 45, 32, 74, 1, 8, 89, 42, 6, 10, 0], and then the experience value of the greedy path is calculated as tour_score = 339, and the total experience value of all tourist attractions is Sumscore = 559, and the initial value of pheromone τ is obtained. max =339 / 559*0.01=0.0060644,τ min =τ max / N=0.0060644 / 100=0.000060644.
[0117] Step 4: For each ant, starting from the user's departure point, under the constraint of budget funds, the ant selects the tourist attraction that maximizes the user's total experience value based on the pheromone concentration and heuristic information between the tourist attractions. The detailed steps of constructing the tourist route are as follows:
[0118] Step 401, ant k traverses the tourist attractions that have not been visited yet, and adds the points that meet the cost constraint into the candidate node set candidates[k] to construct a set of tourist attractions that meet the cost constraint and have not been visited yet. At this time, all ants have just set out from the starting point, so all tourist attractions meet the cost constraint, that is, the candidate sets of all ants contain the numbers of all tourist attractions.
[0119] Step 402, if the number of attractions in the candidate attraction set candidates[k] is greater than 0, then proceed to step 403, otherwise, there are no tourist attractions that meet the cost constraint, and the tourist route construction is completed; from step 401, it can be seen that the number of tourist attractions in all current ant candidate node sets is greater than 0, so the process proceeds to step 403.
[0120] Step 403, ant k determines the next tourist attraction j to be visited by the state transition equation at the current position. The state transition probability expression between the current attraction i and attraction j is as follows:
[0121]
[0122] Among them, p ij is the state transition probability from the current scenic spot i to the next scenic spot j, τ ij is the pheromone concentration between the current scenic spot i and the next scenic spot j, η ij is the heuristic information between the current tourist attraction i and the next tourist attraction j, α and β are the weights of controlling pheromone concentration and heuristic information respectively, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint;
[0123] Based on the actual situation, the present invention designs heuristic information that integrates the tourist experience value of scenic spots, the travel expenses between scenic spots and the ticket fees of scenic spots. The specific expression is as follows:
[0124]
[0125] Among them, spot[i].score and spot[j].score are the travel experience values of attractions i and j respectively, cost(i,j) is the travel cost between attractions i and j, and spot[i].ticket and spot[j].ticket are the ticket fees of attractions i and j respectively.
[0126] Step 404, select the next tourist attraction J to be visited in a roulette selection manner. The specific operation is to first calculate the cumulative probability according to the state transition probability, as shown in formula (7):
[0127]
[0128] Among them, p ij is the state transition probability from the current scenic spot i to the candidate scenic spot j, p select [j] represents the sum of the state transition probabilities from the first candidate attraction to the jth candidate attraction, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint.
[0129] Then, the next tourist attraction J to be visited is selected by roulette selection, and this attraction is added to the tour route tour k The specific implementation method is shown in formula (8);
[0130] J=j, if rand(0,1)≤p select [j] (8)
[0131] In this embodiment, the user is currently at the departure point (number i=0), and the state transition equation is substituted to calculate the probability of each candidate node p=[(1, 0.00462946), (2, 4.47372e-05), (3, 0.000459002), (4, 0.094608), (5, 0.000149775), (6, 0.00511761), (7, 8.75119e-05), (8, 0.00549017), (9, 2.3003e-06), (10, 0.00150484), (11, 0.00989892), (12, 7.44932e-05), (13, 0.0004375 56), (14, 1.2975e-06), (15, 0.000554904), (16, 0.0681585), (17, 0.0002 85573), (18, 0.0111619), (19, 0.000549017), (20, 0.000570608), (21, 0. 0117562), (22, 0.00122082), (23, 0.00276253), (24, 6.66215e-05), (25, 0.000791355), (26, 0.404525), (27, 0.000314582), (28, 0.0109643), (29 , 3.68411e-05), (30, 0.000532491), (31, 1.91284e-05), (32, 0.00085496 2), (33, 0.001421), (34, 4.56299e-05), (35, 0.00125866), (36, 9.40395e -06), (37, 0.000347955), (38, 0.0307157), (39, 0.000146715), (40, 0.00 238731), (41, 9.12073e-06), (42, 0.00281269), (43, 0.00240943), (44, 0 .000356251), (45, 0.00202958), (46, 1.05949e-05), (47, 0.00191457), ( 48, 1.54314e-06), (49, 0.00545007), (50, 0.00338146), (51, 9.82877e-0 5), (52, 0.000478428), (53, 6.89202e-05), (54, 0.000548784), (55, 0.00 225016), (56, 0.00156687), (57, 0.00176878), (58, 3.53625e-05), (59, 0.00319914), (60, 0.00300175), (61, 0.000335128), (62, 0.00113901), (63, 9.4496e-05), (64, 0.0016 8965), (65, 0.180365), (66, 0.00430904), (67, 0.0096811), (68, 8.13521e-05), (69, 0.00148176), ( 70, 2.49567e-05), (71, 0.000238045), (72, 0.00722169), (73, 7.99627e-05), (74, 0.0027138), (75, 1.49249e-05), (76, 0.000325277), (77, 0.00374717), (78, 7.69077e-05), (79, 0.023377), (80, 0.00 0230388), (81, 0.000539771), (82, 0.00182675), (83, 0.000113344), (84, 0.00699563), (85, 1.7593 2e-05), (86, 0.000494485), (87, 0.00243481), (88, 0.00339028), (89, 0.00969303), (90, 0.0003460 53), (91, 0.00265286), (92, 1.42217e-05), (93, 0.00144377), (94, 0.00909765), (95, 4.29944e-05) , (96, 0.000915946), (97, 0.000961337), (98, 0.000983039), (99, 0.0153534), (100, 0.000101542)]. .
[0132] Each element of the array is a tuple, the first value represents the number of the tourist attraction, the second value represents the probability of the tourist attraction being selected, and then the roulette strategy is used to select the attraction according to the random proportion rule to obtain j = 26; therefore, the next desired tourist destination of ant k is attraction 26. Add the next tourist attraction J selected by ant k to the tour route tour k In the example, the current tour route constructed by ant k is tour k =[0, 26].
[0133] Step 405, updating the cost of the constructed travel route, the formula is as follows:
[0134] tour k _cost←tour k_cost+cost(i,j)+spot[j].ticket(9)
[0135] Among them, tour k _cost is the cost of the constructed travel route, cost(i, j) is the travel cost between tourist attraction i and tourist attraction j, and spot[j].ticket is the ticket fee for tourist attraction j;
[0136] In this embodiment, the distance between the starting point 0 and the scenic spot 26 is calculated to be 179.61. The ticket price of the scenic spot 26 is 60 according to Table 1. Therefore, the path cost tour_cost is updated. k =179.61*0.1+60=77.96.
[0137] This process continues until there are no unvisited tourist attractions that meet the cost constraint, and the path construction is completed.
[0138] In this embodiment, the travel path constructed by ant k is [0, 26, 65, 56, 16, 99, 38, 79, 18, 77, 23, 11, 21, 59, 84, 72, 91, 28, 67, 93, 94, 4, 49, 8, 6, 80, 55, 43, 3, 60, 57, 20, 27, 87, 35, 97, 0], and the path cost is 4878.58.
[0139] Step 5, the specific steps of using the designed new local search method integrating 2-opt and point insertion to further optimize the constructed tourist route are as follows:
[0140] Step 501, perform 2-opt operation, traverse all tourist attractions in the tourist route constructed by ant k, and find the two tourist attractions i and j that make the travel cost reduction Δcost change the most. The travel cost reduction Δcost calculation formula is as follows:
[0141] Δcost(i,j)=[cost(i-1,j)+cost(i,j+1)]-[cost(i-1,i)+cost(j,j+1)] (10)
[0142] Exchange the order of tourist attractions i and j on the tourist path, and at the same time, reverse the order of attractions between the two points in turn, as follows Figure 3 As shown; continue to execute until there are no exchangeable points in the path that can reduce the cost, the 2-opt operation is completed, and the cost of the constructed travel path is updated. The formula is as follows:
[0143] tour k _cost←tour k _cost-∑Δcost(11)
[0144] In this implementation example, after executing the 2-opt operation, the path constructed by ant k is updated to [0, 26, 65, 4, 97, 56, 80, 8, 49, 6, 67, 28, 93, 77, 20, 57, 87, 55, 3, 43, 27, 35, 60, 23, 91, 11, 59, 21, 72, 84, 99, 38, 18, 79, 94, 16, 0] and the path cost is updated to 3582.63.
[0145] Step 502, perform point insertion operation. After step 501, the user's travel cost may be reduced. At this time, under the condition of meeting the user's budget requirements, new tourist attractions can be inserted to improve the user's total travel experience value. The specific implementation is: traverse all the attractions in the candidate attractions set that meet the cost constraint, and find the candidate tourist attraction t with the largest travel experience value; traverse all the tourist attractions in the travel path constructed by ant k, and find the two tourist attractions m and n that make the travel cost increase Δcost change the least. The calculation formula of the travel cost increase Δcost is as follows:
[0146] Δcost(i,j)=spot[t].ticket+[cost(m,t)+cost(t,n)]-cost(m,n) (12)
[0147] Insert the candidate attraction t with the largest tourism experience value between tourist attractions m and tourist attractions n as follows Figure 4 As shown; continue to implement this operation until no new tourist attractions can be inserted, the point insertion operation is completed, and the cost of the constructed tourist path is updated. The formula is as follows:
[0148] tour k _cost←tour k _cost+∑Δcost(13)
[0149] In this implementation example, after the point insertion operation is performed, the path constructed by ant k is updated to [0, 26, 65, 4, 97, 56, 80, 8, 49, 6, 67, 28, 93, 77, 20, 57, 87, 82, 55, 3, 43, 27, 35, 60, 23, 91, 11, 59, 21, 72, 84, 99, 38, 18, 79, 94, 16, 0] and the path cost is updated to 3959.94.
[0150] In step 6, steps S4 to S5 are repeated until all ants have constructed travel routes that meet the budget constraints; the travel route plans constructed by all ants in the entire ant colony are evaluated, and the global optimal travel route with the highest user total travel experience value is updated. The specific steps are as follows:
[0151] Step 601: Calculate the total user travel experience value of the travel route planning scheme constructed by each ant through the objective function. The expression of the objective function is as follows:
[0152]
[0153] where, tour k represents the travel route constructed by ant k, and N k represents the total number of tourist attractions in the travel route tour k . spot[tour k [i]].score represents the experience value of tourist attraction tour k [i];
[0154] In this embodiment, the ant population NP = 20. Therefore, there are currently 20 path construction schemes. Evaluate these 20 travel routes in turn according to the objective function to obtain the total experience value of each travel route, as shown in Table 3:
[0155] Table 3 Total travel experience values of NP = 20 travel routes
[0156] 282 307 280 303 300 318 303 296 341 308 285 329 317 300 313 299 290 315 323 303
[0157] Step 602: Mark the path with the maximum current total travel experience value as the current optimal solution best. The expression is as follows:
[0158] best = argmax{f(tour k )|1 ≤ k ≤ NP} (15)
[0159] When f(gbest) < f(best), replace the global optimal solution gbest with the scheduling scheme of the current optimal solution best;
[0160] When f(gbest) ≥ f(best), the global optimal solution gbest remains unchanged.
[0161] As shown in Table 3, according to formula (15), the tourist route with the largest total tourist experience value of the current path is constructed by ant 9, so the tourist route of ant 9 is marked as best; compared with the global optimal scheduling plan, since the current population is in the first iteration, there is no global optimal scheduling plan, so the current best is directly marked as the global optimal scheduling plan. The current gbest = [0, 26, 65, 4, 16, 79, 18, 38, 99, 84, 49, 6, 72, 21, 74, 59, 11, 32, 45, 91, 23, 60, 77, 57, 27, 55, 43, 3, 71, 100, 96, 5, 33, 76, 82, 50, 44, 2, 64, 67, 28, 93, 1, 8, 42, 89, 0], and the path cost is 4523.63.
[0162] Step 7: Based on the designed new pheromone update method that integrates the total experience value of the travel route and the total experience value of all attractions, update the pheromone matrix in the maximum and minimum ant system and check the pheromone size. The global pheromone update includes pheromone evaporation and release, and the update formula is as follows:
[0163]
[0164] Among them, τ ij is the pheromone on edge (i, j), ρ is the pheromone evaporation rate, and V is the set of all scenic spots; is the pheromone released on the edge (i, j) of the global optimal path.
[0165] After each round of iterative update, the maximum pheromone value τ is updated max and the minimum pheromone value τ min , the specific formula is as follows:
[0166]
[0167] Wherein, gbest_score is the total experience value of the global optimal path, Sumscore is the sum of the experience values of all tourist attractions, and N is the total number of tourist attractions. In this embodiment, update τ max =341 / 559*0.01=0.00610018,τ min =τ max / N=0.00610018 / 100=0.0000610018.
[0168] Check whether the pheromone is within the specified [τ min , τ max ], the pheromone concentration that does not meet the constraint conditions will be handled as out of bounds. The specific operation is as follows:
[0169]
[0170] Currently, the pheromones are all within the specified range of [τ min , τ max , so there is no need to perform out-of-bounds processing on the pheromone concentration.
[0171] When the algorithm enters a stagnant state, that is, when the global optimal solution gbest remains unchanged for rs consecutive generations, use τ max to re-initialize the pheromone matrix as follows:
[0172]
[0173] Among them, gbest_score is the total experience value of the global optimal path, Sumscore is the sum of the experience values of all tourist attractions, N is the total number of tourist attractions, τ ij is the pheromone on the edge (i, j), and V is the set of all scenic spots.
[0174] The current algorithm is in the first round of iteration. At this time, the number of times gbest remains continuously unupdated is iterations = 0 < rs, and it has not entered a stagnant state. Therefore, there is no need to re-initialize the pheromone matrix.
[0175] Step 8, if the iteration termination condition is not met, go to Step 4; if the iteration termination condition is met, output the global optimal tourist route planning scheme;
[0176] The iteration termination condition means that when the fitness value evaluation times of the algorithm reach Max_FV, stop the optimization and output the global optimal tourist route planning scheme gbest.
[0177] In this embodiment, the maximum fitness value evaluation times Max_FV = 10000. When the fitness value evaluation times are less than 10000, the algorithm enters the next round of iteration, and continues to let 20 ants construct a new tourist route; when the fitness value evaluation times reach 10000 times, the algorithm ends the optimization and outputs the global optimal scheduling scheme gbest = [0, 26, 65, 4, 97, 56, 89, 8, 49, 6, 1, 93, 28, 67, 69, 64, 40, 44, 50, 82, 76, 33, 37, 5, 96, 52, 71, 3, 43, 55, 87, 57, 35, 60, 77, 23, 91, 45, 32, 11, 59, 74, 21, 72, 84, 99, 38, 18, 79, 88, 16, 0], the path cost is 4991.48, which is less than the user's budget cost, meets the constraints, and the total path score is 379. As Figure 5 shown, in this route planning scheme, the user visits tourist attractions that meet the budget cost constraints and have the highest total path experience value in sequence, and finally returns to the starting point.
Claims
1. A single-passenger travel route planning method based on the maximum-minimum ant system, characterized in that: The steps include: S1, obtaining tourist attraction information and user information, wherein the tourist attraction information includes the number of tourist attractions, location coordinates of tourist attractions, tourist attraction experience values, tourist attraction tickets and travel expenses between tourist attractions; the user information includes the user's departure location and the user's budget; S2, the travel route planning problem is modeled as a constrained optimization problem. On the basis of considering the travel expenses between scenic spots and the ticket fees of scenic spots, the user's budget is introduced as a cost constraint. While minimizing the user's actual travel cost and budget, the user's total travel experience value is maximized. The tourist attractions that meet the user's budget and have the highest total experience value are visited in sequence, and finally return to the original departure point; S3, using the greedy algorithm to construct the travel route, and using the total experience value of the travel route to initialize the pheromone matrix; then, initializing the parameters of the ant colony algorithm, where the parameters of the maximum and minimum ant system include: ant colony size, pheromone concentration weight, heuristic information weight, pheromone evaporation rate, evolutionary stagnation judgment generation, and maximum fitness value evaluation times; S4, for each ant in the maximum-minimum ant system, starting from the user's departure point, under the constraint of budget funds, according to the pheromone concentration and heuristic information between tourist attractions, the tourist attraction with the maximum total experience value of the user is selected to construct a tourist route; S5, uses the designed new local search method integrating 2-opt and point insertion to optimize the constructed travel route, maximizing the user's travel experience value under the premise of satisfying the user's travel cost constraint; S6, repeating steps S4 to S5 until all ants have constructed travel routes that meet the budget constraints; evaluating the travel route plans constructed by all ants in the entire ant colony, and updating the global optimal travel route with the highest user total travel experience value; S7, based on the designed new pheromone updating method that integrates the total experience value of the travel path and the total experience value of all attractions, updates the pheromone matrix in the maximum and minimum ant system and checks the pheromone size; S8, judging whether the iteration termination condition is met, if not, go to step S4; if the iteration termination condition is met, output the global optimal travel route planning scheme.
2. A single-passenger travel route planning method based on the maximum-minimum ant system according to claim 1, characterized in that: Step S1 is specifically as follows: obtaining tourist attraction information and user information, wherein the tourist attraction information includes the number of tourist attractions, the location coordinates of tourist attractions, the experience value of tourist attractions, the tickets for tourist attractions and the travel expenses between tourist attractions; the user information includes the user's departure location and the user's budget; at the same time, constructing an ant structure object ant{candidates, tour, tour_cost, tour_score}, the variables in which respectively store the candidate tourist attraction numbers that meet the budget constraint, the constructed tourist routes, the cost of the currently constructed tourist route and the total user travel experience value of the current route; constructing a tourist attraction structure object spot{coordinates, ticket, score}, the variables in which respectively store the coordinate information of the tourist attractions, the ticket price and the travel experience value.
3. According to claim 1, the single-passenger travel route planning method based on the maximum-minimum ant system is characterized in that: In step S2, the travel route planning problem is modeled as a constrained optimization problem. On the basis of considering the travel expenses between scenic spots and the ticket fees of scenic spots, the user's budget is introduced as a cost constraint to minimize the user's actual travel cost and budget while maximizing the user's total travel experience value. Specifically, the following steps are included: S201, establish the constraint conditions of the travel route, the specific expression is as follows: Among them, cost(i, j) is the travel cost between attractions i and j, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in, spot[i].ticket is the ticket price of attraction i, C max The travel budget given by the user; S202, establishing a travel experience value function of a travel route, the specific expression is as follows: Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in , spot[i].score is the tourist experience value of attraction i; S203, the constraints and the objective function are combined into a constrained optimization problem, and the optimization model is as follows: Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in, spot[i].score is the tourist experience value of attraction i, cost(i, j) is the travel cost between attraction i and attraction j, spot[i].ticket is the ticket price of attraction i, C max The user is given a travel budget; the user visits the tourist attractions that meet the budget and have the highest total experience value of the path in turn, and finally returns to the original departure point.
4. A single-travel travel route planning method based on the maximum-minimum ant system according to claim 1, characterized in that: Step S3 is specifically as follows: initializing the parameters of the ant colony algorithm, including the size of the ant colony, the weight of the pheromone concentration, the weight of the heuristic information, the pheromone evaporation rate, the number of generations for determining evolutionary stagnation, and the number of maximum fitness evaluations; obtaining a complete travel route that meets the user's budget cost constraints through a greedy algorithm, and initializing the pheromone matrix by dividing the total travel experience value of the user on the travel route by the total experience value of all tourist attractions. The specific implementation steps are as follows: S301, starting from the user's departure point, traverse the tourist attractions that have not been visited in sequence, and add the numbers of the attractions that meet the cost constraint into the candidate attraction set greedy_candidates to construct a set of tourist attractions that meet the cost constraint and have not been visited; S302, if the number of tourist attractions in the candidate node set greedy_candidates is greater than 0, then go to step S303, otherwise, there are no tourist nodes that meet the budget constraint requirements, and the greedy path construction is completed; S303, taking the tourist experience value of the scenic spot and the quotient of the travel expenses between the two scenic spots and the ticket fee of the next scenic spot as the evaluation criteria, greedily select the candidate tourist spot with the largest ratio as the next tourist spot to be visited, and the calculation formula of the greedy ratio is as follows: Among them, spot[j].score is the tourism experience value of attraction j, cost(i, j) is the travel cost between two tourist attractions i and j, and spot[j].ticket is the ticket price of tourist attraction j; the greedy algorithm determines the next tourist attraction j to be visited by calculating the ratio between the current tourist attraction i and each candidate tourist attraction; S304, adding the selected next tourist attraction j to the greedy path greedytour and updating the total cost and total experience value of the greedy path, the formula is as follows: greedytour_cost←greedytour_cost+cost(i,j)+spot[j].ticket greedytour_score←greedytour_score+spot[j].score Where greedytour_cost is the total cost of the constructed greedy path, cost(i, j) is the travel cost between attractions i and j, spot[j].ticket is the ticket price of attraction j; greedytour_score is the total experience value of the constructed greedy path, spot[j].score is the travel experience value of attraction j; S305: After the greedy path is constructed, the total experience value of the path is divided by the total experience value of all tourist attractions to calculate the maximum pheromone value τ. max To initialize the pheromone matrix, the initial value of pheromone τ max and the minimum pheromone value τ min The specific calculation formula is as follows: Among them, greedytour_score is the total experience value of the constructed greedy path, Sumscore is the total experience value of all tourist attractions, and N is the total number of tourist attractions.
5. A single-passenger travel route planning method based on the maximum-minimum ant system according to claim 1, characterized in that: Step S4 is as follows: the ants select the tourist attraction that maximizes the total user experience value based on the pheromone concentration and heuristic information between the tourist attractions. The detailed steps of constructing the tourist route are as follows: S401, ant k traverses the tourist attractions that have not been visited yet, and adds the attractions that meet the cost constraint into the candidate attraction set candidates[k] to construct a set of tourist attractions that meet the cost constraint and have not been visited yet; S402, if the number of attractions in the candidate attraction set candidates[k] is greater than 0, then go to step S403, otherwise, there are no tourist attractions that meet the cost constraint, and the tourist route construction is completed; S403, ant k determines the next tourist attraction j to be visited by the state transition equation at the current position. The state transition probability expression between the current attraction i and the candidate attraction j is as follows: Among them, p ij is the state transition probability from the current scenic spot i to the next scenic spot j, τ ij is the pheromone concentration between the current scenic spot i and the next scenic spot j, η ij is the heuristic information between the current tourist attraction i and the next tourist attraction j, α and β are the weights of controlling pheromone concentration and heuristic information respectively, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint; The specific expression of the designed heuristic information integrating the tourist experience value of scenic spots, the travel expenses between scenic spots and the ticket fees of scenic spots is as follows: Among them, spot[i].score and spot[j].score are the travel experience values of attractions i and j respectively, cost(i,j) is the travel cost between attractions i and j, spot[i].ticket and spot[j].ticket are the ticket prices of attractions i and j respectively; S404, selecting the next tourist attraction J to be visited in a roulette selection manner, the specific operation is to first calculate the cumulative probability according to the state transition probability, the calculation formula is as follows: Among them, p ij is the state transition probability from the current scenic spot i to the candidate scenic spot j, p select [j] represents the sum of the state transition probabilities from the first candidate attraction to the jth candidate attraction, and l is the total number of candidate tourist attractions in the candidate attraction set that meets the cost constraint; Based on the above cumulative probability, select the next tourist attraction J to be visited in the following way and add this attraction to the tour route tour k middle: J=j,if rand(0,1)≤p select [j] S405, updating the cost of the constructed travel path, the formula is as follows: tour k _cost←tour k _cost+cost(i,j)+spot[j].ticket Among them, tour k _cost is the cost of the constructed travel route, cost(i, j) is the travel cost between tourist attraction i and tourist attraction j, and spot[j].ticket is the ticket fee for tourist attraction j.
6. A single-passenger travel route planning method based on the maximum-minimum ant system according to claim 1, characterized in that: Step S5 is specifically as follows: The specific steps of further optimizing the constructed tourist route using the designed new local search method integrating 2-opt and point insertion are as follows: S501, perform 2-opt operation, traverse all tourist attractions in the tourist route constructed by ant k, and find the two tourist attractions i and j that make the travel cost reduction Δcost change the most. The calculation formula of the travel cost reduction Δcost is as follows: Δcost(i,j)=[cost(i-1,j)+cost(i,j+1)]-[cost(i-1,i)+cost(j,j+1)] Exchange the order of tourist attractions i and j on the tourist path. At the same time, flip the sequence of attractions between the two points in turn. Continue until there are no exchangeable points in the path that can reduce the cost. The 2-opt operation is completed and the cost of the constructed tourist path is updated. The formula is as follows: tour k _cost←tour k _cost-∑Δcost S502, perform the point insertion operation; after step S501, the user's travel cost may be reduced. At this time, under the condition of meeting the user's budget, new tourist attractions can be inserted to improve the overall user travel experience value. The specific implementation is as follows: traverse all the attractions in the candidate attraction set that meet the cost constraint, and find the candidate tourist attraction p with the largest travel experience value among them; traverse all the tourist attractions in the travel path already constructed by ant k, and find the two tourist attractions m and n that minimize the change in travel cost increment Δcost. The formula for calculating the travel cost increment Δcost is as follows: Δcost(i,j) = spot[p].ticket + [cost(m,p) + cost(p,n)] - cost(m,n) Insert the candidate attraction p with the largest travel experience value between tourist attraction m and tourist attraction n; continue to perform this operation until no new tourist attractions can be inserted, and the point insertion operation ends; update the cost of the constructed travel path, and the formula is as follows: tour k _cost←tour k _cost+∑Δcost 7. A single-passenger travel route planning method based on the maximum-minimum ant system according to claim 1, characterized in that: Step S6 is specifically as follows: The implementation steps for evaluating the travel route plans constructed by all ants in the entire ant colony and updating the global optimal travel route with the highest overall user travel experience value are as follows: S601, calculate the overall user travel experience value of the travel route planning plan constructed by each ant through the objective function. The expression of the objective function is as follows: Among them, tour k represents the travel route constructed by ant k, N k Indicates the tour route tour k The total number of tourist attractions in k [i]].score indicates tourist attractions tour k [i] experience value; S602, mark the path with the largest current overall travel experience value as the current optimal solution best, and the expression is as follows: best=argmax{f(tour k )|1≤k≤NP} When f(gbest) < f(best), replace the global optimal solution gbest with the scheduling plan of the current optimal solution best; When f(gbest) ≥ f(best), the global optimal solution gbest remains unchanged.
8. The method for planning a single traveler's travel route based on the maximum-minimum ant system according to claim 1, characterized in that: Step S7 is specifically as follows: The designed pheromone update formula that combines the overall travel experience value of the travel path and the overall experience value of all attractions is as follows: Among them, τ ij is the pheromone on the edge (i, j) connecting scenic spots i and j, ρ is the pheromone evaporation rate, and V is the set of scenic spots; is the pheromone released on the edge (i, j) of the global optimal path; Update the maximum pheromone value τ max and the minimum pheromone value τ min , the specific formula is as follows: Among them, gbest_score is the total experience value of the global optimal path, Sumscore is the sum of the experience values of all tourist attractions, and N is the total number of tourist attractions; check whether the pheromone is within the specified [τ min , τ max ] range, the pheromone concentration that does not meet the constraint conditions will be handled as out-of-bounds. The specific operation method is as follows: When the algorithm enters a stagnant state, that is, the global optimal solution gbest remains unchanged for consecutive RS generations, τ is used max Reinitialize the pheromone matrix as follows: Among them, gbest_score is the total experience value of the global optimal path, Sumscore is the total experience value of all tourist attractions, N is the total number of tourist attractions, τ ij is the pheromone on edge (i, j), and V is the set of all tourist attractions.
9. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method described in claim 1.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by the processor, the steps of the method described in claim 1 are implemented.
Citation Information
Patent Citations
Ant colony algorithm-based intelligent travel itinerary planning method
CN107832894A
Optimal utility customized tourist attraction route planning system
CN113935547A
Take-out delivery path planning method and system and storage medium
CN114217607A
Method and system for providing a travel course
KR102698566B1
Towards Efficient Large-Scale Network Monitoring and Diagnosis Under Operational Constraints
US20100034098A1
Cited By
Multi-warehouse multi-logistics vehicle path planning method based on adaptive neighborhood ant colony system
CN121032380A