For example, we have all seen how "alpha_beta" is explained on many different wikipedia type pages:
Code: Select all
function alphabeta(node, depth, α, β)
(* β represents previous player best choice - doesn't want it if α would worsen it *)
if depth = 0 "or" node is a terminal node
return the heuristic value of node
foreach child of node
α := max(α, -alphabeta(child, depth-1, -β, -α))
(* use symmetry, -β becomes subsequently pruned α *)
if β≤α
break (* Beta cut-off *)
return α
(* Initial call *)
alphabeta(origin, depth, -infinity, +infinity)
Code: Select all
function negamax(node, depth, α, β, color)
if node is a terminal node or depth = 0
return color * the heuristic value of node
else
foreach child of node
α := max(α, -negamax(child, depth-1, -β, -α, -color))
{the following if statement constitutes alpha-beta pruning}
if α≥β
return α
return α
Code: Select all
function MTDF(root, f, d)
g := f
upperBound := +∞
lowerBound := -∞
while lowerBound < upperBound
if g = lowerBound then
β := g+1
else
β := g
g := AlphaBetaWithMemory(root, β-1, β, d)
if g < β then
upperBound := g
else
lowerBound := g
return g
It would be awesome if there existed some generic C sources that show the same move generator (and it can be primitive for demonstration purposes) with a hash table scheme (and this not be overly ornate either, again, just to demo the numbers) using different search schemes, so that you can see than searching to a depth 'D' using one scheme requires the examination of more nodes than searching to the same depth with a different scheme, and so on.
Has anyone ever seen such a set of code? Or have most of these claims just been taken on faith? I know papers exist on each of the schemes mentioned here, but I'd like to "see it with my own eyes" and do my own tests on these different schemes without having to reinvent the wheel.
Maybe that's just wishful thinking on my part.
