Nearest-neighbor chain algorithm: Difference between revisions

Content deleted Content added
Definitions: rename as background as not everything in here is definitional
Line 82:
**If {{mvar|S}} is empty, choose an active cluster arbitrarily and push it onto {{mvar|S}}.
**Let {{mvar|C}} be the active cluster on the top of {{mvar|S}}. Compute the distances from {{mvar|C}} to all the other active clusters, and let {{mvar|D}} be the nearest other active cluster.
**If {{mvar|D}} is already in {{mvar|S}}, it must be the immediate predecessor of {{mvar|SC}}. Pop both clusters from {{mvar|S}}, remove them from the set of active clusters, merge the two clusters, and add the merged cluster to the set of active clusters.
**Otherwise, if {{mvar|D}} is not already in {{mvar|S}}, push it onto {{mvar|S}}.