I just implemented a different kind of cutoff - wanted to hear what you think. It's actually trivial. [First, recognize that my Quies() and Eval() do not check for mate - so I have no kind of check/mate extension whatsoever.]
In the AlphaBeta() loop, if I get a new Alpha (which does not exceed Beta), then I see if by chance it's a forced mate (within the horizon) against the human backed up to ply 1, and if it is, then instead of continuing the loop with a narrower alpha-beta window (which is what would normally happen), I simply exit the loop and return the new Alpha. In some of my mating puzzles, I am getting dramatic time savings. In most mating puzzles, I am getting a nice time savings, but not dramatic, but enough that it's worth it. In normal positions without mate, the cost is very small.
There is no need to continue the AlphaBeta loop to look for shorter mates, because the earlier iterations of iterative deepening which had just completed would have found the shorter mate (within the horizon) if there had been one, meaning if there had been a shorter mate, I wouldn't be in this iteration to begin with (and iterative deepening stops when an iteration returns a forced mate against human within the horizon). That's why the cutoff I describe above is completely safe.
It makes me wonder if in plies other than ply 1 if the same principle can be applied - you have an Alpha that you know can't get better without causing a beta cutoff, so you may as well cutoff now instead of proving what you already know...
a new kind of cutoff
Moderator: Ras
-
Pradu
- Posts: 287
- Joined: Sat Mar 11, 2006 3:19 am
- Location: Atlanta, GA
Re: a new kind of cutoff
It is very likely that previous iterations find mates that are longer than later iterations because of extensions.There is no need to continue the AlphaBeta loop to look for shorter mates, because the earlier iterations of iterative deepening which had just completed would have found the shorter mate (within the horizon) if there had been one, meaning if there had been a shorter mate, I wouldn't be in this iteration to begin with (and iterative deepening stops when an iteration returns a forced mate against human within the horizon). That's why the cutoff I describe above is completely safe.
-
bob
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: a new kind of cutoff
this only works if you do no search extensions. Otherwise, with extensions, you will find deeper mates with lots of checks in the path than what you can see in mating paths where the first few moves are not checks and nothing causes the search to extend enough to see the final mate...
-
bob
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: a new kind of cutoff
but you will, eventually, or you will get tactically overwhelmed in most every game.