In the MTD-f algorithm:
function MTDF(root : node_type; f : integer; d : integer) : integer;
g := f;
upperbound := +INFINITY;
lowerbound := -INFINITY;
repeat
if g == lowerbound then beta := g + 1 else beta := g;
g := AlphaBetaWithMemory(root, beta - 1, beta, d);
if g < beta then upperbound := g else lowerbound := g;
until lowerbound >= upperbound;
return g;
Why exactly is this line: if g == lowerbound then beta := g + 1 else beta := g
included, instead of just setting beta := g
? Is it simply to ensure that once a lower bound is found, that the next calls to AlphaBetaWithMemory
will return different/new results?