# Personalized Tour Itinerary Recommendation Algorithm Based on Tourist Comprehensive Satisfaction
## 4 Method
### Time Planning Algorithm Based on Tour Itinerary Planning Satisfaction
We also define a set of scenic spot labels, denoted as \(SS_{a_{i}}=\{\text{C1}_{a_{i}}\), \(\text{C2}_{a_{i}}\), \(\text{L}_{a_{i}}\}\), comprising three dimensions: primary category \(\text{C1}_{a_{i}}\), secondary category \(\text{C2}_{a_{i}}\), and grade \(\text{L}_{a_{i}}\). Tourists can select their interests from all category labels and grade labels. Assuming the user selects the set of interest labels \(IS=\left\{\text{C1}^{1}\), \(\text{C1}^{2}\), \(\text{C2}^{1}\), \(\text{C2}^{2}\), \(\text{C2}^{3}\), \(L^{1}\), \(L^{2}\right\}\), the user's interest level in scenic spot \(a_{i}\) is represented by (A2), where \(\alpha\) represents a fixed initial value, set to 0.5 in this study. \(IS_{a_{i}}\) represents the specificity of 1S to \(a_{i}\), as shown in (A3). If 1S contains the secondary category \(\text{C2}_{a_{i}}\) of \(a_{i}\), then \(IS_{a_{i}}\) includes the primary category \(\text{C1}_{a_{i}}\) of \(a_{i}\). The waiting penalty (\(WaitP\)) arises when the arrival time at a node is earlier than the opening time of the time window currently selected. It is a proportional function of the waiting duration, where the waiting duration equals the time interval between the arrival time at the node and the opening time of the node's time window, minus the duration spent on dining and accommodation during this period. The late arrival (\(LateArrP\)) penalty arises when the arrival time at the node cannot satisfy the expected duration of the visit under the currently selected time window. Figure 11 represents \(LateArrP\) as a piecewise function of the lost visit duration. The lost visit duration is equal to the expected visit duration (\(EVDur_{a_{i}}\)) minus the currently accessible duration, and M represents a sufficiently large number. Meal- and rest-related penalties include the meal deviation penalty \(MealDeviaP\), meal duration reduction penalty \(MealReduP\), and rest accommodation delay penalty \(RestDelaP\). For each dining and accommodation arrangement, these penalties arise from the deviation of the scheduled time from the expected time or from not meeting the expected duration. These penalties are proportional functions of the respective deviations. Physical fatigue penalty. The physical fatigue penalty (\(PhysFatiP\)) arises when the cumulative physical exertion at the scenic spots for the day exceeds the expected daily physical limit. It is a proportional function of the additional physical exertion. We define the node penalty \(P_{a_{i}}\) in (A4), which equals the sum of all penalties generated within the node's time period, added to the physical fatigue penalty. The physical fatigue penalty is calculated on a daily basis, and it is added to the respective node penalty at each rest accommodation and at the end of the itinerary. Therefore, as shown in (A5), the itinerary penalty \(P(I)\) equals the sum of all node penalties within the itinerary \(I\). The itinerary penalty provides a comprehensive assessment of the deviation between the current itinerary planning and the expected scenario. \[P_{a_{i}}=WaitP_{a_{i}}+LateP_{a_{i}}+\sum_{m_{j}\in a_{i}}MealDeviaP_{m_{j}}+ \sum_{m_{j}\in a_{i}}MealReduP_{m_{j}}+\sum_{r_{j}\in a_{i}}RestDelaP_{r_{j}}+ \sum_{r_{j}\in a_{j}}PhysFatiP_{r_{j}}\] (A4)\[P(I)=\sum_{a_{i}\in I}P_{a_{i}} \tag{10}\]

In this algorithm, the penalty coefficients used are as shown in Table 11. These coefficients indicate the relative weights of each deviation and will influence the comparison of different itineraries as well as the time planning within the itinerary based on the minimum penalty principle. ## Appendix C

The processing flow of the dining and accommodation arrangement algorithm for each node is as follows:

Step 1: Determine the known type of food and lodging arrangements required at the current time. If not specified, make a judgment based on the current time (occurring at the start of the itinerary and after any nodes where tourists have specified no food and lodging arrangements), and proceed to the next step.