So the standard multiple choice knapsack problem allows 1 item to be chosen from each class to create an optimal knapsack. However, how would I go about modifying this algorithm to allow 0 or 1 items to be chosen? i.e. an item doesn’t need to be chosen from each class for the optimal solution, but at most 1 item can be chosen from a class. Is it just the same algorithm allowing no item to be chosen from a class?
thanks
Just modify your original problem set by adding one zero-profit/zero-weight choice to each class.