Skip to main content
. 2015 Jun 19;15(6):14639–14660. doi: 10.3390/s150614639

Algorithm 3 Incremental clustering tree building

Input: p: feature point; K: branching factor
Output: T′: Incremental clustering tree
1: select one point from Ci as central point randomly, compose the central point set {t1, t2, ,⋯ tK}
2: min_length=t1t2˜min_length: minimum cluster distance
3: for i = 1 → K − 1 do
4: for j = i + 1 → K do
5:   if titj˜<min_length then
6:     min_length=titj˜;
7:   end if
8: end for
9: end for
10: min_length1=pt1˜, k = 1, count = 0 ⊲ min_length1: minimum distance between p and clusters
11: for i = 2 − K do
12: if pti˜<min_length1 then
13:    min_length=pti˜, k = i
14: end if
15: if pti˜min_length then
16:   count + +, D (count) = i ⊲ the number of clusters less thanmin_length and number of cluster
17: end if
18: end for
19: if min_length1 > min_length then ⊲ create a new cluster
20: CK+1 = {p}, K = K + 1
21: else if count == 1 then
22: Ck = Ck ∪ {p} ⊲ add to the kth cluster
23: else
24: for i = 1 → count do ⊲ combine clusters
25:   Ck = CkCD(i), K = K − 1
26: end for
27: Ck = Ck ∪ {p} ⊲ add to the merged cluster
28: end if