Activity (Process)
Nearest Neighbor Chain Algorithm
The nearest-neighbor chain algorithm is an efficient method for performing agglomerative hierarchical clustering. It optimizes the standard agglomerative clustering process, reducing the naive implementation's runtime complexity from to .
Algorithm Steps:
- Initialize each data point as its own single-element cluster.
- Initialize an empty stack .
- While there is more than one cluster remaining: a. If is empty, push an arbitrary remaining cluster onto . b. Let be the cluster at the top of . Find its nearest neighbor cluster, . c. If is already in , it must be the cluster immediately below on the stack (meaning they are mutual nearest neighbors). Pop both and from , merge them into a new cluster, and update the pairwise distances. d. If is not in , push onto .
Note: Refer to "Modern hierarchical, agglomerative clustering methods" (Müllner, 2011) for detailed analysis and correctness proofs.
0
1
Updated 2026-06-07
Contributors are:
Who are from:
Tags
Data Science