Hi there,<p>I am looking for resources to study dynamic programming, not only theoretical ones, but very practical and example-oriented ones are good as well, actually much better than pure theory.<p>My focus is to be able to solve algorithmic challenges in contexts such as: competitive programming and coding interviews.<p>Cheers and thanks for recommending stuff.<p>----------<p>EDIT: typos.
Watch Erik Demaine's dynamic programming lectures in this playlist: <a href="https://www.youtube.com/playlist?list=PLSX2U_ZE4Huk19DPn34oZlygPbsig380X" rel="nofollow">https://www.youtube.com/playlist?list=PLSX2U_ZE4Huk19DPn34oZ...</a><p>I learned a lot from them, he gives a methodology and some rules of thumbs for approaching DP problems, which I found very useful.
CLRS "introduction to algorithms" has a bit on it. Some quite versatile graph algorithms e.g. A* are dynamic programming. From memory some project Euler problems are pretty approachable with dynamic programming, but these are abstract without any applied context.<p>I had a bit of fun years ago writing search algorithms to find profitable trade routes in Eve online, from memory that was largely based on some strange variation of A*, perhaps you can find some entertaining application like that.<p>Worth also checking out out some operations research / combinatorial optimisation problems. E.g. one of the simplest problems to tackle with dynamic programming is knapsack.<p>If you learn linear programming there's also some combinatorial optimisation problems that can be tackled by integrating an LP solver with a custom dynamic programming algorithm. This can be used in a technique called "column generation" where in this context "column" in jargon for a decision variable. You start with an initial set of decision variables and do an LP solve, then get the dynamic programming algorithm to search to find a new variable that can produce a better solution (incorporating information about the prices of constraints from the LP dual solution). Then you plug that new variable (if there is one) as an additional decision variable in the optimisation problem and solve the resulting LP again, getting an improved solution. Then repeat with the new dual prices, iterate until you hit a fixed point. Is applicable for certain problems that can be modelled as LPs where there are very large numbers of decision variables (e.g. > millions) but only a sparse subset are non-zero in a good/optimal solution. I think the classic application of this approach is the "cutting stock" problem.
I found lectures on DP by University of Virginia Prof Abhi Shelat to have best explanation of DP<p><a href="https://www.youtube.com/playlist?list=PL5ro5yPzj5qDlSYHx9Luzp8p2kVqtdGfD" rel="nofollow">https://www.youtube.com/playlist?list=PL5ro5yPzj5qDlSYHx9Luz...</a><p><a href="http://www.cs.virginia.edu/~shelat/16s-4102/" rel="nofollow">http://www.cs.virginia.edu/~shelat/16s-4102/</a><p>If you need to understand specific DP problems that are common in competitive programming and interviews, then you should check out Tushar's channel at Youtube<p><a href="https://www.youtube.com/playlist?list=PLrmLmBdmIlpsHaNTPP_jHHDx_os9ItYXr" rel="nofollow">https://www.youtube.com/playlist?list=PLrmLmBdmIlpsHaNTPP_jH...</a>
I second the recommendation of CLRS. Another good source of applied examples is the bioinformatics literature. It may be a little tough if you don't have much background in genetics, but a lot of the basic algorithms in computational biology are essentially dynamic programming algorithms that analyze strings over the alphabets of DNA or amino acids. One of my favorite books, which is a classic and (I think) is pretty approachable for the non-biologist, is Biological Sequence Analysis by Durbin, Eddy, Krogh, and Mitchison.
Practice on online judge helps! You can go to <a href="http://codeforces.com/problemset/tags/dp" rel="nofollow">http://codeforces.com/problemset/tags/dp</a> for instance. There are people that could help you also. Just solve and ask if you don't get it. Hope that helps.
Found these useful.<p><a href="https://people.cs.clemson.edu/~bcdean/dp_practice/" rel="nofollow">https://people.cs.clemson.edu/~bcdean/dp_practice/</a>
The Needleman/Wunsch algorithm for DNA sequence alignment is a great practical example for learning dynamic programming: <a href="https://www.youtube.com/watch?v=vqxc2EfPWdk" rel="nofollow">https://www.youtube.com/watch?v=vqxc2EfPWdk</a>