|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
Analysis
(worst-case)
|
|
|
|
|
Time O(n2)
|
|
|
|
|
|
|
Space O(n2)
|
|
|
|
|
| |
We
dont want just the cost
|
|
|
|
|
We also
want to know the
|
|
|
|
alignment
(the path)
|
|
|
|
|
Can
walk backward
|
|
|
|
through
the table to find it
|
|
|
|
|
Can
use M[i,j] to remember
|
|
|
choice
made for C[i,j]
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
It is
possible to bring the
|
|
|
|
space
down to O(n) with a
|
|
|
|
more
complicated algorithm
|
|
|
|
|
This
includes constructing
|
|
|
|
and
reporting the path
|
|
|
| |
Aligning
2 proteins is easy,
|
|
|
but
finding the best score
|
|
|
|
when
aligning multiple
|
|
|
|
proteins
is hard (exponential
|
|
in
number of proteins)
|
|
|
|
|
NP-complete
|
|
|
|