<s>
In	O
graph	O
theory	O
,	O
the	O
strongly	O
connected	O
components	O
of	O
a	O
directed	O
graph	O
may	O
be	O
found	O
using	O
an	O
algorithm	O
that	O
uses	O
depth-first	B-Algorithm
search	I-Algorithm
in	O
combination	O
with	O
two	O
stacks	B-Application
,	O
one	O
to	O
keep	O
track	O
of	O
the	O
vertices	O
in	O
the	O
current	O
component	O
and	O
the	O
second	O
to	O
keep	O
track	O
of	O
the	O
current	O
search	O
path	O
.	O
</s>
<s>
The	O
algorithm	O
performs	O
a	O
depth-first	B-Algorithm
search	I-Algorithm
of	O
the	O
given	O
graph	O
G	O
,	O
maintaining	O
as	O
it	O
does	O
two	O
stacks	B-Application
S	O
and	O
P	O
(	O
in	O
addition	O
to	O
the	O
normal	O
call	O
stack	B-Application
for	O
a	O
recursive	O
function	O
)	O
.	O
</s>
<s>
Stack	B-Application
S	O
contains	O
all	O
the	O
vertices	O
that	O
have	O
not	O
yet	O
been	O
assigned	O
to	O
a	O
strongly	O
connected	O
component	O
,	O
in	O
the	O
order	O
in	O
which	O
the	O
depth-first	B-Algorithm
search	I-Algorithm
reaches	O
the	O
vertices	O
.	O
</s>
<s>
Stack	B-Application
P	O
contains	O
vertices	O
that	O
have	O
not	O
yet	O
been	O
determined	O
to	O
belong	O
to	O
different	O
strongly	O
connected	O
components	O
from	O
each	O
other	O
.	O
</s>
<s>
When	O
the	O
depth-first	B-Algorithm
search	I-Algorithm
reaches	O
a	O
vertex	O
v	O
,	O
the	O
algorithm	O
performs	O
the	O
following	O
steps	O
:	O
</s>
<s>
Like	O
this	O
algorithm	O
,	O
Tarjan	B-Algorithm
's	I-Algorithm
strongly	I-Algorithm
connected	I-Algorithm
components	I-Algorithm
algorithm	I-Algorithm
also	O
uses	O
depth	B-Algorithm
first	I-Algorithm
search	I-Algorithm
together	O
with	O
a	O
stack	B-Application
to	O
keep	O
track	O
of	O
vertices	O
that	O
have	O
not	O
yet	O
been	O
assigned	O
to	O
a	O
component	O
,	O
and	O
moves	O
these	O
vertices	O
into	O
a	O
new	O
component	O
when	O
it	O
finishes	O
expanding	O
the	O
final	O
vertex	O
of	O
its	O
component	O
.	O
</s>
<s>
However	O
,	O
in	O
place	O
of	O
the	O
stack	B-Application
P	O
,	O
Tarjan	O
's	O
algorithm	O
uses	O
a	O
vertex-indexed	O
array	O
of	O
preorder	O
numbers	O
,	O
assigned	O
in	O
the	O
order	O
that	O
vertices	O
are	O
first	O
visited	O
in	O
the	O
depth-first	B-Algorithm
search	I-Algorithm
.	O
</s>
