For the description of the algorithm, see the paper:
Xiaoquin Huang and Webb Miller:
"A Time-Efficient, Linear-Space Local Similarity Algorithm"
Advances in Applied Mathematics, vol. 12 (1991), pp. 337-357.
Note about definition of gap penalties:
There may be discrepancies between different alignment programs in the way they handle gap penalties.
SIM defines the gap penalty as q+rk (where q is the gap open penalty and r the gap extension penalty).
Consequently, when passing on the parameters to PRSS for the evaluation of the score, we call PRSS with q = q+r, r=r.
Example: If q=12 and r=4 in SIM, the first null of the gap would be penalized 16. In order to obtain the same penalization, we pass to PRSS q = 12 + 4 = 16 and r = 4.