# Personalized Original Ecotourism Route Recommendation Based on Ant Colony Algorithm

Authors: Jinfang Wang; Xianglin Wu
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

With the improvement of people’s consumption level and the increasing development of tourism, tourism is becoming more and more popular with everyone, and everyone has more requirements for it. Everyone wants to get the best travel experience for the least money, but because of the size of the world and the number of scenic spots, people usually cannot find some potential routes that interest them. Therefore, our excavation and recommendation of tourist routes can bring convenience to users. The user recommendation system proposed in this paper is to add a word vector, study the similar scenic spots of tourists, generate a data set, and then recommend it to the user for selection. In this way, users can get a route that they are interested in but have never experienced. Through the experimental mode, we also compare the performance of the algorithm in a threshold, similar number of tourists and vector dimension, and get the best values of several indicators, which can make the algorithm reach the best state and ensure the accuracy of users’ recommendation. Then, in order to find an affordable and better route for users, we introduce the ant colony algorithm, so we can find the best path. Finally, through the experiment, we can find that the ant colony algorithm has a very good advantage, which can not only save the time for tourists to take public transport but also save the cost of tourism. Through the random survey of 10 users’ satisfaction, we can get that this has been a very good promotion.


---

## Body

## 1. Introduction

With the development of information technology, facing the increasing demand for tourism, it is very necessary to have a recommendation system that “understands” users! An ant colony algorithm (ACO) is a metaheuristic algorithm based on the research of the behavior caused by which route the real ants will choose for foraging or which substance will be produced during foraging [1]. It is considered an adaptive memory programming form because of simulating stigma communication. Based on the new algorithm proposed above, this one contains not only heterogeneous but also communication, which provides many different advantages for our research and analysis. Based on this, we propose a new heterosquare algorithm-continuous interactive algorithm, which is based on the solution and optimization of multilevel small continuous functions. The two information channels it uses show two properties: tracing and direct communication, and it also shows its interest by analyzing test functions. By simulating various routes of ant foraging, this ant colony algorithm gives a solution to this problem which NP has been difficult to solve [2]. A new ant colony algorithm is proposed, which can escape from the local maximum. It finds the pheromone on the path through artificial ants, which can adjust the pheromone adaptively. The experimental results show that the improved algorithm has better performance than the basic algorithm. The first model, which integrates two heuristic techniques, is proposed for estimating Turkey energy demand [3]. The accuracy of the algorithm is verified by linear and quadratic forms. The results show that the relative error of the linear form is the smallest, while the other form provides a better fitting solution. The algorithm obtained by studying the social behaviors of real ants like people in society, such as route selection, foraging, and being affected by certain substances, can help the traveling salesman problem. Finally, this problem is successfully solved. Because of this inspiration, this algorithm compares the abovementioned successful problem with knapsack problem and finds out the difference. ACO also successfully solves knapsack problem, further optimizes it, and corrects its parameters [4]. Experiments show that this algorithm has a good solution to a problem difficult to combine and optimize the potential ability and a good viability. An ant colony algorithm for decoupling path planning of multirobot system was proposed. This method plans a reasonable collision-free path for each mobile robot in the system [5]. In this algorithm, a special function is added to optimize the selection strategy, which can make ants establish a dead angle table when they find dead corners, update the path strength by penalty function to avoid path deadlock, and adopt the first-come-first-serve strategy to solve the conflict problem. Simulation results show that this can improve the performance of route planning. An ant colony algorithm, this improved new algorithm, which is optimized for the analysis of continuous parameters, will have very good results [6]. In this method, each corresponding value constructed has a candidate value group with its corresponding tracking information. In each iteration, under this method, the initial value of the component is first obtained according to the tracking of its trajectory value, and then, the value of each component in the solution is determined by two different operations of the genetic algorithm, mainly crossover and mutation. Simulation experiments also show that the expected convergence speed and stability can be well guaranteed, even beyond expectations. The integrated diffusion algorithm is based on different three parties, which can well meet various user requirements of users, namely, users, items, and tags [7]. We know that recommendation requires a huge data set and auxiliary information in it, but this is scarce, and collaborative tags can make up for this scarcity, so we introduce it. Finally, it is evaluated by several different benchmark data sets, namely, http://del.icio.us/, MovieLens, and BibSonomy, and it is proved that its reference can greatly improve the pattern, particularity, and accuracy of our recommendations to users. A personalized recommendation system is a powerful tool to solve the problem of information overload [8]. This paper introduces various definitions, key technologies, and recommendation framework and evaluation methods of physical examination system. This paper tries to give its difficulties and future development direction. When tourists choose the travel route of personalized tourism, they plan an optimal route between the road network and the travel preference of users [9]. The proposed route recommendation is to use a technology to estimate the travel frequency of users, which is collaborative filtering technology. In order to improve its performance, the distance is combined with its direction, and the reliability and accuracy of its recommendation to users are verified by experiments. The LBS algorithm can analyze the relationship between the tourist attraction information and user preference,and then use a user-based collaborative filtering algorithm to match the two to design an algorithm for travel itinerary recommendation, which can well meet the user’s personal information preference [10]. An improved personalized path recommendation algorithm, which well meets the personalized needs of users, such as travel time and budget, and the constraints, such as scenic spot capacity and congestion degree, adds the real-time situation of the path in the matrix calculation [11]. Experimental results show that the proposed algorithm can achieve a good satisfaction in terms of shortening the distance and saving time required by users. Eigentaste, which uses the user to score the item set, obtains it, and then applies it by principal component analysis, which can make a quick calculation of the user recommendation we calculated [12]. Compared with the online joke recommendation system, the results show that the algorithm in this paper is faster and more accurate. When tourists enjoy traveling, if they choose a suitable route, they can not only save the time of taking public transport but also save a lot of money, and also enhance the immersion and happiness of traveling. Therefore, a path planning model based on the ant colony algorithm is proposed [13]. The experimental results show that the ant colony algorithm is a great help for us to choose an optimal tourist route, and it has high performance in dynamic planning, such as reliability and operability. Personalized recommendation technology can solve the problem that tourists spend a lot of time and money to choose tourist attractions [14]. This paper constructs a tourist attraction label system, through the label of the location and type of scenic spots, travel time and way of tourists, and scenic spots associated, calculates the relationship between them to build a user interest model, through the degree of different, and ultimately generates a scenic spot recommendation set. An intelligent route system takes a personalized route [15]. This route combines the knowledge of local scenic spots and public transportation. This system is divided into three steps: recommendation, generation, and customization. Finally, the original model of real-time generation and customization of the route is given by a heuristic algorithm of real-time ant colony solution.


