I have the following problem.
On a chessboard, I have a knight on a given square (shown in red), and I need to find the path the knight can take to reach another square (shown in green).
I have to find the shortest path while obeying the movement rules of a knight in chess (L shaped moves) and count the number of moves:
like this:
I have tried different things, but without success.
What can I do?