What is the fast n-dimensional z-order curve algorithm?

Space Fill Curves are a way of filling a mesh with a line that preserves locality, i.e. two close points on a line are also 2 close points in space.

Z-order-curve

Is there any fast algorithm ( O(1)

) for mapping between an N-dimensional coordinate and an index on the corresponding N-dimensional space filling curve?

+3


source to share


2 answers


You need to match Nd point with interleaved binary format, which will always be O (n), then if you have 1d sorted array you need to do O (logM) binary search, where M is the number of points; you can use * HashMap <binary, index> * and change the logM binary search search to persistent search o (1).



0


source


It might not be O (1), but you can turn z-index into octkey. Treat it like a basic 8.



0


source







All Articles