## 2. Ant Colony Algorithm

### 2.1. Basic Overview

The relationship between its related optimization problems and this process is shown in Table1.Table 1
Relationship between optimization problem and ant seeking food.
Ant colony algorithmReal antFeasible solutionThe path that ants walk throughOptimal solutionOptimal shortest path with searchSolution spaceAll possible pathsPheromone matrixPheromone concentration in a certain pathway


### 2.2. Basic Operations and Processes

The basic steps and operations of this algorithm are as follows. Let the calculated distance to the straight line between nodei and node j be diji,j=1,2,⋯,n. The pheromone concentration produced by attracting other ants between node i and node j at time t is Tijt. At the beginning, the concentration of the substances produced by ants is the same in each path, namely, Tij0=T0. Some operations are as follows:Access rule: ant XX=1,2,⋯,m determines the next node to visit according to the concentration of substances produced by ants and the distance between two points. The probability that ant X visits node j from node i at time t is
(1)PijX=Tijtα∗ηijtβ∑s∈allowXTijtα∗ηijtβ,s∈allowX,0,others,whereηij is a function, which is heuristic, which represents the expected degree of transition between nodes i and j, and its value is 1/dij; αrepresents the pheromone importance factor; β denotes the importance factor of heuristic function; and allowk represents the set of nodes that ant X has left to access.Update pheromone: this includes pheromone volatilization and newly generated pheromone
(2)Tijt+1=1−ρTijt+ΔTij,whereρ represents pheromone volatilization factor. The former part refers to the volatilization of pheromones, and the latter part refers to the newly generated pheromones.
(3)ΔTij=∑X=1nΔTijX.There are three different models for calculatingΔTijX.Ant-week model: when the quantity is constant, it is calculated by using the overall information between two points
(4)ΔTijX=QLX,whereLX represents the length of the path of the Xth ant and Q represents the total amount of pheromone released.Ant quantity model: when the quantity is constant, it is calculated by local information of the path
(5)ΔTijX=Qdij.Ant-dense model: each route releases a certain amount of pheromones
(6)ΔTijX=Q.Judge termination and iteration: in increment iteration number counter, output if it reaches the maximum, clearly record and continue iteration.The basic flow of ant colony algorithm is shown in Figure1.Figure 1
Basic flow chart.


### 2.3. Improved Ant Colony Algorithm

