One scheme for arranging 2D lists by proximity involves Peano encoding the entries, which basically amounts to a perfect bit shuffle of each (x,y) coordinate of n-bits into a single interleaved 2n-bit value. (I first learned of this scheme reading about US Census tract mapping and TIGER data ca. 1984.)
Ex: (x,y)=(0x4,0xB)=(0_1_0_0,_1_1_0_1),
then Peano(x,y) is 01110001 = 71.
This bit shuffle results in a list of numbers that, when sorted, represent 2D proximity along a single number line. It is easy to show that for Peano values A,B,C that A < B < C implies B lies in a 2-D rectangle bounded by A and C.
Just a thought, and may not be what you need at all. Good luck.