elcabesa wrote:Hi Stefano,
I can't understood where your algorithm should be inserted in a normal search.
can you explain?
my algorithm looks like this:
Code: Select all
alphabeta()
{
before doing any move try to decide whether this node could be pruned or not ( null move pruning, razoring etc etc)
main loop move
{
do the futility pruning ( you can decide that some move are not good before doing them
do move
val = -alphabeta // here yuo can do PVS and lmr
undo move
decide whter continuoe or return based on the val result
}
}
You should implement it in the part named "decide whter continuoe or return based on the val result". Here you compare the val with beta and then cut if val>=beta. We can cut a node if value >= beta, because this means that the opponent already have found a move that give us that value and he never choose the actual sub-node. For sample:
ply P:
a: white move: does nothing
aa: black moves: does nothing
aaa: white move: captures a pawn = 100 cp
has the value 100 centipawn for white at ply P and -100 cp at ply P+1 for black. We can analyze next move at ply P+1:
a: white move: does nothing
ab: black moves: does nothing
aba: white move: slightly worst for white: 95 cp
in normal alfabeta we don't cut now, in "slightly worst" pruning we can cut the node, even if the value is not >=100. We don't have to evaluate abb, abc, abd... moves. Of course, we get a value of 100 for move a, while we would have a real value of 95 or a little less but we have pruned more nodes than before, paying only with a little error in evaluation.
Maybe my implementation in alphabeta is not very correct, because I always think in the context of my alfagemma, that is similar to alfabeta (alphabeta) but it is not recursive.