| Input parameters: user movement behavior trajectory Q, minimum speed S, minimum time T, and maximum disturbance threshold MT. |
| Output parameters: collection of popular scenic spots HR. |
| Step 1: for (i = 2, i ≤ |Q|, i++) /∗ represents the number of location information points∗/ |
| Step 2: D [i − 1] · T = cal T (pi − 1, pi); |
| Step 3: D [i − 1] · S = cal D (pi − 1, pi)/D [i − 1] · T; |
| Step 4: HR = {}; C = {}; CO = false; |
| Step 5: for (j = 2, j ≤ , j++) /∗cycle search indoor attractions area HRI∗/ |
| Step 6: if (D [j − 1] · T > T and D [i − 1] · S < n ∗ S) then |
| Step 7: C = {pj − 1, pj}; /∗record location information point stay area∗/ |
| Step 8: if (not CO) then CO = true; |
| Step 9: else C = Update {pj − 1, pj}; /∗merge the location information points closer to the collection HR∗/ |
| Step 10: else if (CO) then |
| Step 11: HR = {C}; CO = false; C = {} /∗search outdoor attractions area HRII∗/ |
| Step 12: if (D [j − 1] · S ≤ S) then /∗determine activity intensive areas∗/ |
| Step 13: C = {pj}; |
| Step 14: if (not CO) then CO = true; |
| Step 15: else if (CO) then |
| Step 16: last Index = look Ahead (MT, S); |
| Step 17: if (last Index ≤ j + MT) then |
| Step 18: for k = last Index downto j do |
| Step 19: C = {pk}; |
| Step 20: j = last Index; |
| Step 21: else if (time (C) > T) then |
| Step 22: HÈ = {C}; C = {}; CO = false; |
| Step 23: return HR; |