Re: The n-knights problem



russell kym horsell <kym@xxxxxxxxxxxxxxxxxxx> wrote in
news:ed0i72$nev$1@xxxxxxxxxxxxxxxx:

Just out of curiosity, a small program along these lines for this
particular problem enermates a maximum of 10^9 possible knight
configurations, finds the one with the largest number of knights, and
terminates in well under 2 seconds.

Really? That's quite a prune down from 2^64!

Because the method is simple
(enumeration) I know the program is right and the answer is right.
While a program that does "mechanical induction" is also
reasonably straightforward (it's just another kind of branch-and-bound
problem, after all :), debugging it and getting it to run in
reasonable time, and having
confidence that it actually is working right might be a bit harder
to arrange than "enuermation of all the not-obviously-wrong
possibilities".

At this point, what I'm interested in is ways to get a Prolog program to
figure out things like "knights only threaten opposite colored squares"
with just a board topology and the move rules of a knight.
.