<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
or	O
Lex-BFS	O
is	O
a	O
linear	O
time	O
algorithm	O
for	O
ordering	O
the	O
vertices	O
of	O
a	O
graph	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
different	O
from	O
a	O
breadth-first	B-Algorithm
search	I-Algorithm
,	O
but	O
it	O
produces	O
an	O
ordering	O
that	O
is	O
consistent	O
with	O
breadth-first	B-Algorithm
search	I-Algorithm
.	O
</s>
<s>
The	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
algorithm	O
is	O
based	O
on	O
the	O
idea	O
of	O
partition	B-Data_Structure
refinement	I-Data_Structure
and	O
was	O
first	O
developed	O
by	O
.	O
</s>
<s>
The	O
breadth-first	B-Algorithm
search	I-Algorithm
algorithm	O
is	O
commonly	O
defined	O
by	O
the	O
following	O
process	O
:	O
</s>
<s>
Initialize	O
a	O
queue	B-Application
of	O
graph	O
vertices	O
,	O
with	O
the	O
starting	O
vertex	O
of	O
the	O
graph	O
as	O
the	O
queue	B-Application
's	O
only	O
element	O
.	O
</s>
<s>
While	O
the	O
queue	B-Application
is	O
non-empty	O
,	O
remove	O
(	O
dequeue	O
)	O
a	O
vertex	O
from	O
the	O
queue	B-Application
,	O
and	O
add	O
to	O
the	O
queue	B-Application
(	O
enqueue	O
)	O
all	O
the	O
other	O
vertices	O
that	O
can	O
be	O
reached	O
by	O
an	O
edge	O
from	O
that	O
have	O
not	O
already	O
been	O
added	O
in	O
earlier	O
steps	O
.	O
</s>
<s>
However	O
,	O
rather	O
than	O
defining	O
the	O
vertex	O
to	O
choose	O
at	O
each	O
step	O
in	O
an	O
imperative	B-Application
way	O
as	O
the	O
one	O
produced	O
by	O
the	O
dequeue	O
operation	O
of	O
a	O
queue	B-Application
,	O
one	O
can	O
define	O
the	O
same	O
sequence	O
of	O
vertices	O
declaratively	O
by	O
the	O
properties	O
of	O
these	O
vertices	O
.	O
</s>
<s>
That	O
is	O
,	O
a	O
standard	O
breadth-first	B-Algorithm
search	I-Algorithm
is	O
just	O
the	O
result	O
of	O
repeatedly	O
applying	O
this	O
rule	O
:	O
</s>
<s>
The	O
output	O
of	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
differs	O
from	O
a	O
standard	O
breadth-first	B-Algorithm
search	I-Algorithm
in	O
having	O
a	O
consistent	O
rule	O
for	O
breaking	O
such	O
ties	O
.	O
</s>
<s>
In	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
,	O
the	O
output	O
ordering	O
is	O
the	O
order	O
that	O
would	O
be	O
produced	O
by	O
the	O
rule	O
:	O
</s>
<s>
the	O
standard	O
breadth-first	B-Algorithm
search	I-Algorithm
algorithm	O
will	O
order	O
them	O
arbitrarily	O
.	O
</s>
<s>
Instead	O
,	O
in	O
this	O
case	O
,	O
the	O
LexBFS	B-Algorithm
algorithm	O
would	O
choose	O
between	O
and	O
by	O
the	O
output	O
ordering	O
of	O
their	O
second-earliest	O
predecessors	O
.	O
</s>
<s>
Instead	O
,	O
the	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
uses	O
a	O
set	O
partitioning	O
data	O
structure	O
in	O
order	O
to	O
produce	O
the	O
same	O
ordering	O
more	O
efficiently	O
,	O
just	O
as	O
a	O
standard	O
breadth-first	B-Algorithm
search	I-Algorithm
uses	O
a	O
queue	B-Application
data	O
structure	O
to	O
produce	O
its	O
ordering	O
efficiently	O
.	O
</s>
<s>
The	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
algorithm	O
replaces	O
the	O
queue	B-Application
of	O
vertices	O
of	O
a	O
standard	O
breadth-first	B-Algorithm
search	I-Algorithm
with	O
an	O
ordered	O
sequence	O
of	O
sets	O
of	O
vertices	O
.	O
</s>
<s>
In	O
pseudocode	B-Language
,	O
the	O
algorithm	O
can	O
be	O
expressed	O
as	O
follows	O
:	O
</s>
<s>
Therefore	O
,	O
like	O
simpler	O
graph	O
search	O
algorithms	O
such	O
as	O
breadth-first	B-Algorithm
search	I-Algorithm
and	O
depth-first	B-Algorithm
search	I-Algorithm
,	O
this	O
algorithm	O
takes	O
linear	O
time	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
called	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
because	O
the	O
order	O
it	O
produces	O
is	O
an	O
ordering	O
that	O
could	O
also	O
have	O
been	O
produced	O
by	O
a	O
breadth-first	B-Algorithm
search	I-Algorithm
,	O
and	O
because	O
if	O
the	O
ordering	O
is	O
used	O
to	O
index	O
the	O
rows	O
and	O
columns	O
of	O
an	O
adjacency	B-Algorithm
matrix	I-Algorithm
of	O
a	O
graph	O
then	O
the	O
algorithm	O
sorts	B-Algorithm
the	O
rows	O
and	O
columns	O
into	O
lexicographical	O
order	O
.	O
</s>
<s>
This	O
application	O
was	O
the	O
original	O
motivation	O
that	O
led	O
to	O
develop	O
the	O
lexicographic	O
breadth	B-Algorithm
first	I-Algorithm
search	I-Algorithm
algorithm	O
.	O
</s>
<s>
An	O
induced	O
subgraph	O
of	O
a	O
chordal	O
graph	O
is	O
chordal	O
and	O
the	O
induced	O
subsequence	O
of	O
its	O
perfect	O
elimination	O
ordering	O
is	O
a	O
perfect	O
elimination	O
ordering	O
on	O
the	O
subgraph	O
,	O
so	O
chordal	O
graphs	O
are	O
perfectly	O
orderable	O
,	O
and	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
can	O
be	O
used	O
to	O
optimally	O
color	O
them	O
.	O
</s>
<s>
The	O
same	O
property	O
is	O
true	O
for	O
a	O
larger	O
class	O
of	O
graphs	O
,	O
the	O
distance-hereditary	O
graphs	O
:	O
distance-hereditary	O
graphs	O
are	O
perfectly	O
orderable	O
,	O
with	O
a	O
perfect	O
ordering	O
given	O
by	O
the	O
reverse	O
of	O
a	O
lexicographic	O
ordering	O
,	O
so	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
can	O
be	O
used	O
in	O
conjunction	O
with	O
greedy	O
coloring	O
algorithms	O
to	O
color	O
them	O
optimally	O
in	O
linear	O
time	O
.	O
</s>
<s>
describe	O
an	O
extension	O
of	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
that	O
breaks	O
any	O
additional	O
ties	O
using	O
the	O
complement	O
graph	O
of	O
the	O
input	O
graph	O
.	O
</s>
<s>
describe	O
additional	O
applications	O
of	O
lexicographic	B-Algorithm
breadth-first	I-Algorithm
search	I-Algorithm
including	O
the	O
recognition	O
of	O
comparability	O
graphs	O
and	O
interval	O
graphs	O
.	O
</s>
<s>
An	O
enumeration	O
of	O
the	O
vertices	O
of	O
a	O
graph	O
is	O
said	O
to	O
be	O
a	O
LexBFS	B-Algorithm
ordering	O
if	O
it	O
is	O
the	O
possible	O
output	O
of	O
the	O
application	O
of	O
LexBFS	B-Algorithm
to	O
this	O
graph	O
.	O
</s>
<s>
The	O
enumeration	O
is	O
a	O
LexBFS	B-Algorithm
ordering	O
(	O
with	O
source	O
)	O
if	O
,	O
for	O
all	O
with	O
,	O
there	O
exists	O
such	O
that	O
.	O
</s>
