<s>
Dovetailing	B-General_Concept
,	O
in	O
algorithm	O
design	O
,	O
is	O
a	O
technique	O
that	O
interweaves	O
different	O
computations	O
,	O
performing	O
them	O
essentially	O
simultaneously	O
.	O
</s>
<s>
Algorithms	O
that	O
use	O
dovetailing	B-General_Concept
are	O
sometimes	O
referred	O
to	O
as	O
dovetailers	B-General_Concept
.	O
</s>
<s>
Consider	O
a	O
tree	B-Application
that	O
potentially	O
contains	O
a	O
path	O
of	O
infinite	O
length	O
(	O
but	O
each	O
node	O
has	O
only	O
finitely	O
many	O
children	O
)	O
:	O
if	O
a	O
depth-first	B-Algorithm
search	I-Algorithm
is	O
performed	O
in	O
this	O
environment	O
,	O
the	O
search	O
may	O
move	O
down	O
an	O
infinite	O
path	O
and	O
never	O
return	O
,	O
potentially	O
leaving	O
part	O
of	O
the	O
tree	B-Application
unexplored	O
.	O
</s>
<s>
However	O
,	O
if	O
a	O
breadth-first	B-Algorithm
search	I-Algorithm
is	O
used	O
,	O
the	O
existence	O
of	O
an	O
infinite	O
path	O
is	O
no	O
longer	O
a	O
problem	O
:	O
each	O
node	O
is	O
visited	O
in	O
a	O
branching	O
manner	O
according	O
to	O
its	O
distance	O
from	O
the	O
root	O
,	O
so	O
an	O
infinite	O
path	O
will	O
only	O
impact	O
the	O
part	O
of	O
the	O
search	O
travelling	O
down	O
that	O
path	O
.	O
</s>
<s>
We	O
can	O
regard	O
this	O
tree	B-Application
as	O
analogous	O
to	O
a	O
collection	O
of	O
programs	O
;	O
in	O
this	O
case	O
,	O
the	O
depth-first	B-Algorithm
approach	O
corresponds	O
to	O
running	O
one	O
program	O
at	O
a	O
time	O
,	O
moving	O
to	O
the	O
next	O
only	O
when	O
the	O
current	O
program	O
has	O
finished	O
running	O
.	O
</s>
<s>
The	O
breadth-first	B-Algorithm
approach	O
of	O
visiting	O
each	O
child	O
on	O
the	O
same	O
level	O
of	O
the	O
tree	B-Application
is	O
an	O
instance	O
of	O
dovetailing	B-General_Concept
,	O
where	O
a	O
single	O
step	O
is	O
performed	O
for	O
every	O
program	O
before	O
moving	O
to	O
the	O
next	O
.	O
</s>
<s>
In	O
such	O
case	O
,	O
we	O
need	O
to	O
use	O
dovetailing	B-General_Concept
in	O
case	O
one	O
of	O
the	O
computation	O
branches	O
of	O
M	O
contains	O
an	O
infinite	O
loop	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
an	O
infinite	O
number	O
of	O
programs	O
,	O
all	O
potentially	O
infinitely	O
long	O
,	O
neither	O
the	O
breadth-first	B-Algorithm
nor	O
depth-first	B-Algorithm
would	O
be	O
sufficient	O
to	O
ensure	O
progress	O
on	O
all	O
programs	O
.	O
</s>
