Remix.run Logo
jerf 4 days ago

You can write a fast algorithm to map distances to points on a Hilbert curve on a computer: https://stackoverflow.com/questions/499166/mapping-n-dimensi... It's complicated to just glance at, and the algorithm linked here does an arbitrary number of dimensions which also adds some complexity, but it's not that hard, all things considered. Despite the for loops, in practice it's a O(1) algorithm; if I'm reading the algorithm correctly it's technically O(number of bits in index + number of dimensions) but in practice both of those are fixed and the constant factors are very small and so for practical purposes it's going to be O(1) unless you're routinely dealing with highly variable index sizes and dimension counts in practice.

Thus this is a constructive proof that you can use easily convert Hilbert indices and coordinates back and forth between each other. Again, reading the algorithm I'm pretty sure if you give it the algorithm arbitrarily detailed numbers out to infinity, the obvious extension would "work" in that you can slap a "limit to infinity" on the algorithm in both cases and it would converge to any given point you like.