Municipal Budget Allocation

0-1 Knapsack · equity-aware weights · capital projects

A city council has a capital budget. It receives proposals for projects: a park, a library renovation, a water-main upgrade, a community centre. Each has a cost and an expected public-value score. Which projects do they fund? The operational problem is the classical 0-1 knapsackDantzig's 1957 LP formulation, Bellman's dynamic programming, Martello & Toth (1990) textbook. What makes it a public-services problem is that the “value” score is contested — utilitarian benefit-cost ratios, equity-weighted Gini corrections, and participatory-budgeting alternatives all give different answers.

Educational resource. This page describes a mathematical model used for capital-budget decisions. It is a teaching tool, not municipal-finance guidance. Real budget allocation is a deeply political process involving council deliberation, public hearings, bond-rating implications, and legal compliance that no knapsack optimiser captures.

Problem context

Which projects, which weights, whose value

A municipal capital budget, typically set annually, funds discrete projects — infrastructure, facilities, equipment — each with a one-time cost drawn from the budget. Operating expenses (salaries, utilities) are typically separate. Each candidate project carries a cost ci and a perceived benefit vi; the 0-1 knapsack selects a subset maximising total benefit within budget.

The OR framing is simple; the policy tension lives in vi. A cost-benefit-analysis (CBA) score is the utilitarian approach: discounted future benefits minus costs. Marsh & Schilling (1994)'s equity-aware framework adds a weight for the demographic distribution of benefits — a project that benefits already-advantaged neighbourhoods gets a lower effective weight than one benefiting under-served ones. Karsu & Morton (2015) survey inequity-averse formulations more generally.

Participatory budgeting (PB) is the institutional alternative: let residents directly vote on project selection. Pioneered in Porto Alegre, Brazil (1989), PB has spread to thousands of cities worldwide (Wampler 2007); it converts the optimisation from expert-knapsack to a social-choice problem (see the matching mechanisms page for the mechanism-design adjacent literature).

Multi-stakeholder framing

Residents
Beneficiaries and taxpayers; public value hinges on whose neighbourhoods get funded projects.
City council
Approves the budget; each council member represents a district and has incentive to fund local projects.
Mayor / executive
Submits a proposed budget; balances departmental requests and political priorities.
Department heads
Submit project proposals; advocate for their priorities; technical expertise on cost/benefit.
Advocacy groups
Push for specific projects / project types (parks, affordable housing, broadband).
Bond rating agencies
For cities issuing municipal bonds, rating agencies evaluate capital planning quality — indirectly shaping which projects get funded.

Mathematical formulation

0-1 knapsack with optional equity weights and interdependencies

SymbolDefinitionDomain
ISet of candidate projects|I| = n
ciCost of project iℝ⁺
BTotal budgetℝ⁺
viUtilitarian benefit / NPV scoreℝ⁺
eiEquity weight (demographic-distribution factor)ℝ⁺
xiBinary: 1 if project i is funded{0, 1}
PkSubset of projects that are interdependent (prereq / exclusion)
Classical 0-1 knapsack (utilitarian) max Σi vi xi  // maximise total benefit
s.t. Σi ci xiB  // budget
     xi ∈ {0, 1}

Equity-weighted variant (Marsh-Schilling 1994) max Σi ei vi xi  // equity-adjusted total benefit
// e_i > 1 for projects in under-served districts; e_i < 1 for over-served. Enshrines equity pref in the objective.

With interdependencies Add: xixj for prerequisites (i needs j done first)
     xi + xj ≤ 1 for mutual exclusivity
     per-category budget caps (Σi ∈ cat k ci xi ≤ Bk)

Complexity NP-hard (weakly); pseudo-polynomial dynamic programming in O(n · B); LP relaxation gives fractional-project bound; Martello-Toth-style branch-and-bound practical for n ≲ few thousand.

Interactive solver

Select projects under budget, compare utilitarian vs equity-weighted

Budget Knapsack Solver

10 projects
16 projects
24 projects
40 %
Utilitarian (vi)
Equity-weighted (ei · vi)
DP (exact)
Greedy (value/cost)
Choose scenario, budget, objective, and algorithm, then click Solve. DP gives the exact optimum for discrete project selection. Greedy by value/cost ratio gets you close with O(n log n) time — same as the LP relaxation upper bound.

Solution interpretation

Utilitarian vs equity-weighted: what changes

Reading the funding list

DP finds the exact optimum; greedy by value/cost ratio typically gets within a few percent. For small n (≤ 30), DP is instant and gives the right answer.

Switching to equity-weighted typically moves the funded set toward projects in under-served districts — even when those projects have lower utilitarian vi. The total unweighted benefit may fall; the equity-weighted objective is what rises.

Budget tightening exposes the priorities: at 20% budget, only the highest value/cost projects make the cut; at 70% budget, almost everything is funded and the choice of weights barely matters. The action is in the middle.

Limitations & Critique

Why a knapsack isn't a budget

Benefit scores are contested

vi is supposedly a dollar-denominated benefit, but many public-service benefits resist dollar valuation — parks for children, library hours for seniors, accessibility improvements. Setting arbitrary dollar values compresses the problem into a knapsack but smuggles in contestable assumptions.

Arrow et al. (1996). Benefit-cost analysis in environmental, health, and safety regulation.

Equity weights are political, not technical

