I have a $5,000,000 budget.
And I have a list of projects with known costs.
I want to use up as much of the projects' budget as is practical--but with minimal complexity.
Using database logic, I can generate an ascending running total column in the list of projects. Using the running total, I can successfully omit any projects where the running total is greater than $5,000,000.
In order to reach my goal of using up most of the budget, I have come up with a low-tech technique where I sort the construction projects descending so that the more expensive projects are at the top of the list (and the less expensive projects are at the bottom). This way, when the running total of the projects approaches the $5,000,000 cut-off, I'm left with smaller projects that fit fairly well into the remaining gap.
This technique seems to be fairly successful. While it doesn't achieve 100% optimization, it does have the benefit of being low in complexity.
Question:
What is this kind of optimization called?