Multiple Constraints using JuMP for unbounded knapsack

Thanks for you reply @Henrique_Becker.

I used your recommended solution(a variable with a column for each knapsack problem):

After running the algorithm I get the number of each item I need to pick to solve all knapsack/subset sum problems

I want to maximize the number of times a certain item is used in all knapsack problems.

As an example, I minimized the overall number of picked items. My objective function is @objective(model,Min,sum(x)).:

The first column equals the number of each item I need to use to solve the first knapsack/subset sum problem: The algorithm tells me, that I need to use 8x the last item.

The second column equals the number of each item I need to use to solve the second knapsack/subset sum problem: The algorithm tells me, that I need to use 1x the 10th item and 2x the last item, and so on…

The first row shows me that the first item in my item list is not used a single time in all of the problems.
The third row shows me that the third item in the item list is used once(in the fifth last column) throughout all of the problems.

My goal is to maximize the number of rows, whose values are all equal to 0 → (sum(row_values)==0
The goal “minimizes” the variety of items I need to use to solve the problems.

If I would pick the smallest item, the first row would be the only row with nonzero values(trivial solution). This would be ideal but not very efficient. I am looking for a compromise between picking large items and maximizing the number of rows with 0-values.

Here you can see the trivial solution(@objective(model,Max,sum(x))):


For the first knapsack problem, I take 273x the smallest item, for the second knapsack problem I take 72x the smallest item, and so on…

I hope that this explanation was understandable