Improved access rules:
(7)argmaxs∈allowXTijtα∗ηijtβ,q≤q0PijX=Tijtα∗ηijtβ∑s∈allowXTijtα∗ηijtβ,s∈allowX,q>q00,Others.Global update rule: this rule is not applicable to all ant objects; it needs to have certain conditions, that is, the applicable ant needs to be the fastest ant to find food among all ants, and its journey is the shortest.
(8)Tijt+1=1−ρTijt+ΔTijΔTij=1Lgb,i,jistheglobaloptimumandthepathistheshortest0,Others.The part of the route information of ants is also adjusted reasonably, and the update rules are as follows:Initialization information amount(9)Tij0=Tmax.After a loop, find the ant on the shortest path to release pheromones(10)Tijt+n=1−ρTijt+ΔTijmin,(11)ΔTijmin=QL,L=minLX,X=1,2,⋯,m.Tijt is defined between Tmin,Tmax.


## 2.1. Basic Overview

The relationship between its related optimization problems and this process is shown in Table1.Table 1
Relationship between optimization problem and ant seeking food.
Ant colony algorithmReal antFeasible solutionThe path that ants walk throughOptimal solutionOptimal shortest path with searchSolution spaceAll possible pathsPheromone matrixPheromone concentration in a certain pathway


## 2.2. Basic Operations and Processes

The basic steps and operations of this algorithm are as follows. Let the calculated distance to the straight line between nodei and node j be diji,j=1,2,⋯,n. The pheromone concentration produced by attracting other ants between node i and node j at time t is Tijt. At the beginning, the concentration of the substances produced by ants is the same in each path, namely, Tij0=T0. Some operations are as follows:Access rule: ant XX=1,2,⋯,m determines the next node to visit according to the concentration of substances produced by ants and the distance between two points. The probability that ant X visits node j from node i at time t is
(1)PijX=Tijtα∗ηijtβ∑s∈allowXTijtα∗ηijtβ,s∈allowX,0,others,whereηij is a function, which is heuristic, which represents the expected degree of transition between nodes i and j, and its value is 1/dij; αrepresents the pheromone importance factor; β denotes the importance factor of heuristic function; and allowk represents the set of nodes that ant X has left to access.Update pheromone: this includes pheromone volatilization and newly generated pheromone
(2)Tijt+1=1−ρTijt+ΔTij,whereρ represents pheromone volatilization factor. The former part refers to the volatilization of pheromones, and the latter part refers to the newly generated pheromones.
(3)ΔTij=∑X=1nΔTijX.There are three different models for calculatingΔTijX.Ant-week model: when the quantity is constant, it is calculated by using the overall information between two points
(4)ΔTijX=QLX,whereLX represents the length of the path of the Xth ant and Q represents the total amount of pheromone released.Ant quantity model: when the quantity is constant, it is calculated by local information of the path
(5)ΔTijX=Qdij.Ant-dense model: each route releases a certain amount of pheromones
(6)ΔTijX=Q.Judge termination and iteration: in increment iteration number counter, output if it reaches the maximum, clearly record and continue iteration.The basic flow of ant colony algorithm is shown in Figure1.Figure 1
Basic flow chart.


## 2.3. Improved Ant Colony Algorithm

Improved access rules:
(7)argmaxs∈allowXTijtα∗ηijtβ,q≤q0PijX=Tijtα∗ηijtβ∑s∈allowXTijtα∗ηijtβ,s∈allowX,q>q00,Others.Global update rule: this rule is not applicable to all ant objects; it needs to have certain conditions, that is, the applicable ant needs to be the fastest ant to find food among all ants, and its journey is the shortest.
(8)Tijt+1=1−ρTijt+ΔTijΔTij=1Lgb,i,jistheglobaloptimumandthepathistheshortest0,Others.The part of the route information of ants is also adjusted reasonably, and the update rules are as follows:Initialization information amount(9)Tij0=Tmax.After a loop, find the ant on the shortest path to release pheromones(10)Tijt+n=1−ρTijt+ΔTijmin,(11)ΔTijmin=QL,L=minLX,X=1,2,⋯,m.Tijt is defined between Tmin,Tmax.


## 3. Personalized Recommendation

### 3.1. Basic Overview

First, the system tracks the information of the users it owns, analyzes the activities they browse or participate in, finds out the similarities of these things by some means, forms a unique identity characteristic of users as the basis for recommendation, and then pushes the research results to users for users to choose, so that users can be satisfied and shine at the moment. The tourist route recommendation in this paper is in great need of this system. There are three evaluation methods, which are discrete method, user survey, and online experiment. Its main process is as follows:(1)
The recommendation system establishes user model by observing user behavior(2)
Establish the recommended object model through the relevant information of articles(3)
According to the user’s interest to match the feature information of items, and then through the recommendation algorithm for calculation and screening, find the recommended object that the user may be interested in and then recommend it to the userThe process of the user model is shown in Figure2.Figure 2
Process diagram of user model.


