I read it once, didn't understand. I'm not going to read it 5 times to try and decipher it.
Sorry, I'll try to be clearer next time.
I read it once, didn't understand. I'm not going to read it 5 times to try and decipher it.
Sorry, I'll try to be clearer next time.
m(-257,-3186) cannot possibly be 1149.
A knight moves 2 squares in one direction and 1 square in either perpendicular direction, like 2 north 1 east or 2 north 1 west or 2 west 1 south, etc.
So the MINIMUM number of moves is half of the absolute value of the coordinate further away from 0. In this case, it is | -3186 | / 2 = 1593. Therefore, it cannot possibly go less than 1593. It could require more.
If it went exactly 1593 moves, it would have to go South 2 every time. Therefore, it would always have to go easy or west 1 move every time. Since in exactly 1593 moves, the Knight can get to ANY ODD numbered coordinate between 1593 and -1593, for example, to get to -1587, you'd go east 3 times and west 1590 times, and since -257 is odd and within range, the answer MUST be 1593.
If X were an even number or a number beyond 1593 or -1593, only then would it take more than 1593 moves with y being -3186.
The chart, which expands infinitely on a plane, is not a true representation of the shortest Knight moves on a real chess board. A chess board is finite, bordered and places restrictions on the 1st move for the Knight when on a the 1st or 2nd file/rank.
All that is being said- a formula for an infinite board holds true for any given coordinate. Problems exist in making such a formula for a real chess board with finite space.
Upon viewing a single quadrant, which are all symmetrical, one quite readily observes starting from 0/0 , the resulting chart does not accurately predict the pattern that emerges from a finite chess board.
You remind me of @thee_ghostess_lola you like to have fun and are maybe a bit trolly.
Does that not remind you of somebody else?
I ROUNDHOUSE KICK YOU
YOU FORGOT THE RED FONT :-)
I read it once, didn't understand. I'm not going to read it 5 times to try and decipher it.
Sorry, I'll try to be clearer next time.
Not you, lol.
In case anyone is still working on an alternate solution to the shortest knight path problem, here are a few more results given by the formula I found for comparison purposes.
m(7,7)=6
m(13,-11)=8
m(-233,512)=257
m(2317,1449)=1256
For the benefit of anyone who is just coming across this thread, I'll explain what the numbers above mean. They relate to a math problem involving a knight near the middle of a non-standard chessboard which is about to travel to a different square. The board is laid out like a regular chessboard, but instead of being an 8 by 8 board, it has a very large number of ranks and files. For convenience, the starting square of the knight is given coordinates (0,0). A square two files to the right and five ranks below would be at (2,-5), and so on. The problem is to find the length of the shortest path, using standard knight-moves, for the knight to travel from its starting square at (0,0) to a given target square at (x,y), for any particular values of x and y, given that the board is large enough to keep the shortest path from ever reaching the edge of the board. So the answer will be a formula for a function m(x,y) which calculates the shortest path length for any given x and y.
I found a formula for m(x,y) which I believe gives the correct minimum move number for any values of x and y. There can be more than one correct way to solve a math problem, and I hoped a mathematically-minded reader would be inspired to develop another solution. If two solutions found independently give the same path length for the same starting and target squares in every case, it would increase our confidence that our solutions are correct. You could be the first to find an alternate approach to solving the problem.
I reposted my interest in finding an alternate shortest-knight-path formula in the Fun With Chess forum, thinking I might find readers there more interested in working on an interesting math problem that in scoring debating points. As a result, Lugarian, although not able to develop a formula, found an online discussion of this problem in which a shortest-path formula was proposed. It is different from my formula, but gives the same exact shortest path length for every target square I have tested. I've concluded that it satisfies my hope of finding an independently-derived formula which also gives correct results for m(x,y).
Some readers may be interested in seeing the actual formulas, so I'll show them here as a way of wrapping up this thread. They are simplest to express when written for the one-eighth of the board where 0≤y≤x. As I mentioned previously, the results there can easily be extended by symmetry to cover the whole board.
Here is the formula I posted two years ago at another site where I first saw the problem being discussed:
[r] means integer part of r
WOLOG, assume 0≤y≤x.
m(1,0)=3
m(2,2)=4
else if 2y>x, m(x,y)=x-y+2[(2y-x+2)/3]
else m(x,y)=x-y-2[(x-2y)/4]
Here is the simplified form of the formula Lugarian found a link to:
⌈r⌉ means the smallest integer greater than or equal to r
WOLOG, assume 0≤y≤x.
m(1,0)=3
m(2,2)=4
else let z=⌈max(x/2,(x+y)/3)⌉
m(x,y)=z+((x+y+z) mod 2)
4 quadrants alone= different from shown
I couldn't decide what you meant by this, but it appears to me that the pattern is perfectly symmetrical. In checking the symmetry, you have to ignore the leftmost column of pixels, since the corresponding rightmost column is off the edge of the graph. Likewise the bottom row of pixels matches a top row that is off the edge of the graph.
I read it once, didn't understand. I'm not going to read it 5 times to try and decipher it.
In any case it's not symmetrical because it's a 50x50 board, which means there is no single center square (just like an 8x8 board). I could have done it with 51x51 but I didn't care.