Here’s a math/programming problem if anyone’s in to that, with a potential application in cleaning up VCV Rack module arrangement code.

Given two real coordinates x and y, compute the closest point (x_1, y_1) having integer coordinates to (x, y), using Euclidean distance. That’s easy, just round the coordinates. Then compute the second closest point (x_2, y_2) to (x, y), and so on. If multiple points are a tie, the order between them doesn’t matter.

I haven’t done any research on this, but I imagine it’s possible to come up with a constant-time generator algorithm.