Skip to main content
. 2022 Nov 17;24(11):1678. doi: 10.3390/e24111678
Algorithm 4 Pairwise Nearest Neighbor.
    Input
          X     input vectors, {x1,x2,,xn}
          k     number of clusters
    Output
          C     centroids, {c1,c2,,ck}
    procedure PNN
          while N>k do
                (ca,cb) FindNearestClusterPair()
                MergeClusters(ca,cb)
                NN1.
          end while
    end procedure