Knapsack for table

77 Views Asked by At

I have a problem that I can't solve. There is this table.

I have to optimaly allocate 1 million dollars among the five products. I think it looks like knapsack problem but I am not sure. If I want to solve this for what should I look? If it is knapsack how should I change an original knapsack solution to fit mine problem? Thank you.

1

There are 1 best solutions below

2
On

These return functions are all monotonically increasing. Use hill-climbing.

Start with \$200k allocated to each product, an allocation of $(2,2,2,2,2)$. Your largest increment is with product E ($0.65 - 0.45 = 0.2$). Your smallest decrement is with product B ($0.30-0.18 = 0.12$). So your new allocation is $(2,1,2,2,3)$.

You have an unallocated \$80k, but that's not enough to purchase an increment. Now find the remaining largest increment and smallest decrement pair, apply them. You'll have more than \$100k unallocated with which you acquire one more largest increment (without a decrement).

Repeat until no more increment/decrement pairs remain and you do not have enough unallocated to just increment the allocation to a product.