How Social Networks Affect the Spatiotemporal Planning of Smart Tourism: Evidence from Shanghai

: Scenic tourism route plans are usually generated by combining scenic Points of Interest (PoIs) and the scenic road network. Traditional algorithms map the road networks linking the PoIs into a route collection and build a corresponding graph model. However, a single PoI description mechanism for scenic spots with multiple entrances and exits is signiﬁcantly different from the actual tour route, which has multiple entrances and exits. Furthermore, the preferences and needs of tourists are not considered in attraction selection in existing algorithms. In this study, we propose a double-weighted graph model that considers the multiple entrances and exits of the PoI and identiﬁes the tourists’ preferences using social network data. According to tourists’ different preferences and demands, different optimized tourist routes closer to the actual optimal paths were generated through an ant colony algorithm based on the proposed double-weighted graph model. To address the efﬁciency of the proposed model, we applied it in Shanghai and compared it with the traditional model through the 2bulu app, which can record three-dimensional (3D) trajectories of tourists. The comparison results show that the proposed model using social network data is closer to the actual 3D trajectory than the traditional model.


Introduction
With the development of the national economy and the improvement of people's living standards, there is a growing emphasis on physical health and spiritual enrichment [1]. Outdoor leisure and sightseeing have become part of a kind of healthy lifestyle and have been widely accepted by citizens [2][3][4] due to their well-known effects on health and fitness, their recreational value, and the benefits of landscape appreciation [5,6].
The quality of outdoor leisure and sightseeing has also been enhanced with the improvement of living standards. A proper recommendation of sightseeing routes is indispensable to help citizens gain a higher satisfaction because they can schedule their visits according to the recommended information [7]. An optimal sightseeing route plan contributes to shortening travel durations, satisfying their interests, and helping tourists enjoy physical relaxation [4]. In addition, a well-designed sightseeing route can present the legends, history, and myths of tourist attractions that enhance the market of tourism products and contribute to the local economy [8].
In traditional sightseeing route planning, the landscape architects or planners usually provide differently themed sightseeing routes according to the special categories of scenic spots-for example, natural, cultural, aesthetic, and recreational spots, are the main focus [8]. This kind of method focuses on a landscape's features rather than the tourists' needs and interests [9]. Moreover, for a diversified demand of visiting time, tourism guides also provide the sightseeing routes classified by the expected consumed time, such as a Table 1. Influence on path planning from scenic spots' entrances or exits.

Classification
Feature Description Path and Planning Distance Impact

Points of interest
The scenic spot has one entrance. One way to leave without affecting the choice of the next attraction.

Routes of interest
The scenic spot has two entrances.
Two ways to leave; when the road network is the only one in the scenic spot, it will not affect the choice of the next scenic spot; however, because the travel process is an itinerary process, it will affect the planned distance.

Areas of interest
The scenic spot has more than two entrances. Multiple ways to leave, which will have an impact on the choice of the next scenic spot, as well as the planned distance.
There are three entrances/exits in scenic spots A and B, two entrances/exits in C, and one entrance/exit in D ( Figure 1). In traditional tour path planning, scenic spots A, B, C, and toilet D would be mapped as POIs for the scenic road network, PA, PB, PC, and PD, respectively, and the traditional path planning for Route 1 (PA-PB-PC-PD) would be generated (Figure 1b). However, in an actual tour, the entrances and exits of scenic spots A, B, and C have certain connectivity, and Route 2 (PA1-PA3-PB3-PB2PC1-PC2-PD) is a more convenient and efficient tourism route in this situation (Figure 1c). There is a significant difference between Routes 1 and 2. The main reason for this is that the connectivity among the entrances and exits of scenic spots changes the original road network's topological connection, which, in turn, changes the results of path planning [25]. Moreover, the tourists' actual demands and preferences for scenic spots to visit is another important factor that should be considered [26]. With the development of Internet technology, social information dissemination has undergone major changes. A large amount of data are generated by using social media data, which expands the breadth and depth of information acquisition [27]. This information is closely related to people's lives and can more accurately reflect user preferences and satisfaction [28,29].
Therefore, it is more reasonable to recommend tourism routes based on the objective factors of tourists' travel preferences, travel autonomy, and personalized needs [30,31], combined with the scenic spots' structural characteristics and the impact of the tourism infrastructure's location on tourism route planning.

