## a grim knight [cont’d]

**A**s discussed in the previous entry, there are two interpretations to this question from The Riddler:

“…how long is the longest path a knight can travel on a standard 8-by-8 board without letting the path intersect itself?”

as to what constitutes a path. As a (terrible) chess player, I would opt for the version on the previous post, the knight moving two steps in one direction and one in the other (or vice-versa), thus occupying three squares on the board. But one can consider instead the graph of the moves of that knight, as in the above picture and as in The Riddler. And since I could not let the problem go I also wrote an R code (as clumsy as the previous one!) to explore at random (with some minimal degree of annealing) the maximum length of a self-avoiding knight canter. The first maximal length I found this way is 32, although I also came by hand to a spiralling solution with a length of 33.

Running the R code longer over the weekend however led to a path of length 34, while the exact solution to the riddle is 35, as provided by the Riddler (and earlier in many forms, including Martin Gardner’s and Donald Knuth’s).

*[An unexpected side-effect of this riddle was ending up watching half of Bergman’s Seventh Seal in Swedish…]*

October 20, 2016 at 2:23 pm

[…] article was first published on R – Xi'an's Og, and kindly contributed to […]

October 20, 2016 at 7:17 am

[…] Please comment on the article here: R – Xi’an’s Og […]