<s>
A*	O
(	O
pronounced	O
"	O
A-star	B-Protocol
"	O
)	O
is	O
a	O
graph	B-Algorithm
traversal	I-Algorithm
and	O
path	B-Algorithm
search	I-Algorithm
algorithm	O
,	O
which	O
is	O
used	O
in	O
many	O
fields	O
of	O
computer	O
science	O
due	O
to	O
its	O
completeness	O
,	O
optimality	O
,	O
and	O
optimal	O
efficiency	O
.	O
</s>
<s>
Thus	O
,	O
in	O
practical	O
travel-routing	B-Application
systems	I-Application
,	O
it	O
is	O
generally	O
outperformed	O
by	O
algorithms	O
that	O
can	O
pre-process	O
the	O
graph	B-Application
to	O
attain	O
better	O
performance	O
,	O
as	O
well	O
as	O
memory-bounded	O
approaches	O
;	O
however	O
,	O
A*	O
is	O
still	O
the	O
best	O
solution	O
in	O
many	O
cases	O
.	O
</s>
<s>
It	O
can	O
be	O
seen	O
as	O
an	O
extension	O
of	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
A*	O
achieves	O
better	O
performance	O
by	O
using	O
heuristics	B-Algorithm
to	O
guide	O
its	O
search	O
.	O
</s>
<s>
Compared	O
to	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
the	O
A*	B-Protocol
algorithm	I-Protocol
only	O
finds	O
the	O
shortest	O
path	O
from	O
a	O
specified	O
source	O
to	O
a	O
specified	O
goal	O
,	O
and	O
not	O
the	O
shortest-path	O
tree	B-Application
from	O
a	O
specified	O
source	O
to	O
all	O
possible	O
goals	O
.	O
</s>
<s>
This	O
is	O
a	O
necessary	O
trade-off	O
for	O
using	O
a	O
specific-goal-directed	O
heuristic	B-Algorithm
.	O
</s>
<s>
For	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
since	O
the	O
entire	O
shortest-path	O
tree	B-Application
is	O
generated	O
,	O
every	O
node	O
is	O
a	O
goal	O
,	O
and	O
there	O
can	O
be	O
no	O
specific-goal-directed	O
heuristic	B-Algorithm
.	O
</s>
<s>
Nils	O
Nilsson	O
originally	O
proposed	O
using	O
the	O
Graph	B-Application
Traverser	O
algorithm	O
for	O
Shakey	O
's	O
path	O
planning	O
.	O
</s>
<s>
Graph	B-Application
Traverser	O
is	O
guided	O
by	O
a	O
heuristic	B-Algorithm
function	I-Algorithm
,	O
the	O
estimated	O
distance	O
from	O
node	O
to	O
the	O
goal	O
node	O
:	O
it	O
entirely	O
ignores	O
,	O
the	O
distance	O
from	O
the	O
start	O
node	O
to	O
.	O
</s>
<s>
Peter	O
Hart	O
invented	O
the	O
concepts	O
we	O
now	O
call	O
admissibility	B-General_Concept
and	O
consistency	O
of	O
heuristic	B-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
The	O
original	O
1968	O
A*	O
paper	O
contained	O
a	O
theorem	O
stating	O
that	O
no	O
A*	O
-like	O
algorithm	O
could	O
expand	O
fewer	O
nodes	O
than	O
A*	O
if	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
is	O
consistent	O
and	O
A*'s	O
tie-breaking	O
rule	O
is	O
suitably	O
chosen	O
.	O
</s>
<s>
A	O
″correction″	O
was	O
published	O
a	O
few	O
years	O
later	O
claiming	O
that	O
consistency	O
was	O
not	O
required	O
,	O
but	O
this	O
was	O
shown	O
to	O
be	O
false	O
in	O
Dechter	O
and	O
Pearl	O
's	O
definitive	O
study	O
of	O
A*'s	O
optimality	O
(	O
now	O
called	O
optimal	O
efficiency	O
)	O
,	O
which	O
gave	O
an	O
example	O
of	O
A*	O
with	O
a	O
heuristic	B-Algorithm
that	O
was	O
admissible	B-General_Concept
but	O
not	O
consistent	O
expanding	O
arbitrarily	O
more	O
nodes	O
than	O
an	O
alternative	O
A*	O
-like	O
algorithm	O
.	O
</s>
<s>
A*	O
is	O
an	O
informed	O
search	B-Application
algorithm	I-Application
,	O
or	O
a	O
best-first	B-Algorithm
search	I-Algorithm
,	O
meaning	O
that	O
it	O
is	O
formulated	O
in	O
terms	O
of	O
weighted	O
graphs	O
:	O
starting	O
from	O
a	O
specific	O
starting	O
node	O
of	O
a	O
graph	B-Application
,	O
it	O
aims	O
to	O
find	O
a	O
path	O
to	O
the	O
given	O
goal	O
node	O
having	O
the	O
smallest	O
cost	O
(	O
least	O
distance	O
travelled	O
,	O
shortest	O
time	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
It	O
does	O
this	O
by	O
maintaining	O
a	O
tree	B-Application
of	O
paths	O
originating	O
at	O
the	O
start	O
node	O
and	O
extending	O
those	O
paths	O
one	O
edge	O
at	O
a	O
time	O
until	O
its	O
termination	O
criterion	O
is	O
satisfied	O
.	O
</s>
<s>
where	O
is	O
the	O
next	O
node	O
on	O
the	O
path	O
,	O
is	O
the	O
cost	O
of	O
the	O
path	O
from	O
the	O
start	O
node	O
to	O
,	O
and	O
is	O
a	O
heuristic	B-Algorithm
function	I-Algorithm
that	O
estimates	O
the	O
cost	O
of	O
the	O
cheapest	O
path	O
from	O
to	O
the	O
goal	O
.	O
</s>
<s>
The	O
heuristic	B-Algorithm
function	I-Algorithm
is	O
problem-specific	O
.	O
</s>
<s>
If	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
is	O
admissible	B-General_Concept
–	O
meaning	O
that	O
it	O
never	O
overestimates	O
the	O
actual	O
cost	O
to	O
get	O
to	O
the	O
goal	O
–	O
A*	O
is	O
guaranteed	O
to	O
return	O
a	O
least-cost	O
path	O
from	O
start	O
to	O
goal	O
.	O
</s>
<s>
Typical	O
implementations	O
of	O
A*	O
use	O
a	O
priority	B-Application
queue	I-Application
to	O
perform	O
the	O
repeated	O
selection	O
of	O
minimum	O
(	O
estimated	O
)	O
cost	O
nodes	O
to	O
expand	O
.	O
</s>
<s>
This	O
priority	B-Application
queue	I-Application
is	O
known	O
as	O
the	O
open	O
set	O
,	O
fringe	B-Algorithm
or	O
frontier	O
.	O
</s>
<s>
The	O
algorithm	O
continues	O
until	O
a	O
removed	O
node	O
(	O
thus	O
the	O
node	O
with	O
the	O
lowest	O
value	O
out	O
of	O
all	O
fringe	B-Algorithm
nodes	O
)	O
is	O
a	O
goal	O
node	O
.	O
</s>
<s>
The	O
value	O
of	O
that	O
goal	O
is	O
then	O
also	O
the	O
cost	O
of	O
the	O
shortest	O
path	O
,	O
since	O
at	O
the	O
goal	O
is	O
zero	O
in	O
an	O
admissible	B-General_Concept
heuristic	I-General_Concept
.	O
</s>
<s>
If	O
the	O
heuristic	B-Algorithm
satisfies	O
the	O
additional	O
condition	O
for	O
every	O
edge	O
of	O
the	O
graph	B-Application
(	O
where	O
denotes	O
the	O
length	O
of	O
that	O
edge	O
)	O
,	O
then	O
is	O
called	O
monotone	O
,	O
or	O
consistent	O
.	O
</s>
<s>
With	O
a	O
consistent	O
heuristic	B-Algorithm
,	O
A*	O
is	O
guaranteed	O
to	O
find	O
an	O
optimal	O
path	O
without	O
processing	O
any	O
node	O
more	O
than	O
once	O
and	O
A*	O
is	O
equivalent	O
to	O
running	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
with	O
the	O
reduced	B-Algorithm
cost	I-Algorithm
{{	O
math|	O
d(x, y )	O
d(x, y )	O
+	O
h(y )	O
−	O
h(x )	O
}}	O
.	O
</s>
<s>
The	O
following	O
pseudocode	B-Language
describes	O
the	O
algorithm	O
:	O
</s>
<s>
//	O
h	O
is	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
//	O
This	O
is	O
usually	O
implemented	O
as	O
a	O
min-heap	O
or	O
priority	B-Application
queue	I-Application
rather	O
than	O
a	O
hash-set	O
.	O
</s>
<s>
return	O
failureRemark	O
:	O
In	O
this	O
pseudocode	B-Language
,	O
if	O
a	O
node	O
is	O
reached	O
by	O
one	O
path	O
,	O
removed	O
from	O
openSet	O
,	O
and	O
subsequently	O
reached	O
by	O
a	O
cheaper	O
path	O
,	O
it	O
will	O
be	O
added	O
to	O
openSet	O
again	O
.	O
</s>
<s>
This	O
is	O
essential	O
to	O
guarantee	O
that	O
the	O
path	O
returned	O
is	O
optimal	O
if	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
is	O
admissible	B-General_Concept
but	O
not	O
consistent	O
.	O
</s>
<s>
If	O
the	O
heuristic	B-Algorithm
is	O
consistent	O
,	O
when	O
a	O
node	O
is	O
removed	O
from	O
openSet	O
the	O
path	O
to	O
it	O
is	O
guaranteed	O
to	O
be	O
optimal	O
so	O
the	O
test	O
‘	O
tentative_gScore	O
<	O
gScore[neighbor]’	O
will	O
always	O
fail	O
if	O
the	O
node	O
is	O
reached	O
again	O
.	O
</s>
<s>
thumb|Illustration	O
of	O
A*	B-Protocol
search	I-Protocol
for	O
finding	O
path	O
from	O
a	O
start	O
node	O
to	O
a	O
goal	O
node	O
in	O
a	O
robot	O
motion	O
planning	O
problem	O
.	O
</s>
<s>
An	O
example	O
of	O
an	O
A*	B-Protocol
algorithm	I-Protocol
in	O
action	O
where	O
nodes	O
are	O
cities	O
connected	O
with	O
roads	O
and	O
h(x )	O
is	O
the	O
straight-line	O
distance	O
to	O
the	O
target	O
point	O
:	O
</s>
<s>
The	O
A*	B-Protocol
algorithm	I-Protocol
also	O
has	O
real-world	O
applications	O
.	O
</s>
<s>
The	O
A*	B-Protocol
algorithm	I-Protocol
finding	O
a	O
path	O
of	O
railroads	O
between	O
Washington	O
,	O
D.C.	O
and	O
Los	O
Angeles	O
.	O
</s>
<s>
The	O
first	O
detail	O
to	O
note	O
is	O
that	O
the	O
way	O
the	O
priority	B-Application
queue	I-Application
handles	O
ties	O
can	O
have	O
a	O
significant	O
effect	O
on	O
performance	O
in	O
some	O
situations	O
.	O
</s>
<s>
If	O
ties	O
are	O
broken	O
so	O
the	O
queue	O
behaves	O
in	O
a	O
LIFO	B-Application
manner	O
,	O
A*	O
will	O
behave	O
like	O
depth-first	B-Algorithm
search	I-Algorithm
among	O
equal	O
cost	O
paths	O
(	O
avoiding	O
exploring	O
more	O
than	O
one	O
equally	O
optimal	O
solution	O
)	O
.	O
</s>
<s>
If	O
these	O
references	O
are	O
being	O
kept	O
then	O
it	O
can	O
be	O
important	O
that	O
the	O
same	O
node	O
does	O
n't	O
appear	O
in	O
the	O
priority	B-Application
queue	I-Application
more	O
than	O
once	O
(	O
each	O
entry	O
corresponding	O
to	O
a	O
different	O
path	O
to	O
the	O
node	O
,	O
and	O
each	O
with	O
a	O
different	O
cost	O
)	O
.	O
</s>
<s>
A	O
standard	O
approach	O
here	O
is	O
to	O
check	O
if	O
a	O
node	O
about	O
to	O
be	O
added	O
already	O
appears	O
in	O
the	O
priority	B-Application
queue	I-Application
.	O
</s>
<s>
A	O
standard	O
binary	B-Application
heap	I-Application
based	O
priority	B-Application
queue	I-Application
does	O
not	O
directly	O
support	O
the	O
operation	O
of	O
searching	O
for	O
one	O
of	O
its	O
elements	O
,	O
but	O
it	O
can	O
be	O
augmented	O
with	O
a	O
hash	B-Algorithm
table	I-Algorithm
that	O
maps	O
elements	O
to	O
their	O
position	O
in	O
the	O
heap	O
,	O
allowing	O
this	O
decrease-priority	O
operation	O
to	O
be	O
performed	O
in	O
logarithmic	O
time	O
.	O
</s>
<s>
Alternatively	O
,	O
a	O
Fibonacci	B-Application
heap	I-Application
can	O
perform	O
the	O
same	O
decrease-priority	O
operations	O
in	O
constant	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
as	O
another	O
example	O
of	O
a	O
uniform-cost	O
search	B-Application
algorithm	I-Application
,	O
can	O
be	O
viewed	O
as	O
a	O
special	O
case	O
of	O
A*	O
where	O
for	O
all	O
x	O
...	O
General	O
depth-first	B-Algorithm
search	I-Algorithm
can	O
be	O
implemented	O
using	O
A*	O
by	O
considering	O
that	O
there	O
is	O
a	O
global	O
counter	O
C	O
initialized	O
with	O
a	O
very	O
large	O
value	O
.	O
</s>
<s>
Both	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
and	O
depth-first	B-Algorithm
search	I-Algorithm
can	O
be	O
implemented	O
more	O
efficiently	O
without	O
including	O
an	O
value	O
at	O
each	O
node	O
.	O
</s>
<s>
On	O
infinite	O
graphs	O
with	O
a	O
finite	O
branching	B-Data_Structure
factor	I-Data_Structure
and	O
edge	O
costs	O
that	O
are	O
bounded	O
away	O
from	O
zero	O
(	O
for	O
some	O
fixed	O
)	O
,	O
A*	O
is	O
guaranteed	O
to	O
terminate	O
only	O
if	O
there	O
exists	O
a	O
solution	O
.	O
</s>
<s>
A	O
search	B-Application
algorithm	I-Application
is	O
said	O
to	O
be	O
admissible	B-General_Concept
if	O
it	O
is	O
guaranteed	O
to	O
return	O
an	O
optimal	O
solution	O
.	O
</s>
<s>
If	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
used	O
by	O
A*	O
is	O
admissible	B-General_Concept
,	O
then	O
A*	O
is	O
admissible	B-General_Concept
.	O
</s>
<s>
When	O
the	O
heuristic	B-Algorithm
is	O
admissible	B-General_Concept
,	O
those	O
estimates	O
are	O
optimistic	O
(	O
not	O
quite	O
—	O
see	O
the	O
next	O
paragraph	O
)	O
,	O
so	O
A*	O
can	O
safely	O
ignore	O
those	O
nodes	O
because	O
they	O
cannot	O
possibly	O
lead	O
to	O
a	O
cheaper	O
solution	O
than	O
the	O
one	O
it	O
already	O
has	O
.	O
</s>
<s>
The	O
actual	O
proof	O
is	O
a	O
bit	O
more	O
involved	O
because	O
the	O
values	O
of	O
open	O
nodes	O
are	O
not	O
guaranteed	O
to	O
be	O
optimistic	O
even	O
if	O
the	O
heuristic	B-Algorithm
is	O
admissible	B-General_Concept
.	O
</s>
<s>
Algorithm	O
A	B-Application
is	I-Application
optimally	O
efficient	O
with	O
respect	O
to	O
a	O
set	O
of	O
alternative	O
algorithms	O
Alts	O
on	O
a	O
set	O
of	O
problems	O
P	O
if	O
for	O
every	O
problem	O
P	O
in	O
P	O
and	O
every	O
algorithm	O
A′	O
in	O
Alts	O
,	O
the	O
set	O
of	O
nodes	O
expanded	O
by	O
A	O
in	O
solving	O
P	O
is	O
a	O
subset	O
(	O
possibly	O
equal	O
)	O
of	O
the	O
set	O
of	O
nodes	O
expanded	O
by	O
A′	O
in	O
solving	O
P	O
.	O
The	O
definitive	O
study	O
of	O
the	O
optimal	O
efficiency	O
of	O
A*	O
is	O
due	O
to	O
Rina	O
Dechter	O
and	O
Judea	O
Pearl	O
.	O
</s>
<s>
They	O
considered	O
a	O
variety	O
of	O
definitions	O
of	O
Alts	O
and	O
P'''	O
in	O
combination	O
with	O
A*'s	O
heuristic	B-Algorithm
being	O
merely	O
admissible	B-General_Concept
or	O
being	O
both	O
consistent	O
and	O
admissible	B-General_Concept
.	O
</s>
<s>
The	O
most	O
interesting	O
positive	O
result	O
they	O
proved	O
is	O
that	O
A*	O
,	O
with	O
a	O
consistent	O
heuristic	B-Algorithm
,	O
is	O
optimally	O
efficient	O
with	O
respect	O
to	O
all	O
admissible	B-General_Concept
A*	O
-like	O
search	B-Application
algorithms	I-Application
on	O
all	O
″	O
non-pathological	O
″	O
search	O
problems	O
.	O
</s>
<s>
This	O
result	O
does	O
not	O
hold	O
if	O
A*'s	O
heuristic	B-Algorithm
is	O
admissible	B-General_Concept
but	O
not	O
consistent	O
.	O
</s>
<s>
In	O
that	O
case	O
,	O
Dechter	O
and	O
Pearl	O
showed	O
there	O
exist	O
admissible	B-General_Concept
A*	O
-like	O
algorithms	O
that	O
can	O
expand	O
arbitrarily	O
fewer	O
nodes	O
than	O
A*	O
on	O
some	O
non-pathological	O
problems	O
.	O
</s>
<s>
When	O
the	O
heuristic	B-Algorithm
being	O
used	O
is	O
admissible	B-General_Concept
but	O
not	O
consistent	O
,	O
it	O
is	O
possible	O
for	O
a	O
node	O
to	O
be	O
expanded	O
by	O
A*	O
many	O
times	O
,	O
an	O
exponential	O
number	O
of	O
times	O
in	O
the	O
worst	O
case	O
.	O
</s>
<s>
In	O
such	O
circumstances	O
,	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
could	O
outperform	O
A*	O
by	O
a	O
large	O
margin	O
.	O
</s>
<s>
However	O
,	O
more	O
recent	O
research	O
found	O
that	O
this	O
pathological	O
case	O
only	O
occurs	O
in	O
certain	O
contrived	O
situations	O
where	O
the	O
edge	O
weight	O
of	O
the	O
search	O
graph	B-Application
is	O
exponential	O
in	O
the	O
size	O
of	O
the	O
graph	B-Application
and	O
that	O
certain	O
inconsistent	O
(	O
but	O
admissible	B-General_Concept
)	O
heuristics	B-Algorithm
can	O
lead	O
to	O
a	O
reduced	O
number	O
of	O
node	O
expansions	O
in	O
A*	B-Protocol
searches	I-Protocol
.	O
</s>
<s>
thumb|A*	O
search	O
that	O
uses	O
a	O
heuristic	B-Algorithm
that	O
is	O
5.0	O
(	O
=	O
ε	O
)	O
times	O
a	O
consistent	O
heuristic	B-Algorithm
,	O
and	O
obtains	O
a	O
suboptimal	O
path	O
.	O
</s>
<s>
While	O
the	O
admissibility	B-General_Concept
criterion	O
guarantees	O
an	O
optimal	O
solution	O
path	O
,	O
it	O
also	O
means	O
that	O
A*	O
must	O
examine	O
all	O
equally	O
meritorious	O
paths	O
to	O
find	O
the	O
optimal	O
path	O
.	O
</s>
<s>
To	O
compute	O
approximate	O
shortest	O
paths	O
,	O
it	O
is	O
possible	O
to	O
speed	O
up	O
the	O
search	O
at	O
the	O
expense	O
of	O
optimality	O
by	O
relaxing	O
the	O
admissibility	B-General_Concept
criterion	O
.	O
</s>
<s>
This	O
new	O
guarantee	O
is	O
referred	O
to	O
as	O
ε-admissible	O
.	O
</s>
<s>
There	O
are	O
a	O
number	O
of	O
ε-admissible	O
algorithms	O
:	O
</s>
<s>
If	O
ha(n )	O
is	O
an	O
admissible	B-General_Concept
heuristic	I-General_Concept
function	I-Algorithm
,	O
in	O
the	O
weighted	O
version	O
of	O
the	O
A*	B-Protocol
search	I-Protocol
one	O
uses	O
,	O
as	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
,	O
and	O
perform	O
the	O
A*	B-Protocol
search	I-Protocol
as	O
usual	O
(	O
which	O
eventually	O
happens	O
faster	O
than	O
using	O
ha	O
since	O
fewer	O
nodes	O
are	O
expanded	O
)	O
.	O
</s>
<s>
The	O
path	O
hence	O
found	O
by	O
the	O
search	B-Application
algorithm	I-Application
can	O
have	O
a	O
cost	O
of	O
at	O
most	O
ε	O
times	O
that	O
of	O
the	O
least	O
cost	O
path	O
in	O
the	O
graph	B-Application
.	O
</s>
<s>
Sampled	O
Dynamic	O
Weighting	O
uses	O
sampling	O
of	O
nodes	O
to	O
better	O
estimate	O
and	O
debias	O
the	O
heuristic	B-Algorithm
error	O
.	O
</s>
<s>
uses	O
two	O
heuristic	B-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
AlphA*	O
attempts	O
to	O
promote	O
depth-first	B-Algorithm
exploitation	O
by	O
preferring	O
recently	O
expanded	O
nodes	O
.	O
</s>
<s>
The	O
time	O
complexity	O
of	O
A*	O
depends	O
on	O
the	O
heuristic	B-Algorithm
.	O
</s>
<s>
In	O
the	O
worst	O
case	O
of	O
an	O
unbounded	O
search	O
space	O
,	O
the	O
number	O
of	O
nodes	O
expanded	O
is	O
exponential	O
in	O
the	O
depth	O
of	O
the	O
solution	O
(	O
the	O
shortest	O
path	O
)	O
:	O
,	O
where	O
is	O
the	O
branching	B-Data_Structure
factor	I-Data_Structure
(	O
the	O
average	O
number	O
of	O
successors	O
per	O
state	O
)	O
.	O
</s>
<s>
The	O
heuristic	B-Algorithm
function	I-Algorithm
has	O
a	O
major	O
effect	O
on	O
the	O
practical	O
performance	O
of	O
A*	B-Protocol
search	I-Protocol
,	O
since	O
a	O
good	O
heuristic	B-Algorithm
allows	O
A*	O
to	O
prune	O
away	O
many	O
of	O
the	O
nodes	O
that	O
an	O
uninformed	O
search	O
would	O
expand	O
.	O
</s>
<s>
Good	O
heuristics	B-Algorithm
are	O
those	O
with	O
low	O
effective	O
branching	B-Data_Structure
factor	I-Data_Structure
(	O
the	O
optimal	O
being	O
)	O
.	O
</s>
<s>
The	O
time	O
complexity	O
is	O
polynomial	O
when	O
the	O
search	O
space	O
is	O
a	O
tree	B-Application
,	O
there	O
is	O
a	O
single	O
goal	O
state	O
,	O
and	O
the	O
heuristic	B-Algorithm
function	I-Algorithm
h''	O
meets	O
the	O
following	O
condition	O
:	O
</s>
<s>
where	O
is	O
the	O
optimal	O
heuristic	B-Algorithm
,	O
the	O
exact	O
cost	O
to	O
get	O
from	O
to	O
the	O
goal	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
error	O
of	O
will	O
not	O
grow	O
faster	O
than	O
the	O
logarithm	O
of	O
the	O
"	O
perfect	O
heuristic	B-Algorithm
"	O
that	O
returns	O
the	O
true	O
distance	O
from	O
to	O
the	O
goal	O
.	O
</s>
<s>
The	O
space	O
complexity	O
of	O
A*	O
is	O
roughly	O
the	O
same	O
as	O
that	O
of	O
all	O
other	O
graph	B-Algorithm
search	I-Algorithm
algorithms	O
,	O
as	O
it	O
keeps	O
all	O
generated	O
nodes	O
in	O
memory	O
.	O
</s>
<s>
In	O
practice	O
,	O
this	O
turns	O
out	O
to	O
be	O
the	O
biggest	O
drawback	O
of	O
the	O
A*	B-Protocol
search	I-Protocol
,	O
leading	O
to	O
the	O
development	O
of	O
memory-bounded	O
heuristic	B-Algorithm
searches	O
,	O
such	O
as	O
Iterative	B-Protocol
deepening	I-Protocol
A*	I-Protocol
,	O
memory-bounded	O
A*	O
,	O
and	O
SMA*	B-Protocol
.	O
</s>
<s>
A*	O
is	O
often	O
used	O
for	O
the	O
common	O
pathfinding	B-Algorithm
problem	O
in	O
applications	O
such	O
as	O
video	O
games	O
,	O
but	O
was	O
originally	O
designed	O
as	O
a	O
general	O
graph	B-Algorithm
traversal	I-Algorithm
algorithm	O
.	O
</s>
<s>
It	O
finds	O
applications	O
in	O
diverse	O
problems	O
,	O
including	O
the	O
problem	O
of	O
parsing	B-Language
using	O
stochastic	B-General_Concept
grammars	I-General_Concept
in	O
NLP	B-Language
.	O
</s>
<s>
What	O
sets	O
A*	O
apart	O
from	O
a	O
greedy	B-Algorithm
best-first	B-Algorithm
search	I-Algorithm
algorithm	O
is	O
that	O
it	O
takes	O
the	O
cost/distance	O
already	O
traveled	O
,	O
,	O
into	O
account	O
.	O
</s>
<s>
Some	O
common	O
variants	O
of	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
viewed	O
as	O
a	O
special	O
case	O
of	O
A*	O
where	O
the	O
heuristic	B-Algorithm
for	O
all	O
nodes	O
;	O
in	O
turn	O
,	O
both	O
Dijkstra	O
and	O
A*	O
are	O
special	O
cases	O
of	O
dynamic	B-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
A*	O
itself	O
is	O
a	O
special	O
case	O
of	O
a	O
generalization	O
of	O
branch	B-Algorithm
and	I-Algorithm
bound	I-Algorithm
.	O
</s>
<s>
A*	O
can	O
also	O
be	O
adapted	O
to	O
a	O
bidirectional	B-Algorithm
search	I-Algorithm
algorithm	O
.	O
</s>