Main Contributions
In this study, we address how to improve the comfort of outdoor leisure and sightseeing through combining big social data and the spatiotemporal information of the interesting scenic. We analyzed the scenic spots' structural characteristics and the service facilities' impact on tourism route planning. Then, we discuss the tourism route planning models and algorithms that take into account multiple entrances and must-visit scenic spots. In this article, we not only consider the structure of the scenic spot, but also the needs and preferences of the tourists. To present the proposed model and algorithms clearly, we consider a very old and well-known garden, Yu Garden, in shanghai, and compare the proposed model and algorithm with the traditional case in both simulations in MATLAB and investigations in the 2bulu app.
The organization of the rest of this paper is as follows: In Section 2, we introduce the models and algorithms and how to create it and how to implement it. In Section 3, we introduce the applications of the model and algorithms in a garden (Yu Garden) considering both the simulated case (simulated data are from Google map and the management of Yu Garden) and investigated case (data are from 2bulu app). Additionally, we compare our proposed methods with traditional methods which regard the scenic spot as a point. In Section 4, we discuss all the simulation results and investigation results. Finally, in Section 5, we conclude this paper and present the limitations and implications of the model and algorithms and give some future research directions.

Methods
In this section, we introduce the study area, a local garden (Yu Garden), on which the route planning is verified. Then, we propose a new route plan method combining the Double-Weighted Graph Model (DWGM) and big social data, regarding the scenic spot's structure and the tourists' needs and preferences. Additionally, we apply the methods used for Yu Garden for a comparison of simulation data (simulated data from the Google map and the management of Yu Garden) and investigation data (data from the 2bulu app). Finally, we compare our proposed methods with traditional methods regarding the scenic spot as a point.

Study Area
Yu Garden is an ancient garden located in the Huangpu District of Shanghai, China. It was built in 1559, during the Ming Dynasty, and covers an area of 1.9 hm 2 . Additionally, it is the only remaining garden of Shanghai's Old Town. In history, Yu Garden experienced several disasters, and its overall patterns partly changed. However, Yu Garden was listed as Shanghai's Cultural Heritage in 1959 and a National Cultural Heritage in 1982. Despite experiencing periods of prosperity and decline, damage and restoration, Yu Garden currently retains most of the traditional characteristics of the late Qing Dynasty due to its architectural layout, rockery stacks, corridors, and water system [32].
As a public ancient garden, Yu Garden is one of the key research objects of China's classical gardens and many classical garden research conferences have been held here. For nearly ten years, its daily number of tourists is larger than 120,000. In holidays, such as Labor Day (from 1 May to 3 May every year) and National Day (from 1 October to 7 October every year), the number is larger than 200,000. Additionally, in China's traditional holidays, such as Spring Festival and Lantern Festival, the number is larger than 600,000. Leaders from different countries, such as France, Kingdom of Cambodia, Australia, Mongolia, Panama, Hungary, etc., have all visited Yu Garden. Yu Garden has become one of the important scenic spots for recreation and leisure for citizens in Shanghai. Therefore, Yu Garden is an optimal study area to explore the correlation between the tourism route selection and the structure of Chinese classical garden space.
Yu Garden consists of six scenic areas, and each of them has several sub scenics. Therefore, the branch roads inside Yu Garden are intricate ( Figure 2). To improve the planning accuracy, we cooperated with the Shanghai Garden Management Center and obtained a detailed map of Yu Garden. Then, we used ArcGIS to digitize Yu Garden's scenic spots and roads based on the remote sensing image from Google Maps. Thus, the accessible paths and distances between the entrances and exits of each attraction could be calculated (see Section 3 for more details).