### 3.2. Evaluation Index

The performance indicators used to evaluate the recommendation system are as follows.Customer satisfaction: this indicator mainly depends on user survey or online questionnaire survey. For example, if users play music songs with high popularity through their behaviors many times through the channels that we can query, it means that our recommendation has got a good feedback and result, and the satisfaction of users can be measured by the frequency of playing.Prediction accuracy: it is mainly a kind of system that can analyze the difference of user behavior and see the gap between our predicted user behavior and the original reality. It is one of the more important systems, which is relative to offline.Predictive scoring accuracy: this index mainly looks at the scoring degree of the recommended items or methods by users and then compares them with the scores predicted by the system to see the degree of coincidence. It is calculated by the following indicators.Average absolute error (MAE):(12)MAE=1Ep∑μ,α∈Eprμ,α−rμ,α′,whererμα represents the true rating of commodity μ by user α, rμα′ represents the predicted score of user μ on commodityα, and Ep represents the test.Root mean square error (RMSE):(13)RMSE=1Ep∑μ,α∈Eprμ,α−rμ,α′2,TopNRecommendThis is to give users a personalized list for users to view. It can be measured by the following two indicators:Accuracy (precision):(14)Precision=∑μ∈URμ∩Tμ∑μ∈URμ,where represents a recommendation list, which is made according to the behavior of users on the training set, andTμ represents a behavior list, which refers to the behavior of users on the retest set.Recall rate (recall):(15)Recall=∑μ∈URμ∩Tμ∑μ∈UTμ.Generally speaking, TopN recommendation is more in line with the actual application requirements. For example, predicting whether users will listen to a set of song is more important than predicting what rating users will give it after listening.Coverage rate (coverage):(16)Coverage=∪μ∈URμI,where∪ represents the set of users involved in the system and Rμ represents the length of the list of recommendations predicted by the recommendation system through some method, which is given to users.A system with a coverage rate of 1 can recommend each item to at least one user. By studying the frequency distribution of articles, we can also see the coverage rate. Here are the two metrics to define coverage.Information entropy:(17)H=−∑i=1npilogpi,wherepi represents the popularity of item I divided by the sum of the popularity of all items.Gini coefficient:(18)G=1n−1∑j=1n2j−n−1pij,wherepij denotes the jth item in the item list sorted according to the popularity of the item from small to large.


#### 3.2.1. Diversity

The emotional bias of users is elusive. If we want to make a good judgment on users, we need to make enough choices. This indicator describes some characteristics that can be distinguished between the items we have to choose from, which can be called dissimilarity.(19)Diversity=1−∑i,j∈Rμ,i≠jsi,j1/2RμRμ−1,wheresi,j defines the similarity between items i and j in the interval [0, 1].The average value of diversity is(20)Diversity=1U∑μ∈UDiversityRμ.


### 3.3. Modeling

According to the tourist attraction data set recommended by a personalized recommendation system, the starting point of the model is the public transport site in the city where the user is located. Among them, there are only three choices of public transport, train, plane, and long-distance bus, and each city is divided into three corresponding categories according to the abovementioned public transport, among which are trains that include high-speed rail, bullet train, and express train.Assuming that the time for users to visit scenic spots and take public transport isT, Tij means to play from city i, the end of the tour is the time for city j to take public transport. Tjda indicates the time taken by public transport from j city to scenic spot a, Tdab represents the time from scenic spot a to scenic spot b, Tijh1 represents the transfer time from city i to city j, Tijh2 represents the exchange time of other public transport between different places in the same city, and Tjda represents the time from starting to taking public transport at the kth scenic spot in city j.Suppose the distance isR, Rij represents the distance traveled by city i to city j by public transport, Rjda represents the distance traveled by public transport from city j to scenic spot a, and Rdab represents the distance traveled from scenic spot a to scenic spot b in city j.Suppose that the total cost of the whole process of the user’s play isF, Fij represents the fare of public transport starting from city i and ending at j, Fjda represents the fare between city j and scenic spots, Fdab represents the fare between scenic spots a and scenic spots b in city j, Fjdk represents the ticket for the Kth scenic spot in city j, and Fjdks represents the room and board fee at the Kth scenic spot in city j.Suppose that the user’s comfort level in the whole tour isS, Sjdkt indicates the comfort level in terms of travel time of different interesting and uninteresting scenic spots in city j, and Sjdkv indicates the comfort level in terms of transportation, such as the number of tourists in scenic spots.Assuming that the time constraint is the opening hours of scenic spots are 10 hours from 8 : 00 to 18 : 00, so 0≤Tjda≤10 take public transport for no more than 8 hours, that is, 0≤Tij+Tjda+Tdab≤8.Therefore, the objective functions are as follows:Minimize the total travel time:(21)Tmin=∑i=1mTij+∑j=2mTjda+∑a=1nTdab+∑i=1mTijh1+∑i=1nTijh2+∑k=1nTjda.Minimize the total travel cost:(22)Fmin=∑i=1mFij+∑j=2mFjda+∑a=1nFdab+∑k=1mFijdk+∑k=1nFjdks.Minimize the travel distance:(23)Rmin=∑i=1mRij+∑j=2mRjda+∑a=1nRdad.Maximize the overall comfort of tourism:(24)Smax=∑k=1nSjdkt+∑k=1nSjdkv.Maximize the comprehensive benefits as follows:(25)Emax=Tmin+Fmin+Rmin+Smax.


