asa113, a C code which divides M points in N dimensions into K clusters seeking the division which minimizes a user-defined criterion, by Banfield and Bassill.
This code is in some sense a generalization of the K-means algorithm, because the user is allowed to choose the criterion function to be minimized, and because the algorithm considers both all possible transfers of an object from one class to another, and all possible exchanges that swap two objects.
However, because it is not a K-means algorithm, there is a significant amount of work off-loaded onto the user, and the task of evaluating the change in the criterion function can be far more expensive than in the K-means setting, and the consideration of all possible exchanges can result in an explosion in the running time for large data sets.
Thus, the algorithm should not be the first choice if a K-means calculation is really what is desired, and it may be far too expensive to use if the size of the data set is significant.
This is Applied Statistics Algorithm 113.
The computer code and data files described and made available on this web page are distributed under the MIT license
asa113 is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
asa058, a C code which carries out the K-means algorithm for clustering data.
asa136, a C code which carries out the K-means algorithm for clustering data.
cities, a dataset directory which contains a number of city distance datasets.
spaeth, a dataset directory which contains test data for clustering.
spaeth2, a dataset directory which contains test data for clustering.
Original FORTRAN77 version by Banfield and Bassill; C version by John Burkardt.