lbehnke / hierarchical-clustering-java

Implementation of an agglomerative hierarchical clustering algorithm in Java. Different linkage approaches are supported.
141 stars 79 forks source link

Problems in multi-thread #17

Closed csushin closed 5 years ago

csushin commented 8 years ago

Hi, first of all, sincerely appreciate your code. I am trying to use this code in multi-thread. More specifically, i have multiple image and call your hierarchical clustering algorithm on every pixel on the same time. And it will give me the error that: image M___\ represents the name of the leaf node. clstr#*\ represents the automatically generated cluster name.

This error will only show occasionally in some thread which will cause the exceptions. And this error won't show up if i do not use multi-thread. Do you have any idea on this? If you need more information, just let me know.

Thanks!

lbehnke commented 8 years ago

Sorry for not coming back to this earlier. I'd recommend building first a distance matrix from the images, which is then passed to the DefaultClusteringAlgorithm OR use a DefaultClusteringAlgorithm instance per thread.