Double Sequence DP
The subproblem is defined as how two strings/sequences compare to each other at (i, j) where i is the index for sequence A and j is the index for sequence B. We need to build a |A|x|B| grid (lattice) to represent all the states for (i, j). The topological ordering tends to be easy in this case (up to 3 incoming edges for each node).
Last updated