Take the 2-minute tour ×

I need to calculate ~1 billion distances between points with ~100 dimensions each. I think calculating these distances (or even distance squared) would be very expensive. How can I approximate the distance using a faster algorithm?

The algorithms I've found online mostly only work in two dimensions.


share|improve this question
The factor of a billion will play a bigger role than the factor of a hundred in the computational cost. What do you want these measurements for? If it is ultimately to compute statistics, then you may get good enough accuracy by taking a random sample (e.g. $10^6$) of the distances. –  John Bentin Nov 25 '12 at 22:11
@JohnBentin: I'm trying to run k-means clustering on a set of 100 million points, where k = 5. –  badatmath Nov 25 '12 at 22:32

Your Answer



Browse other questions tagged or ask your own question.