### 3.4. Introducing Word Vector

Each route can be defined by a word vector and then expressed as aD-dimensional vector. If the central topics of the two routes are similar, their vectors are similar, and the vector distance is small; on the contrary, the vector distance will be relatively large. In this system that brings choices to users, we only roughly estimate the user’s favorite. The recommended thing will deviate from reality to a certain extent. However, it is difficult to capture their feedback based on this experience, so specify an index to measure this difficult information, that is, whether the user participates in what we infer, and participating proves that the alternative route we have made has certain basis and affection. Assuming that the route set that user ui participates in is Lui, the user’s interest class on the route is expressed as
(26)Vui=1Lui∑luix∈Luiluix,whereLui represents the number of routes that users have participated in and luix represents the route vector that users have participated in.In order to measure the similarity of routes, we set a thresholdT for this purpose. When the distance between two routes is less than T, we think that these two routes are similar. We can also get similar tourists through the similarity and similarity of certain information between users, as follows:
(27)LSui=luiy∣luiy∈Luj,uj∈Nui,whereNui represents a similar collection of tourists.


## 3.1. Basic Overview

First, the system tracks the information of the users it owns, analyzes the activities they browse or participate in, finds out the similarities of these things by some means, forms a unique identity characteristic of users as the basis for recommendation, and then pushes the research results to users for users to choose, so that users can be satisfied and shine at the moment. The tourist route recommendation in this paper is in great need of this system. There are three evaluation methods, which are discrete method, user survey, and online experiment. Its main process is as follows:(1)
The recommendation system establishes user model by observing user behavior(2)
Establish the recommended object model through the relevant information of articles(3)
According to the user’s interest to match the feature information of items, and then through the recommendation algorithm for calculation and screening, find the recommended object that the user may be interested in and then recommend it to the userThe process of the user model is shown in Figure2.Figure 2
Process diagram of user model.


## 3.2. Evaluation Index

The performance indicators used to evaluate the recommendation system are as follows.Customer satisfaction: this indicator mainly depends on user survey or online questionnaire survey. For example, if users play music songs with high popularity through their behaviors many times through the channels that we can query, it means that our recommendation has got a good feedback and result, and the satisfaction of users can be measured by the frequency of playing.Prediction accuracy: it is mainly a kind of system that can analyze the difference of user behavior and see the gap between our predicted user behavior and the original reality. It is one of the more important systems, which is relative to offline.Predictive scoring accuracy: this index mainly looks at the scoring degree of the recommended items or methods by users and then compares them with the scores predicted by the system to see the degree of coincidence. It is calculated by the following indicators.Average absolute error (MAE):(12)MAE=1Ep∑μ,α∈Eprμ,α−rμ,α′,whererμα represents the true rating of commodity μ by user α, rμα′ represents the predicted score of user μ on commodityα, and Ep represents the test.Root mean square error (RMSE):(13)RMSE=1Ep∑μ,α∈Eprμ,α−rμ,α′2,TopNRecommendThis is to give users a personalized list for users to view. It can be measured by the following two indicators:Accuracy (precision):(14)Precision=∑μ∈URμ∩Tμ∑μ∈URμ,where represents a recommendation list, which is made according to the behavior of users on the training set, andTμ represents a behavior list, which refers to the behavior of users on the retest set.Recall rate (recall):(15)Recall=∑μ∈URμ∩Tμ∑μ∈UTμ.Generally speaking, TopN recommendation is more in line with the actual application requirements. For example, predicting whether users will listen to a set of song is more important than predicting what rating users will give it after listening.Coverage rate (coverage):(16)Coverage=∪μ∈URμI,where∪ represents the set of users involved in the system and Rμ represents the length of the list of recommendations predicted by the recommendation system through some method, which is given to users.A system with a coverage rate of 1 can recommend each item to at least one user. By studying the frequency distribution of articles, we can also see the coverage rate. Here are the two metrics to define coverage.Information entropy:(17)H=−∑i=1npilogpi,wherepi represents the popularity of item I divided by the sum of the popularity of all items.Gini coefficient:(18)G=1n−1∑j=1n2j−n−1pij,wherepij denotes the jth item in the item list sorted according to the popularity of the item from small to large.


