I'm studying for an exam and we were given a set of practice problems. Here's one I'm struggling with and I hope somebody can help shed some light on the right approach to this problem:
Here's my initial go at the problem:
Decision Version: To find the optimal solution using the decision version, I would try using various K's until I got a yes answer. Let's say the optimized solution is 7, I would try :
k=1, no
k=2, no
k=3, no
k=4, no
k=5, no
k=6, no
k=7, yes.
So now that we know that the optimal solution is 7 bins, we solve the decision version by sorting the items by sizes from largest to smallest, and filling up the bins filling largest to smallest, and looping back over the bins until they are no more elements in the set.
If we have an optimal solution and we want to solve the decision version, I would take the number of bins returned by the optimal solution, and run it on the decision version to see if it returns yes.
I've never really seen a problem like this before so I'm not sure how the proper format is supposed to be.
Any help would be greatly appreciated!