The problem is the longest common subsequence and the Longest common substring problem is sometimes important for string analysis [for example, gene sequence analysis]. And they can be effectively resolved using dynamic programming.
Note you can parallelize this algorithm : you do it in iterations along the diagonal [left, down, right, up] - so the total number of iterations is 2n-1 . And in each diagonal: each cell does not depend on other cells in this diagonal - therefore, here you can parallelize, each stream will have a block of cells in this diagonal.
Please note that data synchronization using this method is also minimal: each stream should only transmit data to its "neighboring streams", so this can be done even if the memory is not used.
In addition, both problems, as mentioned by @larsmans, can use linear space - at each point you only need to βrememberβ the current + 2 last diagonals, and not the entire matrix.
Another common problem solved by dynamic programming is polynomial interpolation . Interpolation can be efficiently performed using Newton Interpolation , which must first calculate the divided differences - which is built using dynamic programming.
source share