### 3.2.1. Diversity

The emotional bias of users is elusive. If we want to make a good judgment on users, we need to make enough choices. This indicator describes some characteristics that can be distinguished between the items we have to choose from, which can be called dissimilarity.(19)Diversity=1−∑i,j∈Rμ,i≠jsi,j1/2RμRμ−1,wheresi,j defines the similarity between items i and j in the interval [0, 1].The average value of diversity is(20)Diversity=1U∑μ∈UDiversityRμ.


## 3.2.1. Diversity

The emotional bias of users is elusive. If we want to make a good judgment on users, we need to make enough choices. This indicator describes some characteristics that can be distinguished between the items we have to choose from, which can be called dissimilarity.(19)Diversity=1−∑i,j∈Rμ,i≠jsi,j1/2RμRμ−1,wheresi,j defines the similarity between items i and j in the interval [0, 1].The average value of diversity is(20)Diversity=1U∑μ∈UDiversityRμ.


## 3.3. Modeling

According to the tourist attraction data set recommended by a personalized recommendation system, the starting point of the model is the public transport site in the city where the user is located. Among them, there are only three choices of public transport, train, plane, and long-distance bus, and each city is divided into three corresponding categories according to the abovementioned public transport, among which are trains that include high-speed rail, bullet train, and express train.Assuming that the time for users to visit scenic spots and take public transport isT, Tij means to play from city i, the end of the tour is the time for city j to take public transport. Tjda indicates the time taken by public transport from j city to scenic spot a, Tdab represents the time from scenic spot a to scenic spot b, Tijh1 represents the transfer time from city i to city j, Tijh2 represents the exchange time of other public transport between different places in the same city, and Tjda represents the time from starting to taking public transport at the kth scenic spot in city j.Suppose the distance isR, Rij represents the distance traveled by city i to city j by public transport, Rjda represents the distance traveled by public transport from city j to scenic spot a, and Rdab represents the distance traveled from scenic spot a to scenic spot b in city j.Suppose that the total cost of the whole process of the user’s play isF, Fij represents the fare of public transport starting from city i and ending at j, Fjda represents the fare between city j and scenic spots, Fdab represents the fare between scenic spots a and scenic spots b in city j, Fjdk represents the ticket for the Kth scenic spot in city j, and Fjdks represents the room and board fee at the Kth scenic spot in city j.Suppose that the user’s comfort level in the whole tour isS, Sjdkt indicates the comfort level in terms of travel time of different interesting and uninteresting scenic spots in city j, and Sjdkv indicates the comfort level in terms of transportation, such as the number of tourists in scenic spots.Assuming that the time constraint is the opening hours of scenic spots are 10 hours from 8 : 00 to 18 : 00, so 0≤Tjda≤10 take public transport for no more than 8 hours, that is, 0≤Tij+Tjda+Tdab≤8.Therefore, the objective functions are as follows:Minimize the total travel time:(21)Tmin=∑i=1mTij+∑j=2mTjda+∑a=1nTdab+∑i=1mTijh1+∑i=1nTijh2+∑k=1nTjda.Minimize the total travel cost:(22)Fmin=∑i=1mFij+∑j=2mFjda+∑a=1nFdab+∑k=1mFijdk+∑k=1nFjdks.Minimize the travel distance:(23)Rmin=∑i=1mRij+∑j=2mRjda+∑a=1nRdad.Maximize the overall comfort of tourism:(24)Smax=∑k=1nSjdkt+∑k=1nSjdkv.Maximize the comprehensive benefits as follows:(25)Emax=Tmin+Fmin+Rmin+Smax.


## 3.4. Introducing Word Vector