Marsh-Schilling equity weights require specifying how much to favour under-served districts. There is no neutral answer: ei = 1 (utilitarian) and ei proportional to historical underinvestment are both defensible; neither is “correct.” The optimiser surfaces the choice but cannot make it.

Karsu & Morton (2015). Inequity-averse optimization in operational research.

Project interdependencies are non-trivial

Building a library without a road to it is pointless; opening a facility needs an operating budget too. Pure knapsack ignores these logical relationships. Adding prerequisite / mutual-exclusion / category-cap constraints extends the MILP and is routinely needed in practice.

Kellerer, Pferschy & Pisinger (2004). Knapsack Problems.

Log-rolling & political feasibility

Real councils trade votes: “I vote yes on your library if you vote yes on my pool.” This log-rolling produces outcomes that are not knapsack-optimal but are the only politically-passable set. An OR-optimal budget that cannot pass council is less useful than a somewhat-inferior one that can.

Buchanan & Tullock (1962). The Calculus of Consent.

Participatory budgeting as an alternative

Porto Alegre (1989), New York City (2011), and many others let residents directly vote on project selection. PB trades away some utilitarian efficiency but gains legitimacy and accountability. For many small/mid-sized cities, PB outperforms expert optimisation on political-sustainability metrics.

Wampler (2007). Participatory Budgeting in Brazil.

Multi-year dynamics

A one-year knapsack ignores capital-project life cycles, maintenance obligations, and future constraints. A cheap-looking capital project with a large ongoing operations cost is bad news; dynamic multi-year formulations exist but are rarely solved exactly in practice.

Drezner & Erkut (1995). Solving capital budgeting via dynamic programming.

Extensions & variants

Multi-dimensional, dynamic, participatory

Multi-dimensional knapsack

Separate budget constraints per category (infrastructure vs parks vs buildings). Standard extension; NP-hard.

Participatory-budgeting optimisation

Social-choice-based allocation aggregating voter preferences; Goel-Krishnaswamy-Sakshuwong-Aitamurto 2019.

Dynamic multi-year budgeting

Projects span multiple years; maintenance obligations; net-present-value discounting. Drezner-Erkut 1995.

Stochastic benefits

Project outcomes uncertain; robust / stochastic knapsack formulations. Morton-Wood 1998.

Integer-programming decomposition

Lagrangian relaxation, Benders decomposition for large-scale MILP with category caps and interdependencies.

Bi-objective Pareto frontier

Explicit tradeoff between utilitarian and equity-weighted objectives; presents a frontier rather than a single solution.

Fair allocation axioms

Proportional representation, Nash social welfare, max-min share. Connects to fair-division literature; Procaccia 2013.

Ranking vs. approval PB

Voting structures differ — ranked-choice, approval, cumulative, knapsack voting. Benadè et al. 2021 on fair allocation in PB.

Key references

Cited above

[1]Dantzig, G. B. (1957).
“Discrete-variable extremum problems.”
Operations Research 5(2), 266–288. doi:10.1287/opre.5.2.266
[2]Martello, S., & Toth, P. (1990).
Knapsack Problems: Algorithms and Computer Implementations.
Wiley. Foundational textbook.
[3]Kellerer, H., Pferschy, U., & Pisinger, D. (2004).
Knapsack Problems.
[4]Marsh, M. T., & Schilling, D. A. (1994).
“Equity measurement in facility location analysis: A review and framework.”
European Journal of Operational Research 74(1), 1–17. doi:10.1016/0377-2217(94)90200-3
[5]Karsu, Ö., & Morton, A. (2015).
“Inequity averse optimization in operational research.”
European Journal of Operational Research 245(2), 343–359. doi:10.1016/j.ejor.2015.02.035
[6]Wampler, B. (2007).
Participatory Budgeting in Brazil: Contestation, Cooperation, and Accountability.
Penn State Press.
[7]Goel, A., Krishnaswamy, A. K., Sakshuwong, S., & Aitamurto, T. (2019).
“Knapsack voting for participatory budgeting.”
ACM Transactions on Economics and Computation 7(2), 1–27. doi:10.1145/3340230
[8]Benadè, G., Nath, S., Procaccia, A. D., & Shah, N. (2021).
“Preference elicitation for participatory budgeting.”
Management Science 67(5), 2813–2827. doi:10.1287/mnsc.2020.3666
[9]Arrow, K. J., Cropper, M. L., Eads, G. C., et al. (1996).
“Is there a role for benefit-cost analysis in environmental, health, and safety regulation?”
Science 272(5259), 221–222. doi:10.1126/science.272.5259.221
[10]Buchanan, J. M., & Tullock, G. (1962).
The Calculus of Consent: Logical Foundations of Constitutional Democracy.
University of Michigan Press.
[11]Drezner, Z., & Erkut, E. (1995).
“Solving the continuous p-dispersion problem using non-linear programming.”
Journal of the Operational Research Society 46(4), 516–520. Relevant multi-period dynamic formulations.
[12]Procaccia, A. D. (2013).
“Cake cutting: Not just child's play.”
Communications of the ACM 56(7), 78–87. doi:10.1145/2483852.2483870

Advising a municipal-finance
or participatory-budgeting project?

Get in Touch
Data and numerical examples are illustrative. This page is an educational tool, not municipal-finance or policy advice.
Public Services