2.1. Scenic Water Spot Classification Model Based on k-NN Mining
As to the issue of matching with tourists’ interest-tendencies, firstly, a scenic water-spot classification model is constructed, based on k-NN mining, to determine the classification for the scenic water spots in tourist cities. The purpose of constructing the model is to obtain the scenic-spot classification, based on the favorite scenic spots that the tourists have visited, then to study the scenic water spots of the tourist city, and ascertain the interest-tendencies in regard to the scenic water spots of the tourist city, in view of the individual preferences and scenic-spot classifications, so as to confirm each scenic water spot’s capacity to satisfy the tourists’ interests. The first set of definitions is defined, and the scenic water spot classification model is constructed, below.
Definition 1. The element of scenic water-spot classification set, and the scenic water spot initial set. Tourists randomly selectnumber of favorite scenic spots, with different features and spatial attributes, from the scenic water spots they have visited, as the basic elements for setting up the classification model; they define the selected scenic water spots as the elementsof the classification set,,. In accordance with the numberof elements, a matrixwith dimensionis constructed, to store the set elements, which is defined as the scenic water spot initial set. The storage method of elements in the initial setis that the elementfootmarkis increased by column, and the footmarkis increased by row.
Definition 2. Scenic water-spot classificationand scenic water-spot classification set. Confirm the classification for thenumber of scenic water spots, and define the classification that a scenic water spot belongs to, as the scenic water-spot classification,,,is the maximum number of the classification.
According to the definition, the classification meets the following conditions:
- (1)
When , there should be ;
- (2)
Arbitrary ;
- (3)
, ;
- (4)
The number of the classification is defined as . It stands for the element number in the No. classification .
In order to set up the scenic water-spot classification model, it is necessary to optimize set . According to the element number of each classification , a matrix with dimension is constructed to store the optimized set elements , which is defined as the scenic water-spot classification set. The storage method meets the following conditions:
- (1)
The No. row of stores the elements of the No. classification ;
- (2)
The storage method for the arbitrary No. row in the matrix is that the element footmark is increased by column;
- (3)
If the element number of the current row meets , the latter number of elements are set 0;
- (4)
The rows or the columns of are nonlinear-correlated; the row rank meets ; the column rank meets .
Definition 3. The to-be-classified scenic water spot elementand the scenic water-spot classification matrix. In the tourist city, thenumber of scenic water spots that will be classified are defined as the to-be-classified scenic water spot element,,. After classifying by the set, the classified scenic water spotsare stored in a matrix, which is defined as the scenic water-spot classification matrix. In each classification, the number of elementis. Thus, the dimension of the matrixis. The elementsofand the storage method meet the following conditions:
- (1)
The No. row of stores the elements of the No. classification ;
- (2)
The storage method for the arbitrary No. row in the matrix is that the element footmark is increased by column;
- (3)
If the element number of the current row meets , the latter number of elements are set 0;
- (4)
The rows or the columns of are nonlinear-correlated; the row rank meets ; the column rank meets .
Definition 4. Scenic water-spot feature-attribute, feature-attribute vectorand feature-attribute normalization parameter. Each scenic water spot has features that are different from others. The kind of feature that a scenic water spot has is defined as the scenic water-spot feature-attribute. Set that a scenic water spot hasnumber of feature-attributes,,. Set up adimension vector and store thenumber of feature-attributesin the sequence of footmark. The formed vector is defined as the feature-attribute vector. In the quantification process of, as attributeshave different value ranges, in order to make eachhave the same impact in knowledge-mining the tourists’ interests, the feature-attribute normalization parameteris introduced. When,; when,; when,. According to the definition,,andare all suitable forand.
Definition 5. k-NN element feature distance. The neighborhood relationship betweenandis determined by the k-NN element feature distance. According to the Definition 4, the neighborhood relationship betweenandcould be calculated by the Euclidean distance. Vector elements are noted asand;stands for the No.attribute of vector. According to the definition, the k-NN element feature distanceis constructed as Formula (1). According to the above definitions, the scenic water-spot classification algorithm, based on
k-NN mining, is constructed as follows.
Figure 2 shows the modeling process of the scenic water-spot classification algorithm, based on
k-NN mining.
Input: number of , number of , the set .
Output: Matrix .
Step 1: Initialize a transition matrix with the same dimension as ; the dimension is .
Step 2: Calculate the feature distance between the No.1 element and the set data, traverse in ;
Sub-step 1: Calculate the feature distance between the element and the No.1 row No.1 column element of in ; store it in the No.1 row No.1 column element of ;
Sub-step 2: Calculate the feature distance between the element and the No.1 row No.2 column element of in ; store it in the No.1 row No.2 column element of ;
Sub-step 3: Traverse , in line with the method of sub-step 1~2; calculate the feature distance between the element and the No. row No. column element of in ; store it in the No. row No. column element of .
Step 3: Confirm the number of the nearest neighborhood element for k-NN mining. Search the distance values in ; note the counter for the classification as and the total number as .
Sub-step 1: Initialize the counter , , ;
Sub-step 2: Starting from the element , traverse all elements in the sequence of footnote and . Find the global minimum value ; note its row number and the column number .
Iterate , .
Sub-step 3: Search the arbitrary element and judge:
- (1)
Other than the element with , if there is no that makes , the searching ends. Note the row number and column number of . Iterate , .
- (2)
Other than the element with , if there is a which makes , continue searching until the condition is not tenable. Output the current row number and column number of . Iterate , .
Sub-step 4: Judge the counter: (1) If , turn back to Sub-step 3 and continue searching; (2) If , the searching ends. Output the noted number of , related elements and feature attributes .
Step 4: Iterate to output , , . Traverse to search the maximum number in . The related is the classification that the element belongs to. Store into the No. row No.1 column in .
Step 5: Turn back to the above Step 2~Step 4, continue calculating the feature distance between the No. element and the training set data, traverse in , in . Calculate the classification for and store into the No. row No. column in . When search till , output the matrix .
2.2. Scenic Water Spot Spatial-Accessibility Optimization Model Based on Classification Matrix
In the study of water-spot tourism, the meaning of ‘spatial accessibility’ is described on two levels: the first level is the accessibility between the selected starting point of the tourists, when they arrive at the tourist city, and each scenic water spot; the second level is the accessibility among the scenic water spots in the city. Both of these factors play an important role in the tourists’ spatial decision-making. From the perspective of knowledge-mining tourists’ interests, the classification matrix classifies the feature-attributes of scenic water spots. The matrix reflects the capacities of different scenic water spots to satisfy the tourists’ interests. The process of traveling in the city is a series of activities in geographical space. Before the tourists arrive at the tourist city, the system first recommends the best scenic water spots for the tourists [
27,
28,
29,
30,
31]. The optimization degree of the scenic water spots is reflected on two levels: the first level is optimal, in satisfying the tourists’ interests; the second level has optimal accessibility in the tourism space. The classification matrix of the scenic water spots satisfies the optimal conditions of the tourists’ interests, while the spatial accessibility between the tourists’ starting points and the scenic water spots, and the spatial accessibility among the scenic water spots, meet the optimal conditions of tourist spatial accessibility. Tourists travel in a city according to the planned route, which involves the spatial accessibility between the starting point and the scenic spots, and among each scenic spot. Therefore, in addition to satisfying the tourists’ interests, the expense is also a matter of concern for tourists. The aim of tourist spatial decision-making is to minimize the expense of the tour route, on the premise of satisfying the tourists’ interests. In accordance with the above qualitative analysis of the scenic water spot spatial-accessibility optimization, an optimization model of tourist spatial accessibility is constructed, based on the classification matrix of scenic water spots. Several scenic water spots with the best spatial accessibility are extracted from the ones that satisfy the tourists’ interests, and these are set as the important elements of tourist spatial decision-making, in order to plan the spatial tourist route with the lowest cost for tourists [
32,
33,
34,
35]. The second set of definitions is proposed, and the spatial-accessibility optimization model is constructed, below.
Definition 6. Starting distance accessibility factor. In scenic water spot classification matrix, tourists start from the pointand visit several scenic spots; the process forms an unidirectional pathin the tourism space. The road-traveling distance of the pathis noted as, unit: km. The reciprocal of the road-traveling distance of the pathis defined as the starting-distance accessibility factor,, shown in Formula (2). The factorreflects the spatial-accessibility intensity between the starting point and a scenic spot. Thus, the higher the factorvalue, the stronger the spatial-accessibility intensity of the starting pointin relation to the scenic water spot; the lower the factorvalue, the weaker the spatial-accessibility intensity of the starting pointin relation to the water scenic spot . The factorvalue changes with the location of the starting point. As different tourists choose different starting points, the factorshould be a dynamic function. Definition 7. Average traveling distance accessibility factor. In the research area, the average traveling distance between a certain scenic water spotand other scenic water spotsis the standard by which to value the geographic spatial accessibility of, shown in Formula (3). In the formula, therepresents the average traveling distance between a certain scenic water spotand other scenic water spots. The higher the factorvalue, the stronger the globally geographic spatial accessibility ofin the research range; the lower the factorvalue, the weaker the globally geographic spatial accessibility ofin the research range. Definition 8. The weighted average accessibility factor. In order to measure the average accessibility intensity of the starting distance accessibility and the globally geographic spatial accessibility, the weighted average accessibility factoris introduced, shown in the Formula (4). The weighted average accessibility factor reflects the comprehensive accessibility of the scenic water spot, and it is the critical standard by which to recommend scenic water spots. The stronger the factorvalue, the stronger the impact of the water scenic spoton the tourism spatial decision-making; the weaker the factorvalue, the weaker the impact of the water scenic spoton the tourism spatial decision-making. Definition 9. Scenic water spot accessibility optimization matrix. Based on the output scenic water spot classification matrix, the matrixwith the same dimensionis set up, to store the scenic water spots with the optimized spatial accessibility. The matrix is defined as the scenic water spot accessibility optimization matrix. In the matrix, an arbitrary row stands for one classification. The number of elementinis. The elementofand the storage method meet the following conditions:
- (1)
The No. row of stores the elements of the No. classification ;
- (2)
The storage method for the arbitrary No. row in the matrix is that the element footmark is increased by column;
- (3)
If the element number of the current row meets , the latter number of elements are set 0;
- (4)
The rows or the columns of are nonlinear-correlated; the row rank meets ; the column rank meets .
In accordance with the above analysis and definitions, combining with the matrix
, factor
,
and
, the scenic water spot spatial-accessibility optimization algorithm, based on the classification matrix, is constructed as follows.
Figure 3 shows the modeling process of the spatial-accessibility optimization algorithm. In the output matrix
, the storage method for each row of elements follows the descending order of the spatial-accessibility intensity.
Input: number of elements , matrix .
Output: Matrix .
Step 1: Confirm the starting point , spatial coordinates of the scenic water spots . Initialize the matrix as an empty matrix, ;
Step 2: Set up the spatial-accessibility optimization model for the classification . Calculate the accessibility factors of .
Sub-step 1: Extract the first row element in the , and note the element as ;
Sub-step 2: Take the first element of , search through the spatial coordinates of the . Then calculate the factor . Search the between and other elements in , . Calculate the factor . Based on the factors and , calculate the factor of .
Step 3: Calculate the accessibility factors of and make comparison.
Sub-step 1: Take the second element of , search through the spatial coordinates of . Calculate the factor . Search the between and other elements in , . Calculate the factor . Based on the factors and , calculate the factor of .
Sub-step 2: Compare with :
- (1)
If , the spatial accessibility of is stronger than that of , store scenic water spot in the element of the first row in ; store scenic water spot in the element of the first row in .
- (2)
If , the spatial accessibility of is stronger than that of , store scenic water spot in the element of the first row in ; store scenic water spot in the element of the first row in .
Step 4: Traverse the column element of , and calculate the accessibility factors of and make comparison.
- (1)
Search the maximum value in , ; store the related scenic water spot into ;
- (2)
Search the second maximum value in , ; store the related scenic water spot into ;
- (3)
Continue searching in the descending order, and store them into . When , the searching ends.
- (4)
The searching process of the first row in is completed; turn to Step 5.
Step 5: In line with the method from the Step 2 to Step 4, the spatial-accessibility optimization model of is constructed, traversing . When , the searching ends, and the matrix is constructed.
2.3. Low-Carbon Decision-Making Algorithm for Water-Spot Tourists, Based on the k-NN Spatial-Accessibility Optimization Matrix
The purpose of the scenic water spot accessibility optimization matrix
is to rank the scenic water spots that satisfy the tourists’ interests in order of accessibility intensity, and to recommend the scenic water spots that satisfy the tourists’ interests and have the best spatial accessibility for tourists. From the perspective of spatial decision-making, after tourists choose starting point
and select the scenic water spot classifications
, the system recommends
number of scenic water spots with the best spatial accessibility in the matrix
classification
, and the tour route composed of these points has the best spatial accessibility. From the starting point
, and
number of scenic water spots distributed in the geographical space, the tourists start from
and visit the
number of water scenic spots
in a certain time. The main factors to be considered are transportation mode, traveling-distance cost, traveling-time cost and traveling-fee cost. These factors have an especially great impact on tourist spatial decision-making when the scenic water spots are distributed within the administrative area of a tourist city, and cover a large area [
36,
37,
38,
39]. Consequently, making proper tourist spatial decisions, based on scenic water spots, and providing optimal routes for tourists, are important ways to maximize tourists’ satisfaction. Therefore, when setting up the spatial decision-making algorithm for water-spot tourists, the following constraints should be considered: (1) the spatial distribution of the starting point
and
number of scenic water spots; (2) the transportation mode. When the research area is relatively broad—such as the whole city’s administrative area—the modes of self-driving and taking the public bus are usually used; (3) the cost of road-traveling distance between points (unit:
km), including national road, provincial road and township road; (4) the traveling-time cost of road movement between points (unit:
h); (5) the fee-cost of traveling between points (unit:
yuan), such as the fee for the car gasoline, or the fee for taking the public bus. In accordance with the above qualitative analysis of spatial decision-making for water-spot tourists, the research point is transformed into planning the tour route with the lowest cost consumption between the nodes with a certain spatial distribution—which is affected by constraints (1)~(4)—and providing feasible spatial decision-making schemes for water-spot tourists. As to the description of the research point transformation, a third set of definitions are proposed, and a spatial decision algorithm for water-spot tourism is constructed, below. In the definition, and
stand for the different scenic water spots
.
Definition 10. Tourist spatial decision influence factorand the normalization factor. In the process of visiting thenumber of scenic water spotsfrom the starting point, a certain traveling-cost expense will be produced, due to the influence of transportation mode, road conditions, traveling distance, traveling time and traveling-fee cost. The factor that affects the expenses of the tour is defined as the tourism spatial decision influence factor;represents the interval number betweenand;represents the number to distinguish the factors;represents the transportation mode;is self-driving andis taking the public bus. The definitions of the factors are proposed, respectively: (1)represents the traveling-distance cost (unit: km) generated by moving from one scenic water spot to another; (2)represents the traveling-time cost (unit: h) produced by moving from one scenic water spot to another; (3)represents the traveling-fee cost (unit: yuan) of moving from one scenic water spot to another. When the tourists choose different transportation modes, the influence factors are different. Each influence factor is in different orders of magnitude. In order to ensure that it has the same impact on the cost of spatial decision-making, a normalization factoris introduced. When,; when,; when,.
Definition 11. Spatial decision-making section cost functionand spatial decision-making cost function. In the process of moving from one scenic water spotto another scenic water spot, the tourists travel along the roads in the city administrative area, resulting in distance costs, time costs and fee costs. The traveling-cost function betweenand—which is formed by the iteration procedure of the factorsand— is defined as the spatial decision-making section-cost function, as shown in Formula (5). The whole process, of the tourists’ visiting thenumber of scenic water spots from the starting point, includesnumber of road sections. The total cost function of the tour routes generated by the accumulation of all sections’ functionsis defined as the spatial decision-making cost function, as shown in Formula (6). Definition 12. Tourist spatial decision-makingdynamic vector. The process of visitingnumber of scenic water spots, from the starting point, will form an integrated route. When the traveling sequence changes, the route will change too. In geographic space, the scenic water spots have spatial attributes. Map the scenic water spots on to a one-dimensional number axis, and form vector, to randomly store scenic water spots. The vector has the function ofdynamic operation. This vector is defined as the tourist spatial decision-makingdynamic vector.Figure 4shows the mapping process to form the vector. The vectormeets the following conditions: - (1)
The dimension is , the row rank is , and the column rank is ;
- (2)
The first element of stores the starting point , and it is not involved in the algorithm;
- (3)
From the second element to the No. element, they are used to store the number of scenic water spots ;
- (4)
Arbitrary two elements and in the vectors can operate dynamic algorithm, .
Vector represents the tour sequence in the tourism spatial decision-making. When the scenic water spots are stored in the different elements in , they will form different tour routes, relating to different tourist spatial decision-making results. In the vector , the traveling cost between arbitrary elements and relates to the spatial decision-making section-cost function . One vector , formed by one arbitrary dynamic algorithm, relates to one spatial decision-making cost function .
Definition 13. Optimal peak value storage vector. When thedynamic algorithm is operated on the vector, it forms a new tour route. Each tour route relates to one spatial decision-making function. Traverse alldynamic operations for the vector, and generate all the feasible tour routes. Store the optimal tour routes with the cost functionintodimension vector; this vector is defined as the optimal peak-value storage vector. The vector is generated by the combination of thedynamic algorithm and the hill-climbing algorithm. The vectormeets the following conditions:
- (1)
The dimension is , the row rank is , and the column rank is ;
- (2)
In the process of the algorithm, the function values are dynamically stored, and the finally stored values are the optimal number of .
According to the above definitions and analysis, the decision-making algorithm for water-spot tourists, based on the spatial-accessibility optimization matrix, is constructed as follows.
Figure 5 shows the spatial decision-making algorithm process for water-spot tourists, combined with the
dynamic algorithm and the hill-climbing algorithm.
Input: Matrix . Tourists choose classifications , the number of the scenic water spots to be visited, the transportation modes .
Output: Vector .
Step 1: Based on , and , the system recommends the optimal scenic water spots in each and accumulates to the number ; Initialize , ;
Step 2: Confirm the starting point , store it in the No.1 element of . Randomly store the recommended number scenic water spots in the No.2 to No. elements , get the initialized vector .
Step 3: Based on the randomly chosen transportation mode in each road section, calculate the tourist spatial decision influence factor and the normalization factor for each section of scenic water spot and . Then calculate each section’s function value .
Step 4: Calculate , initialize the full ranked vector .
Sub-step 1: Calculate the of the initialized vector ; store the function value into No.1 element of ;
Sub-step 2: Perform the first dynamic algorithm on and get a new vector ; calculate the function value of the vector ; store the function value into No.2 element of ;
Sub-step 3: Perform the second dynamic algorithm on and get a new vector , judge:
- (1)
If , calculate the of the vector , store the function value into No.3 element of ;
- (2)
If , perform dynamic algorithm again.
Sub-step 4: In line with the method in sub-step 1~3, perform dynamic algorithm for number of times on , and each time it creates a different vector , store number of into vector and make the vector full-ranked. Create the peak-value graph for the vector .
Step 5: Continue the dynamic algorithm; do hill-climbing algorithm to search the optimal .
Sub-step 1: Perform the No. time of
dynamic algorithm on and get a new vector ; create the peak-function value graph for ; do hill-climbing algorithm:
- (1)
If , delete the maximum peak value in current
, store into vector ;
- (2)
If , turn to Sub-step 2 and continue searching.
Sub-step 2: Perform the No. time of dynamic algorithm on and get a new vector ; create the peak-function value graph for , do hill-climbing algorithm:
- (1)
If , delete the maximum peak value in current , store into vector ;
- (2)
If , turn to Sub-step 3 and continue searching.
Sub-step 3: Perform the No. time of dynamic algorithm on , and get a new vector ; traverse ; create the peak-function value graph for ; do hill-climbing algorithm:
- (1)
If , delete the maximum peak value in current , store into vector ;
- (2)
If , continue searching until , the searching ends.
Step 6: Output the vector . The number of elements in are the number of minimum peak values in all of the number of peak values after the overall dynamic algorithm performances on .
As to the recommended vector with the minimum function peak values, the minimum value in relates to the tour route with the lowest costs, and the second-minimum value in relates to the tour route with the second-optimal costs. Based on the tourist’s schedule, the system recommends spatial decision-making schemes for the tourist.