Each route can be defined by a word vector and then expressed as aD-dimensional vector. If the central topics of the two routes are similar, their vectors are similar, and the vector distance is small; on the contrary, the vector distance will be relatively large. In this system that brings choices to users, we only roughly estimate the user’s favorite. The recommended thing will deviate from reality to a certain extent. However, it is difficult to capture their feedback based on this experience, so specify an index to measure this difficult information, that is, whether the user participates in what we infer, and participating proves that the alternative route we have made has certain basis and affection. Assuming that the route set that user ui participates in is Lui, the user’s interest class on the route is expressed as
(26)Vui=1Lui∑luix∈Luiluix,whereLui represents the number of routes that users have participated in and luix represents the route vector that users have participated in.In order to measure the similarity of routes, we set a thresholdT for this purpose. When the distance between two routes is less than T, we think that these two routes are similar. We can also get similar tourists through the similarity and similarity of certain information between users, as follows:
(27)LSui=luiy∣luiy∈Luj,uj∈Nui,whereNui represents a similar collection of tourists.


## 4. Simulation Experiment

### 4.1. Data Sets and Evaluation Indicators

The experimental data set uses the data of a tourism company, including 2654 tourists and 1543 tourist routes. Each individual user information contains the user’s detailed information, such as the selected tour group information, time, cost, details of different scenic spots, and the users own personal identity information. When the user participates in this route, it means that the user likes this route. The evaluation index of the experiment is mainly normalized loss cumulative gain (NDCG).


### 4.2. Influence of Introducing Word Vector Indexes on NDCG

In our view, there are many factors that affect the performance of the algorithm for recommending tourist routes to users, among which, the vector dimensionK plays an important role. Too much K is not easy to calculate and too small to give a good representation of tourists and route characteristics. Figure 3 shows the change trend of NDCG in different vector dimensions.Figure 3
Influence of vector dimension on NDCG algorithm.From Figure3, it can be found that with the increase of K, the performance of the recommended algorithm first improves rapidly and then stabilizes slowly, and the turning point of performance is around the vector dimension 200, so we can take the vector dimension as 200 to make the algorithm get a better performance.Figure4 shows the trend of NDCG performance with threshold T as follows. Threshold T plays a decisive role in the vector representation of tourists, which will affect the calculation of similarity between tourists. If it is too small, it cannot integrate similar routes into similarity calculation, which will affect the accuracy of recommendation algorithm; if the threshold is too large, dissimilar routes will be brought in.Figure 4
Effect of threshold on recommendation algorithm.As can be seen from the above figure, with the increase of threshold, the performance of the algorithm first increases and then decreases, and the break point of performance transformation is about 1.1. Therefore, in order to recommend that the algorithm has a better performance, our threshold should be 1.1.The influence of similar number of tourists on recommendation algorithm is shown in Figure5. It is also a key index that affects the performance of the algorithm. Too much will lead to too many optional routes and large computation; too few will lead to too few alternative routes to have a good recommended performance.Figure 5
Influence of similar number of tourists on recommendation algorithm.It can be seen from Figure5 that with the increase of the number of similar tourists, the performance first increases and then decreases, and the performance can be larger near 60, so our number of similar tourists should be 60.


### 4.3. Experiment of Recommendation Algorithm with Ant Colony Algorithm

After using ant colony algorithm to make a series of comparisons, the results will be analyzed and explained. Comparing the time of traveling by public transport, which affects the experience of users in the whole process, comparing the money spent, everyone hopes to get an affordable experience, and then synthesize the above to comprehensively analyze and study the user satisfaction, and get the results. Figure6 shows the travel cost of random 7, which shows whether the user participates in the recommendation of route using ant colony algorithm or not.Figure 6
Comparison of travel expenses.It can be seen from Figure6 that the ant colony algorithm is used to spend the least on the total travel cost, which shows that it can select the most affordable route for users. No matter from the cost of public transport or the cost of tickets to visit scenic spots, the cost of accommodation, food, and drink is the least, followed by genetic algorithm, and finally particle swarm optimization, which is based on the top several routes in the recommended list. From this index, the user’s experience and satisfaction can be obviously improved based on the affordable characteristics.Figure7 shows a comparison of the time spent on public transport.Figure 7
Comparison of time spent.It can be concluded from Figure7 that in the route selected by ant colony algorithm, the time of taking public transport is the least. This time reflects the user’s comfort during the journey from the side, because if the bus time is too long, the tourists will not only be physically tired but also have irritability physically, which will give us a dissatisfied system score. Therefore, it is necessary to quote ant colony algorithm. Compared with the other two algorithms, it greatly reduces the time of taking public transport. Secondly, particle swarm optimization is used to spend relatively less time, and finally, genetic algorithm is recommended.Figure8 is a comparison of customer satisfaction, with a perfect score of 1, and 10 customers were interviewed.Figure 8
Comparison on user satisfaction.


