Re: The n-knights problem
- From: Lash Rambo <lr@xxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 18:50:59 GMT
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.
.
- Follow-Ups:
- Re: The n-knights problem
- From: russell kym horsell
- Re: The n-knights problem
- References:
- The n-knights problem
- From: Lash Rambo
- Re: The n-knights problem
- From: Lash Rambo
- Re: The n-knights problem
- From: russell kym horsell
- Re: The n-knights problem
- From: Lash Rambo
- Re: The n-knights problem
- From: russell kym horsell
- The n-knights problem
- Prev by Date: Re: to insert output in a specific folder
- Next by Date: Re: The n-knights problem
- Previous by thread: Re: The n-knights problem
- Next by thread: Re: The n-knights problem
- Index(es):