<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
Aho	B-Algorithm
–	I-Algorithm
Corasick	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
string-searching	B-Algorithm
algorithm	I-Algorithm
invented	O
by	O
Alfred	O
V	O
.	O
Aho	O
and	O
Margaret	B-Algorithm
J	I-Algorithm
.	I-Algorithm
Corasick	I-Algorithm
in	O
1975	O
.	O
</s>
<s>
Informally	O
,	O
the	O
algorithm	O
constructs	O
a	O
finite-state	B-Architecture
machine	I-Architecture
that	O
resembles	O
a	O
trie	B-General_Concept
with	O
additional	O
links	O
between	O
the	O
various	O
internal	O
nodes	O
.	O
</s>
<s>
a	O
search	O
for	O
in	O
a	O
trie	B-General_Concept
that	O
does	O
not	O
contain	O
,	O
but	O
contains	O
,	O
and	O
thus	O
would	O
fail	O
at	O
the	O
node	O
prefixed	O
by	O
)	O
,	O
to	O
other	O
branches	O
of	O
the	O
trie	B-General_Concept
that	O
share	O
a	O
common	O
prefix	O
(	O
e.g.	O
,	O
in	O
the	O
previous	O
case	O
,	O
a	O
branch	O
for	O
might	O
be	O
the	O
best	O
lateral	O
transition	O
)	O
.	O
</s>
<s>
The	O
Aho	O
–	O
Corasick	O
string-matching	O
algorithm	O
formed	O
the	O
basis	O
of	O
the	O
original	O
Unix	B-Application
command	I-Application
fgrep	O
.	O
</s>
<s>
The	O
graph	O
below	O
is	O
the	O
Aho	O
–	O
Corasick	O
data	O
structure	O
constructed	O
from	O
the	O
specified	O
dictionary	O
,	O
with	O
each	O
row	O
in	O
the	O
table	O
representing	O
a	O
node	O
in	O
the	O
trie	B-General_Concept
,	O
with	O
the	O
column	O
path	O
indicating	O
the	O
(	O
unique	O
)	O
sequence	O
of	O
characters	O
from	O
the	O
root	O
to	O
the	O
node	O
.	O
</s>
<s>
The	O
blue	O
arcs	O
can	O
be	O
computed	O
in	O
linear	O
time	O
by	O
performing	O
a	O
breadth-first	B-Algorithm
search	I-Algorithm
[	O
potential	O
suffix	O
node	O
will	O
always	O
be	O
at	O
lower	O
level ]	O
starting	O
from	O
the	O
root	O
.	O
</s>
<s>
The	O
original	O
Aho-Corasick	B-Algorithm
algorithm	I-Algorithm
assumes	O
that	O
the	O
set	O
of	O
search	B-Algorithm
strings	I-Algorithm
is	O
fixed	O
.	O
</s>
<s>
It	O
does	O
not	O
directly	O
apply	O
to	O
applications	O
in	O
which	O
new	O
search	B-Algorithm
strings	I-Algorithm
are	O
added	O
during	O
application	O
of	O
the	O
algorithm	O
.	O
</s>
<s>
Bertrand	O
Meyer	O
introduced	O
an	O
incremental	O
version	O
of	O
the	O
algorithm	O
in	O
which	O
the	O
search	B-Algorithm
string	I-Algorithm
set	O
can	O
be	O
incrementally	O
extended	O
during	O
the	O
search	O
,	O
retaining	O
the	O
algorithmic	O
complexity	O
of	O
the	O
original	O
.	O
</s>
