Minimum number of moves to reach a grid point by modified knight in variant chessboard

I apologize if this is not the right board to post this question but I’m cross-posting from the mathematics board. I am dealing with a computational question that extends the question posed in to the variant form of chess posed in Specifically, what is the number of minimum moves for a modified knight (call it ($ \alpha,\beta$ )-knight) that moves with $ \pm\alpha$ and $ \pm\beta$ along the coordinates (instead of the usual $ [\pm 2, \pm 1]$ )) in any direction to reach a point $ (x, y)$ starting from the origin (0,0)? This would mean moving from $ (x,y)$ to any of the following: (𝑥±$ \alpha$ ,𝑦±$ \beta$ ), (𝑥∓$ \alpha$ ,𝑦±$ \beta$ ), (𝑥±$ \beta$ ,𝑦±$ \alpha$ ) or (𝑥∓$ \beta$ ,𝑦±$ \alpha$ ). We can assume without loss of generality that $ x \geq y$ .

This is similar to the question posed in this forum here: Knight on a chessboard. I’d like to know if there is a closed form answer rather than a solution that requires BFS because I would like to work with a chess board (or coordinate grid) that is $ N \times N$ where $ N$ is large (e.g. $ 10^6$ ).

My initial thoughts of how to approach this is as follows:

  1. Modify the equation to reach either the $ x$ -axis or the diagonal as well as the number of subsequent moves from the diagonal to reach the origin as solved in
  2. Solve this problem computationally with a recurrence equation that can be solved using dynamic programming (thought I suspect for larger$ N$ in a $ N\times N$ chessboard for large $ \alpha$ and large $ \beta$ , this becomes intractable). Would this be more feasible than the BFS solution posted in: Knight on a chessboard?
  3. Use the logic behind the proof posted in to come up with an analytical solution for a recurrence equation rather than try to solve it computationally.
  4. Graph approach using Dijkstra’s algorithm akin to solution posted in×8-chessboard. Again, this may become computationally intractable unless this is solved using sparse graphs.

Any suggestions would be appreciated.