I was wondering if there is any algorithm, theoretical or already implemented, or if its even possible at all, where, given
points (x,y) we can relatively map them in a 2d array where each mapped point in the 2d-array has the property that its neighboring points (at most 8 points around it) are the closest to that point.
I would also like to add an extra restriction that no node in the 2d array is
NULL meaning that if we have for example
N = 1 Million elements then the 2d array would be
sqrt(N) x sqrt(N) or
1000 x 1000 dimension, where each element of that array occupies a point.
In addition, we can also consider sorting, if it can help, as of x-coordinate and as of y-coordinate...
Thanks in advance!