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 https://math.stackexchange.com/questions/104700/minimum-number-of-moves-to-reach-a-cell-in-a-chessboard-by-a-knight to the variant form of chess posed in https://math.stackexchange.com/questions/710815/knight-move-variant-can-it-move-from-a-to-b. 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:
- 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 https://math.stackexchange.com/questions/104700/minimum-number-of-moves-to-reach-a-cell-in-a-chessboard-by-a-knight.
- 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?
- Use the logic behind the proof posted in https://math.stackexchange.com/questions/710815/knight-move-variant-can-it-move-from-a-to-b to come up with an analytical solution for a recurrence equation rather than try to solve it computationally.
- Graph approach using Dijkstra's algorithm akin to solution posted in https://math.stackexchange.com/questions/1585538/chess-knight-move-in-8x8-chessboard. Again, this may become computationally intractable unless this is solved using sparse graphs.
Any suggestions would be appreciated.