Algorithm 1. The Improved Center Clustering Algorithm |
1: Input: k //the number of clusters
|
2: //the threshold value
|
3: //the label of every trajectory |
4: Output: the cluster results |
5: /*Abnormal trajectories detection*/
|
6: (a) IF
|
7: then
, the trajectory perhaps is abnormal. |
8: /*Identifying abnormal trajectories*/
|
9: if
SOG = 0, or , or
|
10: // , denotes the speed of every vessel.
|
11: // means the time difference. |
12: then delete the abnormal trajectories. |
13: else
|
14: modify . |
15: end
|
16: (b) ELSE
|
17: then
, normal trajectories, enter the next step. |
18: end
|
19: /*The clustering center automatic selection algorithm*/
|
20: for
k = 2 to m
do
|
21: (a) IF
k = 2
|
22: then the two trajectories corresponding to the maximum distance are taken as the clustering centers. |
23: end
|
24: (b) ELSE
|
25: find the top k maximum distance |
26: if the top k maximum distance are the distance among k trajectories, |
27: then the k trajectories are taken as the clustering centers. |
28: end |
29: if the top k distance are formed by the [k + 1, 2k] trajectories, |
30: then choose the k trajectories which are repeated most often as the cluster centers. |
31: end
|
32: end
|
33: /*Cluster analysis and trajectory pattern mining*/
|
34: (a) The trajectories are grouped into k clusters |
35: // Trajectory clustering according to the known k centers. |
36: (b) Cluster analysis |
37: // Find the custom routes and make safety routes. |