Scenic Spots Selection via Big Social Data
The designing of tourism routes should minimize the cost (money, time, or distance) so as to maximize tourists' satisfaction [33,34] and allow tourists to reach as many highpopularity scenic spots as possible within a certain period. However, the popularity of each scenic spot indicated by its rating and weight is essential. To identify the popularity of each scenic spot, we downloaded the tourists' comments from the Dianping website (https://www.dianping.com/ accessed from 1 January to 31 December 2019, using Python). Dianping is the earliest established third-party review platform in China and has formed a highly reputable database to influence public decision-making [35]. Then, we analyzed the word frequency using the Term Frequency (TF) and Inverse Document Frequency (TF-IDF) model [36,37], a formula that aims to define the importance of a keyword or phrase within a document or a web page.
Term frequency, W t f (w, d), is the frequency of term w, where f w,d is the raw count of the term w in a document, i.e., the number of times that term w occurs in document d.
The inverse document frequency is a measure of how much information the word provides, i.e., if it is common or rare across all documents. It is the inverse fraction of the documents that contain the word (obtained by dividing the total number of documents by the number of documents containing the term, and then taking the logarithm of that quotient): where N d is the total number of documents in the corpus and N w,d is the number of documents where the term w appears. If the term w is not in the corpus, this will lead to a division by zero. It is therefore common to adjust the denominator to 1 + N w,d . Then, the TF-IDF is calculated as, According to the TF-IDF model, we defined the popularity gradient as follows: (1) the scenic spots with weights ≥0.8; (2) ≥0.6 and <0.8; (3) ≥ 0.4 and <0.6; and (4) <0.4. The attraction with a weight of less than 0.4 means tourists pay little attention to them; therefore, these attractions were not involved in this study. The scenic popularity of Yu Garden is details in Section 3. The main parameters used in this work are presented in Table 2. Table 2. Major parameters used in this work.

Parameters Definitions
N the total number of scenic spots; The travel speed of the tourist; t i the recommended tour time for V i ; s The selected starting scenic spot; V i the set of all entrances and exits for V i ; N i the number of total entrances and exits for V i , and |V i |= N i ; E i,j the j-th entrance or exit of scenic spot V i ; |V i | the number of elements in set V i and |V i |= N i ; E the set of routes (edges) between entrances and exits; N d the total number of documents in the corpus; N w,d the number of documents where the term w appears; the inverse document frequency of term w; W TF−IDF (w) the word frequency of term w; f e (s, V i ) the weight function for entering the scenic spot (vertex of the graph); the weight function for departing the scenic spot; Dis s, E i,j the distance between the starting spot s and E i,j calculated via the Dijkstra algorithm; Dis E i,k , E j,l the distance between the entrance or exit E i,k and E j,l calculated via the Dijkstra algorithm; E rr the error between the distance which is calculated by the proposed model and the recorded distance through 2bulu app.
In addition, the toilet is a special service facility with only one entrance and one way in public gardens, which affects the overall distance planning; however, they are often overlooked in traditional route planning.

Double-Weighted Graph Model
Based on the traditional scenic graph model (see Section 1 for more details), the doubleweighted graph model (DWGM) reflects the influence of the architectural characteristics of the scenic spot on route planning by increasing the dynamic selection of the entrances and exits of the scenic spot. In this work, we introduce the definitions of DWGM for a scenic spot and take the distance weight as an example to provide the weight function of the vertices and edges, as well as the solution of the optimal path. The scenic spot model in smart tourism is given as where V i is the scenic spot, t i is the recommended tour time for V i , V i is the set of all entrances and exits for V i , and the j-th entrance or exit of the scenic spot V i is denoted by E i,j . N i is the number of total entrances and exits for V i , and |V i | = N i , where |V i | is used to denote the number of elements in set V i . Then, the DWGM for the scenic spot is obtained as where N is the total number of scenic spots. The weight function for the edge is calculated via the Dijkstra algorithm. The Dijkstra algorithm, also called the shortest path algorithm, is usually used to calculate the shortest path algorithm between two given nodes [21]. In the DWGM, there are two weight functions for the edge of a given scenic spot: 1.
The weight function for entering the scenic spot V i (vertex of the graph) is denoted by f e (s, V i ), and it was given by Here, Dis (s, E i,j ) is the distance between s and E i,j calculated via the Dijkstra algorithm, and s was selected as the starting spot, which can be the scenic spot and the entrances and exits of the scenic spot.

2.
The weight function for departing the scenic spot, Suppose that, V j n is the scenic spot passed but not travelled to; • R = V l 1 , V l 2 , · · · , V l p is the scenic spot that is neither passed nor travelled to.
Moreover, m + n + p = N. Then, the total travel consumption, including the path length and the travel time, can be formulated as where s is the starting scenic spot (generally the entrance of a park) and e is the end of a tour (generally the exit of a park). Then, according to (1)- (4), where v is the speed of the tourist and P is the total travel path. Here, the shorter the path, the shorter the traveling time. The solution for P is the critical travelling salesman problem (also called the travelling salesperson problem, TSP). TSP asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route to visit each city and return to the origin city?". This is an NP-hard problem in combinatorial optimization, which is important in operational research and theoretical computer science:

Construction of DWGM
Like other typical classical Chinese gardens, Yu Garden's spatial layout is characterized by several scenic spots with various entrances and exits and many tourist routes among scenic spots. Based on the DWGM of the scenic spots, we proposed an optimal path planning algorithm. The multiple entrances and exits of the scenic spots are numbered as in Figure 3. The construction process of the scenic solution graph is as follows (Figure 4):

•
Determine the scenic spots and their entrances and exits and construct the vertex set V according to (4) and (5); • Construct the edge set E according to (4) and (5); • Calculate all weight functions for all edges according to (6) and (7);

Investigations Using the 2bulu App
In the investigation, we used the 2bulu app ( Figure 5) to record the three-dimensional trajectory of the volunteers. The 2bulu app is a Chinese professional outdoor mobile app for assisting outdoor fitness with accurate GPS positioning function, developed by Shenzhen 2bulu Information Technology Co. LTD., Shenzhen, China, launched on both iOS and Android app stores. It can be download from the official website: http://www.2bulu.com/ (accessed on 25 June 2021). It is also designed to provide the professional outdoor maps and navigation functions, as well as precise outdoor track routes. It is widely used in daily travel, route planning, motion record analysis, distance measurement, and altitude measurements, etc. Figure 5 presents a screenshot of the 2bulu app. In Figure 5, it can be seen that the 2bulu app is able to record the visit trajectory, the travel duration, the speed, the total distance, the elevation, etc.
In the investigation, ten participants were divided into five groups, and each group was given a route plan. Two participants in each group were required to walk together through Yu Garden along the planned paths. The only difference between the two participants in one group is that one visitor should use a toilet at a time while the other should not. Whilst walking, they had to make sure the 2bulu app was working in the record mode for data collection. The participants also recorded the pairwise walking time at each scenic spot to calculate the average stay at each, combining this with data stored in the 2bulu app. We calculated the error based on the simulated and recorded distances to make a comparison between the traditional and the new algorithms. The error calculation method is given as: where r is the recorded distance and c is the simulated distance obtained through the 2bulu app.

The Scenic Spots Popularity Based on TF-IDF Model and Big Social Data
After cleaning the invalid information, such as tourist comments not related to the scenic area, 6199 effective reviews were finally obtained. According to the word frequency analysis, the TF-IDF model defined in (1)-(3), scenic spots' popularity was determined by their weight: the scenic spot with a Weight ≥ 0.8 is the Great Rockery; the scenic spots with weights: 0.6 ≤ Weight < 0.8 (Table 3) are Dianchun Hall, Sansui Hall, the Ancient Theatre Stage, Jing Pavilion, Hanbi Tower, Tingtao Pavilion, and Wanhua Building; the scenic spots with weights: 0.4 ≤ Weight < 0.6 are Yuhua Hall, Huijing Building, Cuixiu Hall, Hexu Hall, Jiushi Pavilion, and Yule Pavilion. These scenic spots are showed to have high cultural and aesthetic value and are distributed evenly and cover almost all of the garden's area. The ones that with weights smaller than 0.4 (as presented in Table 3) are not well-recommended by big social data. However, the tourists could still visit them according to their own plan. According to the analysis results of the scenic spots' weights and rankings, 14 representative scenic spots whose weights are greater than 0.4 and all their entrances and exits, as well as two toilets, have been chosen as the components of planning routes in this study (Table 4). Table 4. The marks and description of the chosen scenic spots of Yu Garden.

D Yule Pavilion
Yule Pavilion is a small Chinese garden with an attractive landscape, its flowers, pavilions, trees, and other elements can be dating back 300 years.

E Jiushi Pavilion
It is an open architecture, facing a large pool and with a platform.

F Huijing Building
As the main building, Huijing Building is located at the center of Yu Garden, which is dominated by a water landscape.

G Dianchun Hall
Dianchun Hall used to be the command department of Shanghai Small-Sword Society, and now is a hall displaying the cultural relics of the organization.

H Hexu Hall
Hexu Hall faces the lakeside rockeries and is surrounded by windows and has a set of furniture over 200 years old.

I Yuhua Hall
It is the study room of the owner of Yu Garden, in which the furniture is of the Ming Dynasty with superb artistic structures and elegant taste.

J Hanbi Tower
The material of the building is top grade nanmu wood of Myanmar, which is a superior wood product and rare in China.

Tourism Routes Regeneration Based on the DWGM
Based on the DWGM, Dijkstra and TSP algorithms for finding the shortest path, five optimal tourism routes in Yu Garden were regenerated according to the scenic spots' weights and rankings, as well as the distance analysis among them (as presented in Figure 6 and Table 5).

Plan
Tourist Routes Distance (m) In this study, for different target tourists, two tourism routes with or without toilets were proposed. The first one was planned for ordinary tourists who want to see more attractions, including 14 recommended scenic spots (Great Rockery, Dianchun Hall, Sansui Hall, the Ancient Theatre Stage, Jing Pavilion, Hanbi Tower, Tingtao Pavilion, Wanhua Building, Yuhua Hall, Huijing Building, Cuixiu Hall, Hexu Hall, Jiushi Pavilion, and Yule Pavilion). These routes considered both the popularity of the attractions and tourists' needs, representing the best choice, and providing a rich sensory experience. Another route for tourists who have a limitation with regard to visiting time and energy includes eight of the most famous attractions (Great Rockery, Dianchun Hall, Sansui Hall, Ancient-theatre Stage, Jing Pavilion, Hanbi Tower, Tingtao Pavilion, Wanhua Building), whose weights and rantings are ≥ 0.6. These routes are also suitable for older tourists to appreciate the attractions' charms in the shortest time.
Route 1: The total length of the route is 656.84 m, and there is no toilet available over the whole journey.
The total length of the route is 686.91 m, including a toilet on the tour route. This plan considers the route distance and the duration of the tour. Toilet M was included because it is located about halfway through the tour.

Investigation Results Based on the 2bulu App
The investigation results are presented in Tables 6 and 7.    Table 6 presents the investigation data using the same planned route that was calculated through simulation. The investigation data including the calculated distance through the proposed model (Sim-Dis), the duration spent in the scenic spot (Dur.), use of the toilet or not (W.C.), the recorded distance through the 2bulu app (Rec-Dis), and the distance error of the calculated distance over the recorded distance through formula (8) (Err-Dis) through the proposed model. Table 7 presents the average stay at each scenic spot. The average stays are recorded through the 2bulu app. From Table 7, we could find the popularity of each scenic spot according to the stay duration. Compared to Table 3, the popularity of the scenic spot almost coincides with the dib social data from the Dianping website.

Discussion about the Simulation Results
Our results showed that the new algorithm concerning the architectural characteristics of scenic spots has a better performance regarding accuracy than traditional ones considering scenic spots, such as PoIs, and brings higher satisfaction to the tourists. Existing sightseeing route planning only adopts the narrow notion of POIs as many spots lack architectural dimensions. Therefore, the planned route proposes to use buildings, small squares and historical landscapes as single-entry points. The impacts of the structural characteristics of the attractions' entrances and exits on the planned routes are ignored. When it comes to a small-scale landscape area, such ignorance will increase mistakes in route planning for tourists.
Combining scenic spots' attractiveness and diversified demand of tour time, we recommend four detailed routes for tourists that contain the exit and entrance of each scenic spot, and use P(d, t) as a reference for different type of routes, where d is the distance of the route and t is the tour time of the route. The route plan made by the new algorithm has three advantages. First, it includes the exact distance and time duration, which can help tourists choose a route that fits around their schedule. Second, it recommends scenic spots for tourists based on information from the social network provided by someone who has been there. Third, the route plan with each spot's entrance and exit of can offer a reasonable, smooth and complete sightseeing route than traditional plans.

Discussion about the Investigation Results
In Table 6, one can see that the visiting duration of the whole trip varied from 45.9 to 108.0 min and the recorded visiting distance in the 2bulu app ranged from 0.35 to 0.76 km. The visiting distance is relevant to the number of visits to scenic spots. The larger the number of visits to scenic spots, the longer the visiting distance. The visiting durations are not fully dependent on the number of visits to scenic spots. This is because the visiting not only include the walking duration but also include the stay duration in each scenic. Additionally, the stay duration is randomly according to the needs of the tourists.
Furthermore, according to the average stay time of participants, the top four duration scenic spots indicated higher weight rankings, except for Yuhua Hall (Table 7 and Figure 7). As Yuhua Hall had a platform close to the lake with lots of resting facilities, it was also located at the end of the tour route, where tourists usually want to relax. Great Rockery, Ancient Theatre Stage, and Dianchun Hall ranked very highly in terms of participants' stay duration and preference, which reflects the accordance between the social network and tourists' willingness to stay on spots in reality. Additionally, the main exit and entrance ranked very low due to being less interesting than other scenic spots.

Comparison between Investigation and Simulation
In Tables 5 and 6, it can be seen that the visiting distance is a bit longer than the simulated distance in the same route planning. This is because the simulation does not consider the rugged level of the road. There are many stone paved roads and rockeries in Yu Garden which cause more difficulty than in simulations in which all the roads are considered as smooth ones.
It also can be seen in Table 6 that the error of distance in each plan was under 34% and half of all errors were under 15%. From the errors in Group 1 and Group 3, wherein different participants visited the same scenic spots, we noticed that the new algorithm reduced the errors of distance by half. Similar results were shown in Group 2 and Group 4: the errors in Group 2 were under 10%, far fewer than the errors of about 30% in Group 4. Comparing errors in each group, no significant difference was found between the use-toilet plan and no-use-toilet plan except for Group 2, which means using the toilet had little impact on the simulation.
However, dynamic information, such as the real-time passenger flow and dynamic traffic conditions of scenic spots, was not considered in this study. In a further study, we will integrate the characteristics of scenic spots and tourists' preferences with multi-source data, such as social networks and social computing models, and consider establishing a comprehensive weight calculation model.

Discussion for Academic
In this research, a new model, which considers not only the spatiotemporal details of the scenery but also the tourists' preference, is applied. The DWG model is an enhanced graph model and is double-weighted. It enhances the traditional graph model in route planning which does not fully consider the details of the scenic spots and it enriches the research field of tourism route planning.

Discussion for Management
With the widespread use of social networks, tourists provide much information online which is very important for the management of tourism spots. It not only contains the characteristics of the tourists, but also contains their preferences. Then, the scenic managers are able to obtain what should be focused on through analyzing this information. For example, via this research, scenic management could provide different visit plans for different tourists. This could help enhance the efficiency of their marketing. It would be more meaningful if these managers consider the voice of their visitors.

Conclusions
In this study, we used social network data to capture tourists' preferences combined with the attractions' popularity to filter scenic spots. This was achieved by using the open-source spatial data and the TSP algorithm solution regarding the spatial structure of multiple entrances and exits of the scenic spots and calculating five tourist routes according to different tour requirements. Through investigated data, we compared the calculated value via the double-weighted graph model (DWGM) with the recorded value, which were obtained from the 2bulu app. The comparison results show that the planned routes through the DWGM are close to the actual value. Additionally, the proposed method has a better performance with regard to error analysis in terms of accuracy.
These research results are able to provide visitors with more precise route guidance and help to construct better scenic spot services. In the future, the proposed DWGM model will be used in tourism webpages and scenic management in combination with the tourism data provided by them. This will provide more accurate planning for people's leisure travel life and bring better experiences. It is worth noting that one of the cores of this research is the data source. Most of the used data could be obtained through open map software such as Baidu-www.map.baidu.com (accessed on 25 June 2021) and Gaode: www.amap.com (accessed on 25 June 2021). However, it may bring limitations to the research implementations if the research requires highly accurate planning and all the details of the study area.