Implementation of the affinity propagation cluster algorithm