Knapsack problem for the range
Choosing whole items with the highest total margin under the limits of the buying budget and shelf room.
Formula
max Σ margin, subject to Σ cost ≤ budget and Σ room ≤ shelf
How to read
An exact scan is possible with a small number of items; for a long list the greedy set is taken and checked on a part.