Show HN: Simple, multi-key sorting algorithm for 2D+ points gridification

1 pointsposted 11 hours ago
by adec314

1 Comments

adec314

10 hours ago

Cartesian grid sort assign raw input points (x_k, y_k) to a grid by mapping the initial flat index k to a multi-index [ij]. Point set become (x_[ij], y_[ij]).

Alternated 1d sorts make the [ij] grid structure converge to monotonic, spatially coherent multi index with a simple and fast algorithm (<80 lines basic C++ code, <200 ms runtime / million points)