Nearest-neighbor chain algorithm: Difference between revisions

Content deleted Content added
m link memoization using Find link
Ojdo (talk | contribs)
The algorithm: correction in algorithm description
Line 82:
*While there is more than one cluster in the set of clusters:
**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|C}}. Pop both clusters from {{mvar|S}}, removemerge them from the set of active clusters, merge the two clusters, and addpush the merged cluster to the set of activeonto clusters{{mvar|S}}.
**Otherwise, if {{mvar|D}} is not already in {{mvar|S}}, push it onto {{mvar|S}}.