|
|
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: minimum cluster distance |
| 3: |
for
i = 1 → K − 1 do
|
| 4: |
for
j = i + 1 → K
do
|
| 5: |
if
then
|
| 6: |
; |
| 7: |
end if
|
| 8: |
end for
|
| 9: |
end for |
| 10: |
, k = 1, count = 0 ⊲ min_length1: minimum distance between p and clusters |
| 11: |
for
i = 2 − K
do
|
| 12: |
if
then
|
| 13: |
, k = i
|
| 14: |
end if
|
| 15: |
if
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 k – th cluster |
| 23: |
else |
| 24: |
for
i = 1 → count
do ⊲ combine clusters |
| 25: |
Ck = Ck ∪ CD(i), K = K − 1 |
| 26: |
end for
|
| 27: |
Ck = Ck ∪ {p} ⊲ add to the merged cluster |
| 28: |
end if |
|