<s>
Best-first	B-Algorithm
search	I-Algorithm
is	O
a	O
class	O
of	O
search	B-Application
algorithms	I-Application
,	O
which	O
explores	O
a	O
graph	B-Application
by	O
expanding	O
the	O
most	O
promising	O
node	O
chosen	O
according	O
to	O
a	O
specified	O
rule	O
.	O
</s>
<s>
Judea	O
Pearl	O
described	O
the	O
best-first	B-Algorithm
search	I-Algorithm
as	O
estimating	O
the	O
promise	O
of	O
node	O
n	O
by	O
a	O
"	O
heuristic	B-Algorithm
evaluation	O
function	O
which	O
,	O
in	O
general	O
,	O
may	O
depend	O
on	O
the	O
description	O
of	O
n	O
,	O
the	O
description	O
of	O
the	O
goal	O
,	O
the	O
information	O
gathered	O
by	O
the	O
search	O
up	O
to	O
that	O
point	O
,	O
and	O
most	O
importantly	O
,	O
on	O
any	O
extra	O
knowledge	O
about	O
the	O
problem	O
domain.	O
"	O
</s>
<s>
Some	O
authors	O
have	O
used	O
"	O
best-first	B-Algorithm
search	I-Algorithm
"	O
to	O
refer	O
specifically	O
to	O
a	O
search	O
with	O
a	O
heuristic	B-Algorithm
that	O
attempts	O
to	O
predict	O
how	O
close	O
the	O
end	O
of	O
a	O
path	O
is	O
to	O
a	O
solution	O
(	O
or	O
,	O
goal	O
)	O
,	O
so	O
that	O
paths	O
which	O
are	O
judged	O
to	O
be	O
closer	O
to	O
a	O
solution	O
(	O
or	O
,	O
goal	O
)	O
are	O
extended	O
first	O
.	O
</s>
<s>
This	O
specific	O
type	O
of	O
search	O
is	O
called	O
greedy	B-Algorithm
best-first	B-Algorithm
search	I-Algorithm
or	O
pure	B-Algorithm
heuristic	I-Algorithm
search	I-Algorithm
.	O
</s>
<s>
Efficient	O
selection	O
of	O
the	O
current	O
best	O
candidate	O
for	O
extension	O
is	O
typically	O
implemented	O
using	O
a	O
priority	B-Application
queue	I-Application
.	O
</s>
<s>
The	O
A*	B-Protocol
search	I-Protocol
algorithm	I-Protocol
is	O
an	O
example	O
of	O
a	O
best-first	B-Algorithm
search	I-Algorithm
algorithm	O
,	O
as	O
is	O
B*	B-Protocol
.	O
</s>
<s>
Best-first	O
algorithms	O
are	O
often	O
used	O
for	O
path	O
finding	O
in	O
combinatorial	B-Algorithm
search	I-Algorithm
.	O
</s>
<s>
Neither	O
A*	O
nor	O
B*	B-Protocol
is	O
a	O
greedy	B-Algorithm
best-first	B-Algorithm
search	I-Algorithm
,	O
as	O
they	O
incorporate	O
the	O
distance	O
from	O
the	O
start	O
in	O
addition	O
to	O
estimated	O
distances	O
to	O
the	O
goal	O
.	O
</s>
<s>
Using	O
a	O
greedy	B-Algorithm
algorithm	I-Algorithm
,	O
expand	O
the	O
first	O
successor	O
of	O
the	O
parent	O
.	O
</s>
<s>
If	O
the	O
successor	O
's	O
heuristic	B-Algorithm
is	O
better	O
than	O
its	O
parent	O
,	O
the	O
successor	O
is	O
set	O
at	O
the	O
front	O
of	O
the	O
queue	O
(	O
with	O
the	O
parent	O
reinserted	O
directly	O
behind	O
it	O
)	O
,	O
and	O
the	O
loop	O
restarts	O
.	O
</s>
<s>
Else	O
,	O
the	O
successor	O
is	O
inserted	O
into	O
the	O
queue	O
(	O
in	O
a	O
location	O
determined	O
by	O
its	O
heuristic	B-Algorithm
value	O
)	O
.	O
</s>
<s>
Below	O
is	O
a	O
pseudocode	B-Language
example	O
of	O
this	O
algorithm	O
,	O
where	O
queue	O
represents	O
a	O
priority	B-Application
queue	I-Application
which	O
orders	O
nodes	O
based	O
on	O
their	O
heuristic	B-Algorithm
distances	O
from	O
the	O
goal	O
.	O
</s>
