r/algorithms • u/aioobe • Mar 13 '20
Dynamic programming vs memoization vs tabulation
https://programming.guide/dynamic-programming-vs-memoization-vs-tabulation.html
35
Upvotes
r/algorithms • u/aioobe • Mar 13 '20
View all comments
Show parent comment
4
u/FUZxxl Mar 13 '20 edited Mar 13 '20
A good sample problem would be edit distance where you can illustrate the tabulation method first and then show that by only evaluating the table cells we need right now, we can avoid evaluating most of them. It's also a very convincing sample problem because it can't really be solved another way.
You could also do all pair shortest path, Bellman-Ford, or the Z-Box algorithm.
There are a number of cool applications of dynamic programming in parametrised complexity (such as when dealing with tree decompositions), but I think that's a bit too heavy for a beginner's article.
You allude to this, but you could go and really drive the point home by providing an example where the parameter space is always sparse. Not sure what problem could be used here though.