Algorithm 3.
ID shuffling for a high dimensional grid
| Define {Ni} = the number of cells in each dimension and Ni = 2ni, (ni ∈ Z); |
| Define N = Π(Ni); |
| For each cell |
| {Ii} = the cell’s grid index in each dimension; |
| { } = {reverse_bit(Ii)}; |
| I′ = interleave_bit({ }); |
| ID = N - I′; |