in reply to k-Means Clustering demo program with Tk
Nice stuff! I'll also point out the Algorithm::Cluster library on CPAN, which not only gives versions of kmeans, but also a number of other clustering/unsupervised pat-recognition algorithms.
One nice thing about that module is that it provides a simple way of iterating the initial randomization and repeating the clustering so you can have a bit more confidence that you're getting closer to a global separation instead of a local one. Nevertheless, really nice stuff!