helper functions to split memory-intensive reduce phases.
single pass kmeans