lichess.org
Donate

Question regarding the Knight minimal moves pattern.

But like I said in my original post, I am more inclined to approach the problem using 1. lookup tables (the easiest with the least math) or 2. using graph theory (ex. if you are a more visual/abstract thinker). My whimsical attempt to find a a discreet number of moves using euclidean distances is a bit obtuse. It could potentially make for a more efficient programming method of calculating minimum moves without the need for lookup tables but a comprehensive solution would likely be very tricky because several different distances coorespond to a minimum of 3 knight moves. However, intuition tells me that certain modulus operations might resolve those discrepancies.
@clutchnutz It seems you have to work a lot with modulus to find the mathmatical formula. I used it to find the mathmatical formula of the minimal moves for the knigth in case the row or the column between the knight's house and the target house are the same.
I didn't try this, but I was once thinking about it.

I was going in the direction of using circunferences.

Think of the Knight in the center of a circle radius 1. Take 8 points in that circle, in the positions where the N can move in one single move.

From each of that position, draw another circunference radius 1, and also take only 8 positions.

From that to count is a long way, but I thought it was worth commenting. Maybe someone wants to go this way.

Anyway, very nice question @AcabaComigo .

Cheers.
@drbeco
@C4to
You should create your own engine and submit it to TCEC, I have a feeling it would do very well.
For an infinite board, an explicit formula should be the following:

Without loss of generality, the knight starts in (0,0) and has to reach the square (x,y) ∈ ℕ₀ x ℕ₀ where x ≥ y ≥ 0.

Then the minimal number of moves the knight needs to reach its destination is

3, if (x,y) = (1,0),
4, if (x,y) = (2,2),
ceil(max(½x, ⅓(x+y))) + κ(x,y), else,

where κ: ℕ₀ x ℕ₀ → {0,1} is a correction term that guarantees that the move number will be even if x+y is even and odd if x+y is odd, for example

κ(x,y) = (ceil(max(½x, ⅓(x+y)) + κ(x,y)) mod 2.

The proof idea for the wlog part is just translation and symmetry. The proof idea for the formula goes by induction. Confirm that the formula holds for (0,0), (1,0), (2,0), (3,0), (1,1) and (2,2). Then confirm that it holds for (x,0), x>3 (by moving to (x−4,0) in two moves). After that, show that it holds for (x,1), x>1 (moving to (x-2,0) in one move) and at last prove that it holds for the remaining points (by moving to (x−1,y−2)).

I hope that this answers your question and that you can read everything even if the Lichess forum doesn't support a more readable format for mathematical equations.
I guess 8, about 8 moves
You divide the board in nine squares of 3x3,
Then u create a theorem or heuristic that u need 4 moves
on each 3x3 square
Plus another 4 moves navigating through them,
So about 8, 4+4, if I understood the question,
about the knight path moving the knight from one square to another square, x and z I think u said, like from any square to any square.

This topic has been archived and can no longer be replied to.