Есть матрица, которая отображает расстояния, вида:
a b c d e
a
b 3
c 1 4
d 5 2 8
e 9 7 11 6
алгоритм:
1. Begin with the disjoint clustering having level L(0) = 0 and sequence number m = 0.
2. Find the most similar pair of clusters in the current clustering, say pair (r), (s), according to d[(r),(s)] = max d[(i),(j)] where the maximum is over all pairs of clusters in the current clustering.
3. Increment the sequence number: m = m + 1. Merge clusters (r) and (s) into a single cluster to form the next clustering m. Set the level of this clustering to L(m) = d[(r),(s)]
4. Update the proximity matrix, D, by deleting the rows and columns corresponding to clusters (r) and (s) and adding a row and column corresponding to the newly formed cluster. The proximity between the new cluster, denoted (r,s) and old cluster (k) is defined as d[(k), (r,s)] = max d[(k),(r)], d[(k),(s)].
5. If all objects are in one cluster, stop. Else, go to step 2.
http://en.wikipedia.org/wiki/Complete-linkage_clustering#Algorithm
но из шага 4 следует: объединяя два объекта мы должны записать max значения из них в новые колонку и ряд, а их удалить. Получается цепочка, т.к. макс значение будет «мигрировать» в новый объект на каждом шаге. Hint: это точно неправильно, цепочки быть не должно.
В чем моя ошибка?