# Lattice
Lattices are regular grids, and can be defined in many dimensions.
# 1 Closest Point
Finding the closest lattice point to an arbitrary point in space is a problem with well-known solutions: see the first reference which contains many useful algorithms.
# 2 Second-Closest Point
This section is original research which has not been peer-reviewed.
The second-closest lattice point can be used to determine the closest Voronoi cell boundary, as Voronoi cell boundaries are perpendicular bisectors of pairs of neighbouring points.
# 2.1 Zn
Zn is the subset of Rn with all integer coordinates.
It is given the closest lattice point v ∈ Zn to arbitrary point u ∈ Rn.
Let d ∈ Rn, d = u - v.
Find k = argmax |dk|.
Let e ∈ Zn, with ek = 1, dk > 0; ek = -1, dk < 0; ei = 0, i ≠ k.
Then w ∈ Zn, w = v + e is the second-closest lattice point to u.
# 2.2 Dn
Dn is the subset of Zn with sum of coordinates even.
It is given the closest lattice point v ∈ Dn to arbitrary point u ∈ Rn.
Let d ∈ Rn, d = u - v.
Find k = argmax |dk|. Find j = argmax |dj, j ≠ k|.
Let e ∈ Dn, with ek = 1, dk > 0; ek = -1, dk < 0; ej = 1, dj > 0; ej = -1, dj < 0; ei = 0, i ≠ j and i ≠ k.
Then w ∈ Dn, w = v + e is the second-closest lattice point to u.
# 2.3 An
An is the subset of Zn+1 with sum of coordinates 0.
Let R’n be the subset of Rn+1 with sum of coordinates 0.
It is given the closest lattice point v ∈ An to arbitrary point u ∈ R’n.
Let d ∈ R’n, d = u - v.
Find k = argmax dk. Find j = argmin dk.
Let e ∈ Zn+1, ek = 1; ei = 0, i ≠ k. Let f ∈ Zn+1, fj = -1; fi = 0, i ≠ j.
Then w ∈ An, w = v + e + f is the second-closest lattice point to u.
# 2.4 E6
Future work.
# 2.5 E7
E7 can be expressed as the union of 8 copies of 2Z7.
It is given the closest lattice point v ∈ E7 to arbitrary point u ∈ R7.
Let w’ ∈ E7 be the second-closest lattice point in the same coset of 2Z7.
Let w’’ ∈ E7 be the closest lattice point in all the other cosets of 2Z7.
Then w ∈ E7, the closest to u of w’ and w’’, is the second-closest lattice point to u.
# 2.6 E8
E8 can be expressed as the union of 2 copies of D8.
It is given the closest lattice point v ∈ E8 to arbitrary point u ∈ R8.
Let w’ ∈ E8 be the second-closest lattice point in the same coset of D8.
Let w’’ ∈ E8 be the closest lattice point in the other coset of D8.
Then w ∈ E8, the closest to u of w’ and w’’, is the second-closest lattice point to u.
# 3 References
[1]: Conway, J. H. and Sloane, N. J. A., “On the Voronoi Regions of Certain Lattices”, https://doi.org/10.1137/0605031
[2]: Conway, J. H. and Sloane, N. J. A., “Finding the Closest Lattice Point”, in: “Sphere Packings, Lattices and Groups”, https://doi.org/10.1007/978-1-4757-6568-7_20