How many moves does a knight need to get somewhere?

Sort:
StormCentre3

Yes . Do I agree. There is most certainly a method. But not a universal one . Perhaps likely quite a few.

Here’s the issue. The Knight is starting at a1 - the bottom point of an n x n board. The board grows increasingly larger but remains bordered - in that the Knights 1st move is restricted to a single quadrant. There are 4 slices to the pie over the x/y axis. So here’s the kicker. By not permitting the Knight to move outside it’s quadrant on it’s 1st move - the entire formula is invalidated. Turns out moving outside of x or y and then returning inside the quadrant is the shortest route.

n9531l1

My formula does not limit the first move to a single quadrant. When m(-2,-1)=1 is calculated, it just says that one move is required and doesn't imply anything about the direction of the move.

My formula does require the knight to be at the center of things by specifying (0,0) as its starting location.

n9531l1
StormCentre3 wrote:

The Knight is starting at a1 - the bottom point of an n x n board. The board grows increasingly larger but remains bordered - in that the Knights 1st move is restricted to a single quadrant. 

This is a description of a different problem than the one I posed and solved. In my problem the knight is not at a1, it is at (0,0) of a very large board, the nearest edge of which in any direction could be a million squares away.

Calling it an infinite chessboard is a shorthand way of saying that the edges of the board are too far away to have any effect on the result. I apologize for using a word that had such a bad effect on you.

n9531l1
Mr-Mudd wrote:

It only takes one move for the night to move from one square to the next.

m(2,2) gives the minimum number of moves for a knight to move from (0,0) to (2,2). This can't be done in one move. In fact, it takes at least 4 moves.

n9531l1
Mr-Mudd wrote:

This is what I had in mind.

I guess it's good to have an open mind. But not too open.

n9531l1

On an infinite board, there is only one square with coordinates (0,0).

StormCentre3

Best to can ideas of infinite coordinates. Infinity only exists in mathematics. Many sets of numbers can be inserted to satisfy open ended systems. A chess board is a closed system to which I imagine valid formulas can work for a specific set. A 10x10 would seem easiest to tackle. I strongly suspect any valid formulas to hold true only for mirror sets. A formula for 11x11 must be slightly irregular. Perhaps a constant exists. Any adjacent square is actually 2 moves away on an infinite plane. 

n9531l1
Mr-Mudd wrote:

On an infinite board, no squares have a designation.  

But they do as soon as one is designated as the (0,0) square.

n9531l1
StormCentre3 wrote: A 10x10 would seem easiest to tackle. 

As I have stated several times, to no apparent effect, this thread started with a problem about a board so large that its edge never enters the problem. I agree not to call it an "infinite chessboard" any more since that tends to mislead a few readers about the nature of the problem, as we have just seen.

n9531l1
StormCentre3 wrote:

Any adjacent square is actually 2 moves away on an infinite plane. 

That's incorrect. m(0,1)=3. Or perhaps you can tell me how a knight can move from d4 to the adjacent square e4 in two moves.

StormCentre3, I'd like to know if you have actually run the BASIC program and checked out the results it gives for various target squares. It's not at all hard to do.

llama47
n9531l1 wrote:
llama47 wrote:

In any case it's possible to write a function whose input is a coordinate and output is minimum number of moves for a knight to move there... whether it can be done cleanly / efficiently is another question.

Do you consider the BASIC program I gave you to calculate the number to be efficient enough?

Ok, I read the thread now tongue.png

Yeah, that looks nice. Who came up with it? And you have an alternate version right?

Moonwarrior_1
AunTheKnight wrote:

I honestly don’t get it. We need some other people to join. Math has never been my strongsuit.

 

n9531l1
llama47 wrote:
n9531l1 wrote:

Do you consider the BASIC program I gave you to calculate the number to be efficient enough?

Ok, I read the thread now

Yeah, that looks nice. Who came up with it? And you have an alternate version right?

I came up with it. Who did you think? I don't have another version of the formula. I was hoping someone reading this thread would devise their own formula and we could compare them.

I'm also curious about how many readers have tried the BASIC program and whether any of its results have seemed questionable.

llama47

Yeah, I copy and pasted it to run the program... more important I looked at how you were doing it (the math). Pretty neat idea.

I don't think I'll try to come up with my own, but I want to mess with it a little... about to sleep right now, but I might do something tomorrow.

n9531l1

OK, let me know what you come up with. And thanks for getting this thread back on track after a long and somewhat pointless digression regarding infinity.

anhbao123

I think your way of doing this is the most optimal way

BISHOP_e3

n9531l1
BISHOP_e3 wrote:

[Graphical display of shortest knight paths]

If you would repeat this for a board 50 squares on a side, I believe some interesting patterns might show up.

n9531l1
Mr-Mudd wrote:
BISHOP_e3 wrote:

If it only takes one move to land on a green #1 square, then that is how many moves it takes for it to get to that square.  

A brilliant observation. I can go you one better. If it takes two moves to land on an orange square, then that is how many moves it takes for it to get to that square.

Who wants to take the pink squares?

Ilampozhil25

If it takes 3 moves to land on a pink square, my thesis is that that is how many moves it takes for the knight to get to that square

hopefully my thesis is right