Skip to content

Lot Selector Under Budget

Give a budget and a list of lots, each with a cost and a value. The page finds the combination with the highest total value that stays within the budget, tries every possibility with dynamic programming, then shows the money left and the best alternative if you skip one of the chosen lots. Without a value, the value is the cost, so it fills the budget as far as possible.

Best selection

Lot A + Lot C

Total value 14 for 100 spent; 0 of the 100 budget left.

Best alternative without one of these lots: Lot B + Lot C, value 13 (1 less), 90 spent.

LotCostValueStatus
Lot A608Selected
Lot B507Not selected
Lot C406Selected

How it works

  1. Enter the budget.
  2. Write one lot per line: name ; cost ; value (the value is optional).
  3. Read the selected lots, the total value and the budget left.
  4. Copy the summary or download the table as CSV.

What people use it for

  • Choosing purchases

    Pick the equipment or books that bring the most value for a fixed grant.

  • Classroom and club budgets

    Decide which activities to fund when each has a price and a score.

  • Project backlogs

    Select the features with the best value that fit in a given number of hours.

Questions

Is the result really the best one?
Yes, within the limits below: each lot is taken whole or not at all, and every combination is accounted for by dynamic programming, not by a greedy guess. With a budget of 100 and lots of 60, 50 and 40 worth 8, 7 and 6, the answer is 60 + 40 for a value of 14.
How are ties decided?
Highest total value first, then the lowest total cost, then the selection that keeps the lots that come first in your list. The rule is the same every time, so the same input always gives the same answer. A lot worth 0 is never selected.
What are the limits?
Up to 200 lots, amounts from 0 to 10,000,000 with at most two decimals. Amounts are handled as whole cents and divided by their common factor. The exact solver is limited to 4,000,000 lots × budget steps: about 200 lots fit a budget of 19,000 in whole units, but with cents only 3 lots fit a budget of 10,000. Beyond that you are asked to use rounder amounts, and the alternative is skipped for very large cases.
What is the next best alternative?
The best selection you would get by leaving out one of the chosen lots, whichever costs the least value. It tells you how much you give up if one lot becomes unavailable. The page says so when another selection reaches the same value.