next up previous
Next: The Algorithm: Up: Pairwise Alignment Previous: The Traceback

   
Global Alignment in linear space

The backtracing algorithm requires the entire matrix to be saved in memory. The space complexity consequently increase to O(nm). Hirschberg [4] developed a more practical space-reduction method for solving dynamic programming problems that reduces the required space from O(nm) to O(m) (for m<n).

 
\begin{ntt}{\rm {\bf$V^r(i,j)$ } will denote an optimal alignment
value of last ...
...cters in string $S$\space against last $j$ characters in string $T$ .} \end{ntt}

Lemma 2.10  

\begin{displaymath}V(n,m) = \max_{0\leq k\leq m}\{V({{n}\over{2}},k)+V^r({{n}\over{2}},m-k)\}\end{displaymath}

Proof:[3] (chapter 12) For any fixed position k' in T, there is an alignment of S and T consisting of an alignment of $S_1 \ldots
S_{{n}\over{2}}$ and $T_1 \ldots T_{k^{'}}$ followed by a disjoint alignment of $S_{{{n}\over{2}}+1} \ldots S_n$ and $T_{k^{'}+1}
\ldots T_m$. By definition of V and Vr, the best alignment of the first type has value $V({{n}\over{2}},k^{'})$ and the best alignment of the second type has value $V^r({{n}\over{2}},m-k^{'})$, so the combined alignment has value $V({{n}\over{2}},k^{'})+V^r({{n}\over{2}},m-k^{'})\leq V(n,m)$. since this argument holds for any k', it follows that $\max_k[V({{n}\over{2}},k)+V^r({{n}\over{2}},m-k)]\leq V(n,m)$.

Conversely, for an optimal alignment of S and T, let k'be the right-most position in T that is aligned with a character at or before position ${{n}\over{2}}$ in S. Then the optimal alignment of S and T consists of an alignment of $S_1 \ldots
S_{{n}\over{2}}$ and $T_1 \ldots T_{k^{'}}$ followed by an alignment of $S_{{{n}\over{2}}+1} \ldots T_n$ and $T_{k^{'}+1}
\ldots T_m$. Let the value of the first alignment be denoted p and the value of the second alignment be denoted q. Then p must be equal to $V({{n}\over{2}},k^{'})$, for if $p<V({{n}\over{2}},k^{'})$ we could replace the alignment of $S_1 \ldots
S_{{n}\over{2}}$ and $T_1 \ldots T_{k^{'}}$ with the alignment of $S_1 \ldots
S_{{n}\over{2}}$ and $T_1 \ldots T_{k^{'}}$ that allows value $V({{n}\over{2}},k^{'})$. That would create an alignment of S and T whose value is larger than the claimed optimal. Hence, p = $V({{n}\over{2}},k^{'})$. By similar reasoning, $q=V^r({{n}\over{2}},m-k^{'})$. So $V(n,m)=V({{n}\over{2}},k^{'})+V^r({{n}\over{2}},m-k^{'})\leq
\max_k[V({{n}\over{2}},k)+V^r({{n}\over{2}},m-k)]$. Having shown both sides of the inequality, we conclude that $V(n,m)=max_k[V({{n}\over{2}},k) + V^r({{n}\over{2}},m-k)]$.



 
next up previous
Next: The Algorithm: Up: Pairwise Alignment Previous: The Traceback
Itshack Pe`er
1999-01-03