This variation of the knapsack problem requires a minimum weight. The goal is to minimize the cost while achieving at least the minimum weight.
For example, we have 6 items with weights {1, 1, 1, 5, 13, 3} and costs {1, 1, 1, 5, 10, 12}.
Assume a minimum weight of 15.
The optimal solution is items {1, 2, 5} for a total weight of 15 and cost 12.
How should I go about implementing this algorithm as efficiently as possible? Greedy choices don't work, so should I modify the original dynamic programming solution to fit this problem? If so, how?
If it matters, I'm planning to write this in Java.