## 4.1. Data Sets and Evaluation Indicators

The experimental data set uses the data of a tourism company, including 2654 tourists and 1543 tourist routes. Each individual user information contains the user’s detailed information, such as the selected tour group information, time, cost, details of different scenic spots, and the users own personal identity information. When the user participates in this route, it means that the user likes this route. The evaluation index of the experiment is mainly normalized loss cumulative gain (NDCG).


## 4.2. Influence of Introducing Word Vector Indexes on NDCG

In our view, there are many factors that affect the performance of the algorithm for recommending tourist routes to users, among which, the vector dimensionK plays an important role. Too much K is not easy to calculate and too small to give a good representation of tourists and route characteristics. Figure 3 shows the change trend of NDCG in different vector dimensions.Figure 3
Influence of vector dimension on NDCG algorithm.From Figure3, it can be found that with the increase of K, the performance of the recommended algorithm first improves rapidly and then stabilizes slowly, and the turning point of performance is around the vector dimension 200, so we can take the vector dimension as 200 to make the algorithm get a better performance.Figure4 shows the trend of NDCG performance with threshold T as follows. Threshold T plays a decisive role in the vector representation of tourists, which will affect the calculation of similarity between tourists. If it is too small, it cannot integrate similar routes into similarity calculation, which will affect the accuracy of recommendation algorithm; if the threshold is too large, dissimilar routes will be brought in.Figure 4
Effect of threshold on recommendation algorithm.As can be seen from the above figure, with the increase of threshold, the performance of the algorithm first increases and then decreases, and the break point of performance transformation is about 1.1. Therefore, in order to recommend that the algorithm has a better performance, our threshold should be 1.1.The influence of similar number of tourists on recommendation algorithm is shown in Figure5. It is also a key index that affects the performance of the algorithm. Too much will lead to too many optional routes and large computation; too few will lead to too few alternative routes to have a good recommended performance.Figure 5
Influence of similar number of tourists on recommendation algorithm.It can be seen from Figure5 that with the increase of the number of similar tourists, the performance first increases and then decreases, and the performance can be larger near 60, so our number of similar tourists should be 60.


## 4.3. Experiment of Recommendation Algorithm with Ant Colony Algorithm

After using ant colony algorithm to make a series of comparisons, the results will be analyzed and explained. Comparing the time of traveling by public transport, which affects the experience of users in the whole process, comparing the money spent, everyone hopes to get an affordable experience, and then synthesize the above to comprehensively analyze and study the user satisfaction, and get the results. Figure6 shows the travel cost of random 7, which shows whether the user participates in the recommendation of route using ant colony algorithm or not.Figure 6
Comparison of travel expenses.It can be seen from Figure6 that the ant colony algorithm is used to spend the least on the total travel cost, which shows that it can select the most affordable route for users. No matter from the cost of public transport or the cost of tickets to visit scenic spots, the cost of accommodation, food, and drink is the least, followed by genetic algorithm, and finally particle swarm optimization, which is based on the top several routes in the recommended list. From this index, the user’s experience and satisfaction can be obviously improved based on the affordable characteristics.Figure7 shows a comparison of the time spent on public transport.Figure 7
Comparison of time spent.It can be concluded from Figure7 that in the route selected by ant colony algorithm, the time of taking public transport is the least. This time reflects the user’s comfort during the journey from the side, because if the bus time is too long, the tourists will not only be physically tired but also have irritability physically, which will give us a dissatisfied system score. Therefore, it is necessary to quote ant colony algorithm. Compared with the other two algorithms, it greatly reduces the time of taking public transport. Secondly, particle swarm optimization is used to spend relatively less time, and finally, genetic algorithm is recommended.Figure8 is a comparison of customer satisfaction, with a perfect score of 1, and 10 customers were interviewed.Figure 8
Comparison on user satisfaction.


## 5. Conclusion

As can be seen from Figure8, the recommendation system using ant colony algorithm is satisfactory on the whole, which is the highest among the three algorithms. This mainly depends on the route selected by ant colony algorithm, which brings the most economical travel route to users; it is the best in terms of time and money on the road. I believe it is also based on the above two points, which brings comfortable travel experience and affordable food, drink, and accommodation to users and tourists, so that everyone can achieve such user satisfaction!Through the comprehensive comparison of the above indicators, we can find that the personalized recommendation based on ant colony algorithm has better performance than the other two in terms of travel expenses, time spent on public transport, and user satisfaction. This system can be used to bring better experience to users.



---

*Source: 6783567-2022-03-03.xml*