Next: Global Alignment in linear
Up: Global Alignment
Previous: Tabular computation of optimal
The Traceback
One way to traceback the alignments is to establish pointers in the cells of the table
as the values are computed.
The direction of the pointers in cell (i,j) indicates which cell
contributed the most to V(i,j).
Figure 2.2:
Backtracing the alignment
|
Theorem 2.9
The time complexity of the algorithm is O(nm).
Space complexity is O(n+m), if only V(S,T) is required and
O(mn) for the reconstruction of the alignment.
Proof:
- Time complexity - When computing the value for a specific cell (i,j) only cells
(i-1 , j-1),
(i , j-1) and (i-1 , j) are examined, along with two characters Si and Tj.
Hence, to fill in one cell takes a constant number of cell examinations and
comparisons.
There are
cells in the table. So the time complexity is also O(nm).
- Space complexity - Using the algorithm, computing the value of cell (i,j) involves one cell in row j (i-1,j) and two cells in the previous row
((i-1,j-1) and (i,j-1)). Since the computation is performed one row at a time,
when computing the values in row k only row k-1 has to be stored, using, O(n+m) space.
In order to reconstruct the alignment from the recursion, pointers
must be set for allowing the back-tracing, therfore, the space complexity is O(nm).
Next: Global Alignment in linear
Up: Global Alignment
Previous: Tabular computation of optimal
Itshack Pe`er
1999-01-03