Let's consider an infinite chessboard where a knight is at position (x, y) and needs to reach at point(p, q). If we consider this chessboard on 2d cartesian plane. Do anybody know how to solve this question other than A* search algo.
Asked by: Anonymous on July 2, 2019, 4:13 p.m. Last updated on July 2, 2019, 4:13 p.m.
Shortest path i meant, forgot to mention that.
From what I feel, to get the shortest path ,you have to take the bfs or the a* heuristic as you mentioned. I was thinking of a do solution with the tag you mentioned ,but as the source and destination keep changing , i dont think a dp solution is possible and anyways there is no significance of a dp solution for one source to destination query,i guess.
Do you want the shortest path from source to destinotion through your algorithm ,or just the answer to the question if it is reachable..
Because,don't you feel, a knight can reach any of the positions on the chess board?
SHUBHAM_GUPTA1 last updated on July 7, 2019, 4:18 p.m.