# How to sample the most unique vectors from a very large set efficiently?

While this question already exists and does talk about a heuristic with the Farthest Point First technique, I would like to approach the problem in a more efficient way. I do agree that this is an NP Hard problem, but the Farthest Point First technique might not be the best here, since I am looking for something more computationally efficient, as I am trying to sample about 250,000 vectors from 1.4 billion vectors.

Is there any specific research out there about this? Has anyone used any machine learning techniques such as K-means clustering or so?

My approach would be to divide the task into n buckets which each contain m vectors, where n x m = 1.4 billion. Now I can run K-means clustering on each bucket where k x n = 250,000. Calibrating between the numbers and distributing between multiple computers may be the best way to approach this problem.

• reservoir sampling would imply sampling uniformly randomly right? I want n vectors that are the most "diverse", which is not uniform sampling
– SDG
Jul 28, 2021 at 7:48
• No problem! Any chance you know how to approach this issue?
– SDG
Jul 28, 2021 at 7:52
• What does your data look like? Contrasting with D.Ws answer, there are very good clique finding algorithms and heuristics, especially if your graph is not too dense.
– Juho
Jul 28, 2021 at 7:59
• @Juho 1.4 billion vectors of length 20 and floats, and I would like to find the 250,000 most unique vectors
– SDG
Jul 28, 2021 at 8:09
• Right, I meant what does it look like with respect to the graph you would construct based on it? Are the vectors mostly close to each other, ie. would the graph be very dense for a choice of the threshold t?
– Juho
Jul 28, 2021 at 8:10