Nearest-neighbor chain algorithm: Difference between revisions

Content deleted Content added
T3kcit (talk | contribs)
Line 83:
**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 other clusters, and let {{mvar|D}} be the nearest other cluster.
**If {{mvar|D}} is already in {{mvar|S}}, it must be the immediate predecessor of {{mvar|C}}. Pop both clusters from {{mvar|S}}, merge them, and push the merged cluster onto {{mvar|S}}. (There is something wrong, The merged cluster shouldn't push onto {{mvar|S}}.)
**Otherwise, if {{mvar|D}} is not already in {{mvar|S}}, push it onto {{mvar|S}}.