Skip to main content
. 2022 Nov 17;24(11):1678. doi: 10.3390/e24111678
Algorithm 4 Pairwise Nearest Neighbor.
    Input
          X     input vectors, {x→1,x→2,…,x→n}
          k     number of clusters
    Output
          C     centroids, {c→1,c→2,…,c→k}
    procedure PNN
          while N>k do
                (c→a,c→b)← FindNearestClusterPair()
                MergeClusters(c→a,c→b)
                N←N−1.
          end while
    end procedure