<s>
The	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
is	O
an	O
algorithm	O
used	O
in	O
bioinformatics	O
to	O
align	B-Algorithm
protein	O
or	O
nucleotide	O
sequences	O
.	O
</s>
<s>
It	O
was	O
one	O
of	O
the	O
first	O
applications	O
of	O
dynamic	B-Algorithm
programming	I-Algorithm
to	O
compare	O
biological	O
sequences	O
.	O
</s>
<s>
The	O
algorithm	O
was	O
developed	O
by	O
Saul	B-Algorithm
B	I-Algorithm
.	I-Algorithm
Needleman	I-Algorithm
and	O
Christian	B-Algorithm
D	I-Algorithm
.	I-Algorithm
Wunsch	I-Algorithm
and	O
published	O
in	O
1970	O
.	O
</s>
<s>
The	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
is	O
still	O
widely	O
used	O
for	O
optimal	O
global	O
alignment	O
,	O
particularly	O
when	O
the	O
quality	O
of	O
the	O
global	O
alignment	O
is	O
of	O
the	O
utmost	O
importance	O
.	O
</s>
<s>
A	O
diagonal	O
arrow	O
represents	O
a	O
match	O
or	O
mismatch	O
,	O
so	O
the	O
letter	O
of	O
the	O
column	O
and	O
the	O
letter	O
of	O
the	O
row	O
of	O
the	O
origin	O
cell	O
will	O
align	B-Algorithm
.	O
</s>
<s>
Vertical	O
arrows	O
will	O
align	B-Algorithm
a	O
gap	O
("-"	O
)	O
to	O
the	O
letter	O
of	O
the	O
row	O
(	O
the	O
"	O
side	O
"	O
sequence	O
)	O
,	O
horizontal	O
arrows	O
will	O
align	B-Algorithm
a	O
gap	O
to	O
the	O
letter	O
of	O
the	O
column	O
(	O
the	O
"	O
top	O
"	O
sequence	O
)	O
.	O
</s>
<s>
In	O
order	O
to	O
represent	O
all	O
the	O
possible	O
combinations	O
of	O
letters	O
and	O
their	O
resulting	O
scores	O
a	O
similarity	O
matrix	B-Architecture
is	O
used	O
.	O
</s>
<s>
The	O
similarity	O
matrix	B-Architecture
for	O
the	O
most	O
basic	O
system	O
is	O
represented	O
as	O
:	O
</s>
<s>
If	O
implementing	O
the	O
T-T	O
=	O
4	O
rule	O
from	O
above	O
the	O
following	O
similarity	O
matrix	B-Architecture
is	O
produced	O
:	O
</s>
<s>
Having	O
weighted	O
scoring	O
matrices	O
is	O
particularly	O
important	O
in	O
protein	B-Algorithm
sequence	I-Algorithm
alignment	I-Algorithm
due	O
to	O
the	O
varying	O
frequency	O
of	O
the	O
different	O
amino	O
acids	O
.	O
</s>
<s>
When	O
aligning	B-Algorithm
sequences	I-Algorithm
there	O
are	O
often	O
gaps	O
(	O
i.e.	O
</s>
<s>
which	O
has	O
multiple	O
equal	O
alignments	O
,	O
some	O
with	O
multiple	O
small	O
alignments	O
will	O
now	O
align	B-Algorithm
as	O
:	O
</s>
<s>
Scores	O
for	O
aligned	O
characters	O
are	O
specified	O
by	O
a	O
similarity	O
matrix	B-Architecture
.	O
</s>
<s>
To	O
find	O
the	O
alignment	O
with	O
the	O
highest	O
score	O
,	O
a	O
two-dimensional	O
array	B-Data_Structure
(	O
or	O
matrix	B-Architecture
)	O
F	O
is	O
allocated	O
.	O
</s>
<s>
Thus	O
,	O
if	O
aligning	B-Algorithm
sequences	I-Algorithm
of	O
sizes	O
n	O
and	O
m	O
,	O
the	O
amount	O
of	O
memory	O
used	O
is	O
in	O
.	O
</s>
<s>
Hirschberg	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
only	O
holds	O
a	O
subset	O
of	O
the	O
array	B-Data_Structure
in	O
memory	O
and	O
uses	O
space	O
,	O
but	O
is	O
otherwise	O
similar	O
to	O
Needleman-Wunsch	B-Algorithm
(	O
and	O
still	O
requires	O
time	O
)	O
.	O
</s>
<s>
The	O
pseudo-code	O
for	O
the	O
algorithm	O
to	O
compute	O
the	O
F	O
matrix	B-Architecture
therefore	O
looks	O
like	O
this	O
:	O
</s>
<s>
Once	O
the	O
F	O
matrix	B-Architecture
is	O
computed	O
,	O
the	O
entry	O
gives	O
the	O
maximum	O
score	O
among	O
all	O
possible	O
alignments	O
.	O
</s>
<s>
The	O
corresponding	O
dynamic	B-Algorithm
programming	I-Algorithm
algorithm	O
takes	O
cubic	O
time	O
.	O
</s>
<s>
A	O
better	O
dynamic	B-Algorithm
programming	I-Algorithm
algorithm	O
with	O
quadratic	O
running	O
time	O
for	O
the	O
same	O
problem	O
(	O
no	O
gap	O
penalty	O
)	O
was	O
introduced	O
later	O
by	O
David	O
Sankoff	O
in	O
1972	O
.	O
</s>
<s>
(	O
"	B-Algorithm
time	I-Algorithm
warping	I-Algorithm
"	I-Algorithm
)	O
,	O
and	O
by	O
Robert	O
A	O
.	O
Wagner	O
and	O
Michael	O
J	O
.	O
Fischer	O
in	O
1974	O
for	O
string	O
matching	O
.	O
</s>
<s>
The	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
is	O
still	O
widely	O
used	O
for	O
optimal	O
global	O
alignment	O
,	O
particularly	O
when	O
the	O
quality	O
of	O
the	O
global	O
alignment	O
is	O
of	O
the	O
utmost	O
importance	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
2013	O
,	O
a	O
Fast	O
Optimal	O
Global	O
Sequence	B-Algorithm
Alignment	I-Algorithm
Algorithm	O
(	O
FOGSAA	O
)	O
,	O
suggested	O
alignment	O
of	O
nucleotide/protein	O
sequences	O
faster	O
than	O
other	O
optimal	O
global	O
alignment	O
methods	O
,	O
including	O
the	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
paper	O
claims	O
that	O
when	O
compared	O
to	O
the	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
,	O
FOGSAA	O
achieves	O
a	O
time	O
gain	O
of	O
70	O
–	O
90%	O
for	O
highly	O
similar	O
nucleotide	O
sequences	O
(	O
with	O
>	O
80%	O
similarity	O
)	O
,	O
and	O
54	O
–	O
70%	O
for	O
sequences	O
having	O
30	O
–	O
80%	O
similarity	O
.	O
</s>
<s>
When	O
images	O
have	O
been	O
rectified	O
,	O
an	O
analogy	O
can	O
be	O
drawn	O
between	O
aligning	O
nucleotide	O
and	O
protein	O
sequences	O
and	O
matching	O
pixels	B-Algorithm
belonging	O
to	O
scan	B-Algorithm
lines	I-Algorithm
,	O
since	O
both	O
tasks	O
aim	O
at	O
establishing	O
optimal	O
correspondence	O
between	O
two	O
strings	O
of	O
characters	O
.	O
</s>
<s>
by	O
camera	B-Algorithm
resectioning	I-Algorithm
or	O
calibration	O
,	O
it	O
is	O
sometimes	O
impossible	O
or	O
impractical	O
since	O
the	O
computational	O
cost	O
of	O
accurate	O
rectification	O
models	O
prohibit	O
their	O
usage	O
in	O
real-time	B-General_Concept
applications	I-General_Concept
.	O
</s>
<s>
By	O
extending	O
the	O
Needleman	B-Algorithm
–	I-Algorithm
Wunsch	I-Algorithm
algorithm	I-Algorithm
,	O
a	O
line	O
in	O
the	O
'	O
left	O
 '	O
image	O
can	O
be	O
associated	O
to	O
a	O
curve	O
in	O
the	O
'	O
right	O
 '	O
image	O
by	O
finding	O
the	O
alignment	O
with	O
the	O
highest	O
score	O
in	O
a	O
three-dimensional	O
array	B-Data_Structure
(	O
or	O
matrix	B-Architecture
)	O
.	O
</s>
<s>
Experiments	O
demonstrated	O
that	O
such	O
extension	O
allows	O
dense	O
pixel	B-Algorithm
matching	O
between	O
unrectified	O
or	O
distorted	O
images	O
.	O
</s>
