| Algorithm 2: Trajectory Similarity Measurement |
| Input: Trajectory dataset preprocessed by Algorithm 1, similarity threshold . Output: Trajectories |
| 1: for in |
| 2: calculate the distance between and |
| 3: end for |
| 4: for in 5: save the trajectory which < 6: end for Return: |