| Algorithm 1: Data preprocessing |
| Input: Original dataset , minimum voyage time interval threshold . Output: Trajectories |
| 1: Connect to the database. |
| 2: Get where in Len and .// is the total time interval of voyage . |
| 3: if = where = // is the next state of , is the speed of the vessel, is the time interval between two-state. |
| 4: then Optimization (), .//Optimize () is the trajectory optimizing function. Return: |