|
|
|
|
|
by NY_Entrepreneur
5426 days ago
|
|
You may have a sufficiently tricky formulation to have a dynamic programming solution. But your states and stages are a bit strange! Much of why we use dynamic programming is that the work at stage i needs only the work at stage i + 1 (for the backward iterations), and here in some problems we can get some huge savings in computing. Also this 'framework' does well handling uncertainty. Yes, the usual way is to do find the solution from the end and then use it starting at the beginning. In the code I posted on this thread, I found the solution starting at the beginning and then used it by starting at the end and then printed out the words in the reverse order in which I found them. |
|