Iterating Lattice Points inside a Parallelepiped in $\mathbb{R}^n$

78 Views Asked by At

I have an invertible matrix $M\in\mathbb{R}^{n\times n}$ and I have a hypercuboid $I=I_1\times\ldots\times I_n$ which is a cartesian product of closed intervals, and I want to find all lattice points that $M$ sends to $I$, so I want to determine $M^{-1}(I)\cap\mathbb{Z}^n$.

My first approach was to find the minimum and maximum coordinates of the parallelepiped $M^{-1}(I)$ in all dimensions, to then iterate all lattice points in that range, and check whether $M$ maps them to $I$. However, it turned out for my particular problem that this already required iterating $10^8$ lattice points in a fairly simple case with $n=4$.

Next, I tried to split up the parallelepiped $M^{-1}(I)$ into many smaller parallelepipeds with side lengths of $1$, to then apply the previous algorithm to all such parallelepipeds. This gave a very significant improvement, allowing me to solve some $n=5$ instances, but $n=6$ is still too much to handle. Even for $n=5$ only about one in every thousand smaller parallelepipeds turned out to contain a lattice point, and I am iterating through many candidate lattice points for every smaller parallelepiped.

I found this related question Finding all lattice points in an $n$-dimensional hypercube which seems to be equivalent. However, my matrix $M$ contains mostly irrational values, and I have no experience with this LLL algorithm, so I am not sure how it would apply.

1

There are 1 best solutions below

0
On

I'm not sure this would be much better than what you have already tried, but you could feed the problem to a constraint programming solver. Let $x_1,\dots,x_n$ be your integer variables, and let's assume that you have found lower and upper bounds $a_i \le x_i \le b_i$ for each variable (as described in your first approach). You give the CP solver the set of constraints $\sum_j M_{ij}x_j \in I_i$ for each $i$ and ask it to find all solutions.