I've read the chapter about dynamic programming in Introduction to Algorithms and I understand it in theory, but in practice I have difficulties with the optimal sub-structure property - there are many problems where I find it difficult to determine which subproblems ensue by making a choice and how to solve this problems optimally.
For example, consider the standard knapsack problem - N elements with different sizes and values, and a M-sized knapsack. When choosing an element k to put into the bag, one is left with a knapsack of size M - size[k]. Now this has to be solved optimally...
However, I don't know how to determine the structure of the optimal solution when there're some constrains. For example, there is a limited number of each element (eg. 6 elements of one kind, 3 elements of another kind...), or the problem is to find a maximum possible value, but if there're more ways to get this optimal value, one must print the one that includes the smallest number of elements...
I hope that you could understand from this post what causes me trouble and give me some advice and/or good web sites or books where I can read more on the subject.

Thanks.