Skip to main content
. 2017 Aug 4;17(8):1792. doi: 10.3390/s17081792
Algorithm 1. The Improved Center Clustering Algorithm
1: Input: k //the number of clusters
2:     ξ //the threshold value
3:      li,i=1,,m //the label of every trajectory
4: Output: the cluster results
5: /*Abnormal trajectories detection*/
6:  (a) IF ξiξ
7:    then li=0, the trajectory perhaps is abnormal.
8:     /*Identifying abnormal trajectories*/
9:     if SOG = 0, or SOG>2Vaverage, or COG[(titi+1)>2min]>30
10:     // Vaverage=(i=1Cm2Vi)/Cm2, Vi,i=1,,m denotes the speed of every vessel.
11:     // titi+1 means the time difference.
12:      then delete the abnormal trajectories.
13:     else
14:     modify li=1.
15:     end
16:  (b) ELSE
17:    then li=1, 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.