fast-hilbert icon indicating copy to clipboard operation
fast-hilbert copied to clipboard

Support Hilbert derivatives.

Open hallahan opened this issue 3 years ago • 3 comments

How hard would it be to get the performance gains of fast_hilbert, but also be able to create Xian Liu's variants?

https://www.sciencedirect.com/science/article/abs/pii/S0096300302008081?via%3Dihub

Looks like hilbert_2d does this.

https://crates.io/crates/hilbert_2d

I wonder if the variants provide significant performance differences regarding the use of the curve as a spatial index?

hallahan avatar Oct 29 '22 19:10 hallahan

Not sure yet. Just had a brief look on the Moore type. I would assume that it is not too hard to re-use the LUT idea and generate another for the Moore type. Performance wise I don't see how there would be a difference.

becheran avatar Oct 30 '22 08:10 becheran

If the lowest_order optimization you have in #9 is significant, sorting OpenStreetMap (or any planet scale) data would be fastest for this Hilbert variant. I had to flip around one of the images in the hilbert_2d docs, as this one isn't supported. You would sort in reverse.

liu

Europe is the most data dense by a long shot. India, SE Asia come in second place.

hallahan avatar Oct 31 '22 17:10 hallahan

@hallahan I managed to implement the moore variant using the LUT logic I use to compote the hilber curve. It was a bit more challenging than I thought because there was a hidden first state for the moore curve which is not directly repeated for higher order/more bits.

The other LIU variants use more than 4 states and won't fit into the 4 state LUT idea that I use in the fast_hilbert crate.

becheran avatar Jan 14 '23 20:01 becheran