dimanche 10 janvier 2021

Sample points stochastically in a 3D space with minimum nearest-neighbor distance and maximum density

I have n points in a 3D space. I want to stochastically sample a subset of points with a minimum nearest-neighbor distance r. The size of the subset m is unknown, but I want the sampled points to be as dense as possible.

There are similar questions, but they are all about generating points, rather than sampling from given points.
Generate random points in 3D space with minimum nearest-neighbor distance

Generate 3-d random points with minimum distance between each of them?

Say I have 300 random 3D points,

import numpy as np
n = 300
points = np.random.uniform(0, 10, size=(n, 3))

What is the fastest way to get a subset of m points with minimum nearest-neighbor distance r = 1 while maximizing m?




Aucun commentaire:

Enregistrer un commentaire