Full problem description at stackoverflow

I need to find the adjacent neighbours (not necessarily nearest neighbours) to a given point in a multidimensional space.

As shown in the screenshot below, I need to get the adjacent neighbours around the red point, irrespective of their actual distance.

enter image description here

Problem: I can only find the nearest neighbours algorithms, which do not return adjacent neighbours if there is unequal spacing for different dimensions as shown below:

enter image description here

How can I retrieve the adjacent neighbours around a given point?

  • 1
    $\begingroup$ Cross-posted from SO. $\endgroup$
    – noe
    Feb 21 at 17:12
  • $\begingroup$ why don't you put the spacing on the same scale ? (standardize everything)? $\endgroup$ Feb 21 at 17:19
  • $\begingroup$ @LucasMorin I posted the whole question on SO where the whole issue (and MWE) is described. Here I have posted on the simplified question. I can't use the same scaling because the points because the points will be non-linearly distributed in the multi-dimensional space with unequal spacing. The posted screenshots show linear distribution (more or less) to describe the problem and requirement. $\endgroup$
    – skm
    Feb 21 at 18:02
  • $\begingroup$ What is an "adjacent neighbor" and an "immediate neighbor"? $\endgroup$
    – Ben Reiniger
    Feb 21 at 18:09
  • $\begingroup$ its not clear wht you mean by 'irrespective of the spacing'. To achieve that you would need that spacing is equal along dimension. If the spacing is not equal the neighboring is correct. $\endgroup$ Feb 21 at 18:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.