<s>
In	O
bioinformatics	O
,	O
neighbor	B-Algorithm
joining	I-Algorithm
is	O
a	O
bottom-up	O
(	O
agglomerative	O
)	O
clustering	B-Algorithm
method	O
for	O
the	O
creation	O
of	O
phylogenetic	O
trees	O
,	O
created	O
by	O
Naruya	O
Saitou	O
and	O
Masatoshi	O
Nei	O
in	O
1987	O
.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
takes	O
a	O
distance	O
matrix	O
,	O
which	O
specifies	O
the	O
distance	O
between	O
each	O
pair	O
of	O
taxa	O
,	O
as	O
input	O
.	O
</s>
<s>
The	O
algorithm	O
starts	O
with	O
a	O
completely	O
unresolved	O
tree	O
,	O
whose	O
topology	O
corresponds	O
to	O
that	O
of	O
a	O
star	B-Architecture
network	I-Architecture
,	O
and	O
iterates	O
over	O
the	O
following	O
steps	O
,	O
until	O
the	O
tree	O
is	O
completely	O
resolved	O
,	O
and	O
all	O
branch	O
lengths	O
are	O
known	O
:	O
</s>
<s>
The	O
branches	O
joining	O
and	O
and	O
and	O
,	O
and	O
their	O
lengths	O
,	O
and	O
are	O
part	O
of	O
the	O
tree	O
which	O
is	O
gradually	O
being	O
created	O
;	O
they	O
neither	O
affect	O
nor	O
are	O
affected	O
by	O
later	O
neighbor-joining	B-Algorithm
steps	O
.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
on	O
a	O
set	O
of	O
taxa	O
requires	O
iterations	O
.	O
</s>
<s>
The	O
joining	O
of	O
the	O
elements	O
and	O
the	O
branch	O
length	O
calculation	O
help	O
drawing	O
the	O
neighbor	B-Algorithm
joining	I-Algorithm
tree	O
as	O
shown	O
in	O
the	O
figure	O
.	O
</s>
<s>
The	O
neighbor	B-Algorithm
joining	I-Algorithm
tree	O
is	O
now	O
complete	O
,	O
as	O
shown	O
in	O
the	O
figure	O
.	O
</s>
<s>
Nonetheless	O
it	O
is	O
important	O
to	O
note	O
that	O
,	O
given	O
an	O
additive	O
distance	O
matrix	O
as	O
input	O
,	O
neighbor	B-Algorithm
joining	I-Algorithm
is	O
guaranteed	O
to	O
find	O
the	O
tree	O
whose	O
distances	O
between	O
taxa	O
agree	O
with	O
it	O
.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
may	O
be	O
viewed	O
as	O
a	O
greedy	B-Algorithm
heuristic	I-Algorithm
for	O
the	O
Balanced	O
Minimum	O
Evolution	O
(	O
BME	O
)	O
criterion	O
.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
at	O
each	O
step	O
greedily	O
joins	O
that	O
pair	O
of	O
taxa	O
which	O
will	O
give	O
the	O
greatest	O
decrease	O
in	O
the	O
estimated	O
tree	O
length	O
.	O
</s>
<s>
This	O
makes	O
it	O
practical	O
for	O
analyzing	O
large	O
data	O
sets	O
(	O
hundreds	O
or	O
thousands	O
of	O
taxa	O
)	O
and	O
for	O
bootstrapping	B-Application
,	O
for	O
which	O
purposes	O
other	O
means	O
of	O
analysis	O
(	O
e.g.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
has	O
the	O
property	O
that	O
if	O
the	O
input	O
distance	O
matrix	O
is	O
correct	O
,	O
then	O
the	O
output	O
tree	O
will	O
be	O
correct	O
.	O
</s>
<s>
In	O
practice	O
the	O
distance	O
matrix	O
rarely	O
satisfies	O
this	O
condition	O
,	O
but	O
neighbor	B-Algorithm
joining	I-Algorithm
often	O
constructs	O
the	O
correct	O
tree	O
topology	O
anyway	O
.	O
</s>
<s>
The	O
correctness	O
of	O
neighbor	B-Algorithm
joining	I-Algorithm
for	O
nearly	O
additive	O
distance	O
matrices	O
implies	O
that	O
it	O
is	O
statistically	O
consistent	O
under	O
many	O
models	O
of	O
evolution	O
;	O
given	O
data	O
of	O
sufficient	O
length	O
,	O
neighbor	B-Algorithm
joining	I-Algorithm
will	O
reconstruct	O
the	O
true	O
tree	O
with	O
high	O
probability	O
.	O
</s>
<s>
Compared	O
with	O
UPGMA	B-Algorithm
and	O
WPGMA	B-Algorithm
,	O
neighbor	B-Algorithm
joining	I-Algorithm
has	O
the	O
advantage	O
that	O
it	O
does	O
not	O
assume	O
all	O
lineages	O
evolve	O
at	O
the	O
same	O
rate	O
(	O
molecular	O
clock	O
hypothesis	O
)	O
.	O
</s>
<s>
Nevertheless	O
,	O
neighbor	B-Algorithm
joining	I-Algorithm
has	O
been	O
largely	O
superseded	O
by	O
phylogenetic	O
methods	O
that	O
do	O
not	O
rely	O
on	O
distance	O
measures	O
and	O
offer	O
superior	O
accuracy	O
under	O
most	O
conditions	O
.	O
</s>
<s>
Neighbor	B-Algorithm
joining	I-Algorithm
has	O
the	O
undesirable	O
feature	O
that	O
it	O
often	O
assigns	O
negative	O
lengths	O
to	O
some	O
of	O
the	O
branches	O
.	O
</s>
<s>
There	O
are	O
many	O
programs	O
available	O
implementing	O
neighbor	B-Algorithm
joining	I-Algorithm
.	O
</s>
<s>
and	O
are	O
variants	O
of	O
neighbor	B-Algorithm
joining	I-Algorithm
which	O
improve	O
on	O
its	O
accuracy	O
by	O
making	O
use	O
of	O
the	O
fact	O
that	O
the	O
shorter	O
distances	O
in	O
the	O
distance	O
matrix	O
are	O
generally	O
better	O
known	O
than	O
the	O
longer	O
distances	O
.	O
</s>
