"Most Similar Vector Problem" on an Integer Lattice? I am currently working on problem that I think could be expressed as an integer lattice problem.
Given $u \in \mathbb{R}^n$ and a bounded integer lattice $L = \mathbb{Z}^n \cap [-M,M]^n$ I would like to find an integer vector $v \in L$ that minimizes the angle between $u$ and $v$. That is, I would like $$v \in \text{argmax}_{w \in L} \frac{u.w}{\|u\|\|w\|}$$
Here, the objective is maximizing the cosine of the angle between $u$ and $w$ (i.e. minimizing the angle between $u$ and $w$). The vectors $u$ and $w$ are said to be "similar" if this quantity is close to 1.
I am wondering:


*

*Is this problem related to a well-known integer lattice problem (e.g. a closest vector problem)?

*Could this problem be solved using existing lattice algorithms (e.g. the LLL algorithm?)
 A: Writing up the comment: You just need to "pixelate" the line by finding all lattice boxes that it crosses:
Then the answer vector $v$ must connect to one of the corners of the shaded boxes. Instead of first collecting the boxes, try the following zig-zag algorithm: start from the origin and poll the up and right nearest lattice points. One of them is closer to your vector $u$, so pick that one. Again, looking up and right, pick the closer vertex. Repeating this procedure will give you a list of distances for each point reached. Pick the minimum distance and that's your answer. This algorithm is $O(Mn)$, and perhaps can be sped up by someone more clever than me. 
A: Not certain whether this "closest vector problem" will help...:

Babai, László. "On Lovász’ lattice reduction and the nearest lattice point problem." Combinatorica 6, no. 1 (1986): 1-13. (Springer journal link.):

Abstract: "... find a point of a given lattice, nearest within a factor of $c^d$ ($c$ = const.) to a given point in $\mathbb{R}^d$....
He is "answering a question of Vera Sós."
But fundamentally, it seems Babai basically rounds coordinates to the nearest integer, to achieve a close vector. (Pardon the too-crude summary.)
A: Comment: You seem to be looking for best simultaneous diophantine approximations of a certain kind. In the original LLL article, "Factoring Polynomials with Rational Coefficients", the authors (Lenstra, Lenstra and Lovasz) describe how to find approximate solutions (in polynomial time) to very similar problems at the end of section 1.  
