# Algorithm for DDP

## R := {0} High level scoring matrix 0

## compute the low level scoring matrix ijR

## Low level DP forced through (ai,bj)

## P is the optimal path, s the score

## forall (ap,bq) in P do Rpq := Rpq + ijRpq Accumulate into R

## (s,P) := DPR(A,B) High level DP using R