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

Algorithm 1 One hierarchical clustering tree building

Input: D: features dataset; N: size of D; K: branching factor; FL: maximum leaf size
Output: T: clustering tree
1: generate head node of the tree T, represented with header
2: if N < FL then
3: expand all points in D as child nodes of header
4: else
5:  we choose K points {q1, q2, ⋯ , qK} randomly from D, K clusters C = {C1, C2, ⋯ , CK}, qk is the center of Ck
6: for i = 1 → N do
7:   min_length = MAX_NUMBER, k = 0
8:   for j = 1 → K do
9:    if piqj˜min_length then
10:      min_length=piqj˜, k = j
11:    end if
12:   end for
13: end for
14: for i = 1 → K do
15:   recursively apply the algorithm to the points in Ci
16: end for
17: end if