<s>
Alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
pruning	I-Algorithm
is	O
a	O
search	B-Application
algorithm	I-Application
that	O
seeks	O
to	O
decrease	O
the	O
number	O
of	O
nodes	O
that	O
are	O
evaluated	O
by	O
the	O
minimax	B-Algorithm
algorithm	I-Algorithm
in	O
its	O
search	O
tree	O
.	O
</s>
<s>
It	O
is	O
an	O
adversarial	O
search	B-Application
algorithm	I-Application
used	O
commonly	O
for	O
machine	O
playing	O
of	O
two-player	O
games	O
(	O
Tic-tac-toe	O
,	O
Chess	B-Application
,	O
Connect	O
4	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
When	O
applied	O
to	O
a	O
standard	O
minimax	B-Algorithm
tree	O
,	O
it	O
returns	O
the	O
same	O
move	O
as	O
minimax	B-Algorithm
would	O
,	O
but	O
prunes	O
away	O
branches	O
that	O
cannot	O
possibly	O
influence	O
the	O
final	O
decision	O
.	O
</s>
<s>
A	O
game	O
tree	O
can	O
represent	O
many	O
two-player	O
zero-sum	O
games	O
,	O
such	O
as	O
chess	B-Application
,	O
checkers	O
,	O
and	O
reversi	O
.	O
</s>
<s>
Initially	O
,	O
alpha	O
is	O
negative	O
infinity	B-Application
and	O
beta	O
is	O
positive	O
infinity	B-Application
,	O
i.e.	O
</s>
<s>
To	O
illustrate	O
this	O
with	O
a	O
real-life	O
example	O
,	O
suppose	O
somebody	O
is	O
playing	O
chess	B-Application
,	O
and	O
it	O
is	O
their	O
turn	O
.	O
</s>
<s>
The	O
maximum	O
score	O
that	O
the	O
opponent	O
could	O
force	O
after	O
move	O
"	O
B	O
"	O
is	O
negative	O
infinity	B-Application
:	O
a	O
loss	O
for	O
the	O
player	O
.	O
</s>
<s>
The	O
benefit	O
of	O
alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
pruning	I-Algorithm
lies	O
in	O
the	O
fact	O
that	O
branches	O
of	O
the	O
search	O
tree	O
can	O
be	O
eliminated	O
.	O
</s>
<s>
This	O
way	O
,	O
the	O
search	O
time	O
can	O
be	O
limited	O
to	O
the	O
'	O
more	O
promising	O
 '	O
subtree	B-Application
,	O
and	O
a	O
deeper	O
search	O
can	O
be	O
performed	O
in	O
the	O
same	O
time	O
.	O
</s>
<s>
Like	O
its	O
predecessor	O
,	O
it	O
belongs	O
to	O
the	O
branch	B-Algorithm
and	I-Algorithm
bound	I-Algorithm
class	O
of	O
algorithms	O
.	O
</s>
<s>
The	O
optimization	O
reduces	O
the	O
effective	O
depth	O
to	O
slightly	O
more	O
than	O
half	O
that	O
of	O
simple	O
minimax	B-Algorithm
if	O
the	O
nodes	O
are	O
evaluated	O
in	O
an	O
optimal	O
or	O
near	O
optimal	O
order	O
(	O
best	O
choice	O
for	O
side	O
on	O
move	O
ordered	O
first	O
at	O
each	O
node	O
)	O
.	O
</s>
<s>
With	O
an	O
(	O
average	O
or	O
constant	O
)	O
branching	B-Data_Structure
factor	I-Data_Structure
of	O
b	O
,	O
and	O
a	O
search	O
depth	O
of	O
d	O
plies	O
,	O
the	O
maximum	O
number	O
of	O
leaf	O
node	O
positions	O
evaluated	O
(	O
when	O
the	O
move	O
ordering	O
is	O
pessimal	O
)	O
is	O
O( b×b×	O
...	O
×b	O
)	O
=	O
O(bd )	O
–	O
the	O
same	O
as	O
a	O
simple	O
minimax	B-Algorithm
search	O
.	O
</s>
<s>
In	O
the	O
latter	O
case	O
,	O
where	O
the	O
ply	O
of	O
a	O
search	O
is	O
even	O
,	O
the	O
effective	O
branching	B-Data_Structure
factor	I-Data_Structure
is	O
reduced	O
to	O
its	O
square	O
root	O
,	O
or	O
,	O
equivalently	O
,	O
the	O
search	O
can	O
go	O
twice	O
as	O
deep	O
with	O
the	O
same	O
amount	O
of	O
computation	O
.	O
</s>
<s>
A	O
chess	B-Application
program	O
that	O
searches	O
four	O
plies	O
with	O
an	O
average	O
of	O
36	O
branches	O
per	O
node	O
evaluates	O
more	O
than	O
one	O
million	O
terminal	O
nodes	O
.	O
</s>
<s>
Normally	O
during	O
alpha	O
–	O
beta	O
,	O
the	O
subtrees	B-Application
are	O
temporarily	O
dominated	O
by	O
either	O
a	O
first	O
player	O
advantage	O
(	O
when	O
many	O
first	O
player	O
moves	O
are	O
good	O
,	O
and	O
at	O
each	O
search	O
depth	O
the	O
first	O
move	O
checked	O
by	O
the	O
first	O
player	O
is	O
adequate	O
,	O
but	O
all	O
second	O
player	O
responses	O
are	O
required	O
to	O
try	O
to	O
find	O
a	O
refutation	O
)	O
,	O
or	O
vice	O
versa	O
.	O
</s>
<s>
An	O
improved	O
sort	O
at	O
any	O
depth	O
will	O
exponentially	O
reduce	O
the	O
total	O
number	O
of	O
positions	O
searched	O
,	O
but	O
sorting	O
all	O
positions	O
at	O
depths	O
near	O
the	O
root	B-Application
node	I-Application
is	O
relatively	O
cheap	O
as	O
there	O
are	O
so	O
few	O
of	O
them	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
move	O
ordering	O
is	O
often	O
determined	O
by	O
the	O
results	O
of	O
earlier	O
,	O
smaller	O
searches	O
,	O
such	O
as	O
through	O
iterative	B-Algorithm
deepening	I-Algorithm
.	O
</s>
<s>
The	O
pseudo-code	O
for	O
depth	O
limited	O
minimax	B-Algorithm
with	O
alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
pruning	I-Algorithm
is	O
as	O
follows	O
:	O
</s>
<s>
Implementations	O
of	O
alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
pruning	I-Algorithm
can	O
often	O
be	O
delineated	O
by	O
whether	O
they	O
are	O
"	O
fail-soft	O
,	O
"	O
or	O
"	O
fail-hard	O
"	O
.	O
</s>
<s>
Further	O
improvement	O
can	O
be	O
achieved	O
without	O
sacrificing	O
accuracy	O
by	O
using	O
ordering	O
heuristics	B-Algorithm
to	O
search	O
earlier	O
parts	O
of	O
the	O
tree	O
that	O
are	O
likely	O
to	O
force	O
alpha	O
–	O
beta	O
cutoffs	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
chess	B-Application
,	O
moves	O
that	O
capture	O
pieces	O
may	O
be	O
examined	O
before	O
moves	O
that	O
do	O
not	O
,	O
and	O
moves	O
that	O
have	O
scored	O
highly	O
in	O
earlier	B-Algorithm
passes	I-Algorithm
through	O
the	O
game-tree	O
analysis	O
may	O
be	O
evaluated	O
before	O
others	O
.	O
</s>
<s>
Another	O
common	O
,	O
and	O
very	O
cheap	O
,	O
heuristic	B-Algorithm
is	O
the	O
killer	B-Algorithm
heuristic	I-Algorithm
,	O
where	O
the	O
last	O
move	O
that	O
caused	O
a	O
beta-cutoff	O
at	O
the	O
same	O
tree	O
level	O
in	O
the	O
tree	O
search	O
is	O
always	O
examined	O
first	O
.	O
</s>
<s>
Alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
search	I-Algorithm
can	O
be	O
made	O
even	O
faster	O
by	O
considering	O
only	O
a	O
narrow	O
search	O
window	O
(	O
generally	O
determined	O
by	O
guesswork	O
based	O
on	O
experience	O
)	O
.	O
</s>
<s>
Fishburn	O
also	O
suggested	O
a	O
combination	O
of	O
the	O
killer	B-Algorithm
heuristic	I-Algorithm
and	O
zero-window	O
search	O
under	O
the	O
name	O
Lalphabeta	O
(	O
"	O
last	O
move	O
with	O
minimal	O
window	O
alpha	B-Algorithm
–	I-Algorithm
beta	I-Algorithm
search	I-Algorithm
"	O
)	O
.	O
</s>
<s>
Since	O
the	O
minimax	B-Algorithm
algorithm	I-Algorithm
and	O
its	O
variants	O
are	O
inherently	O
depth-first	B-Algorithm
,	O
a	O
strategy	O
such	O
as	O
iterative	B-Algorithm
deepening	I-Algorithm
is	O
usually	O
used	O
in	O
conjunction	O
with	O
alpha	O
–	O
beta	O
so	O
that	O
a	O
reasonably	O
good	O
move	O
can	O
be	O
returned	O
even	O
if	O
the	O
algorithm	O
is	O
interrupted	O
before	O
it	O
has	O
finished	O
execution	O
.	O
</s>
<s>
Another	O
advantage	O
of	O
using	O
iterative	B-Algorithm
deepening	I-Algorithm
is	O
that	O
searches	O
at	O
shallower	O
depths	O
give	O
move-ordering	O
hints	O
,	O
as	O
well	O
as	O
shallow	O
alpha	O
and	O
beta	O
estimates	O
,	O
that	O
both	O
can	O
help	O
produce	O
cutoffs	O
for	O
higher	O
depth	O
searches	O
much	O
earlier	O
than	O
would	O
otherwise	O
be	O
possible	O
.	O
</s>
<s>
Algorithms	O
like	O
SSS*	B-Algorithm
,	O
on	O
the	O
other	O
hand	O
,	O
use	O
the	O
best-first	B-Algorithm
strategy	O
.	O
</s>
