Tech

Large-Scale Housing Allocation Can Be Easy with Mixed-Integer Optimization

Published on
August 27, 2026

The thing with assigning thousands of families to a stock of houses is not only the time spent on the task, but the subjectivity that has to be put into such a difficul case. Balancing room count, accessibility, and location, quickly becomes an operational bottleneck. Manual case-by-case processing isn’t just slow; it also introduces inconsistency, as outcomes depend heavily on individual decisions.

To solve this for a real resettlement program with 1200+ families and 1500 housing units, we built a Mixed-Integer Linear Programming (MILP) allocation engine that evaluates the entire assignment space simultaneously and solves the problem in minutes.

identical houses alligned - housing allocation

The problem with assigning housing one case at a time

Large housing programs such as resettlements, social housing rollouts, or post-disaster rebuilding eventually face the same operational bottleneck: hundreds or thousands of families need to be matched to a fixed, heterogeneous stock of housing units that vary in size, typology, accessibility, and location. Doing this one case at a time works for a few dozen cases. Past that, two things break down. 

First, reviewing each household against the available stock by hand can take forever. It gets slower as the process continue and harder to match. Second, and more importantly, consistency: the outcome depends on which staff member built which file, the day it was built, and with which criteria. There is no way to know if a materially better distribution existed.

The case for mathematical optimization here is fairly direct. If an institution can state, precisely, which assignments are legal and which outcomes are preferable, a solver can search the space of every possible family-to-house assignment and return the exact optimum for the criteria that were switched on, rather than an approximation.

Turning an assignment into an optimization problem

In some cases, the benefit of optimization is the absence of human thought during the process. The model treats families and houses as two disjoint sets and defines a binary decision variable for every potential pairing. Because both the rules and the priorities can be written as linear expressions over these binary variables, the problem is a Mixed-Integer Linear Programming instance, a well-studied class with mature solvers that can prove they have found the true optimum, rather than a heuristic that stops at 'good enough.'

Reducing The Search: The Admissibility Matrix

As you can imagine, with over a thousand families and a similarly sized housing stock, the possible pairings are countless. Even without having in mind their preferences, the basic needs have to be covered: a six-person household cannot go into a unit built for one to four occupants, a household that needs step-free access cannot be placed in an upper-floor unit with no adaptation, and a household running a small shop from home needs a unit that supports commercial use. These are first encoded as hard rules, producing a much smaller set of admissible family-house pairs.

Here’s where the admissibility matrix comes in. By setting up hard habitability rules, it discards invalid pairs before a final decision. This makes the entire difference and reduces the search, making the decision time faster and guaranteeing that no illegal assignments enter the candidate pool. 

Making Objectivenes a Configurable Function

Once valid pairs are defined, ranking candidate distribution has to be made objectively, so we made it possible with a function. 

Every institutional priority is expressed as a weighted term:

    • Space preservation: the system penalizes assigning a family less usable living space than their current home, so the solution has to maintain or improve it.

    • Territorial roots: it favors keeping a family within their original living zone, making them stay in the same neighborhood and keeping their networks and community.

    • Occupancy efficiency: penalizes unused capacity in an assigned unit, so the available stock gets used as fully as possible.

    • Environment and urban quality: penalizes placing a family farther from green spaces or essential points of interest than they were before, without rewarding getting closer.

    • Custom criteria: new priorities can be added as additional weighted terms without rebuilding the model.

Turning a criterion on or off, or making it matter more or less, just requires raising or lowering its weight. Extending the model to a new priority that the institution didn't originally ask for means adding one more weighted term to the same objective function. That's what makes it realistic to run dozens of prioritization schemes against the same family and housing data in a single working session, something manual assignment can't offer.

Explaining the engine: How it works end-to-end

In practice, the system is organized around four stages: 

  • For every case, it gets family and housing data directly from CSV files and geo-referenced records, and extracts composition, typology, surface area, location, and distances without manual data entry.
  • Applies the admissibility filter described above.
  • Builds the weighted objective function from whichever criteria are currently switched on
  • Hands the resulting model to a MILP solver, which returns the best assignment for that specific configuration.
allocation engine system diagram

What a housing team actually gets

  • A complete, traceable, reproducible assignment between families and housing units, where every placement can be explained by pointing at the criteria and weights that produced it.
  • Speed to iterate: each run takes minutes, which makes it practical to simulate dozens of prioritization schemes, compare their outcomes side by side, and choose deliberately instead of committing to the first plan produced.
  • Objective quality metrics, like surface deficit, occupancy efficiency, criteria compliance, and environmental impact, to support decisions in front of technical teams, funders, or oversight bodies.
  • A model that grows with the program's new priorities comes up.

Putting it to the test: a resettlement program with 1200+ families

The engine was validated on a real resettlement program that needed to relocate an entire informal settlement, roughly 1200 families, into a new housing complex of approximately 1500 units, distributed across four typologies with accessibility and commercial-use variants. A manual, census-based reference assignment already existed for this program, enabling the engine's output to be measured against a real baseline rather than a theoretical one.

Two configurations, two different philosophies

Because a full run takes minutes, it was possible to test many prioritization schemes against the same data; two are highlighted here as representative cases:

  • Configuration A prioritizes, above everything else, preserving or improving each family's living space relative to their original home. 
  • Configuration B is a balanced setup that combines surface preservation with a more efficient use of the available stock, looking for a middle ground between the two objectives.

Results

Results of ousing allocation solution - graph

Compared with the manual reference, Configuration A reduced the share of families ending up with less living space than before by more than a third, from 19% to 12%, without sacrificing any occupancy efficiency. 

Configuration B matched the reference on surface loss (19%) but used the available stock considerably more productively, lifting occupancy efficiency from 50% to 62.5%. These results are specific to this program's census and housing stock; the exact percentages will vary with different input data, but the underlying capability transfers directly.

Later in the same engagement, the model was extended with one more criterion, a penalty for placing a family farther from a public green space than their original home. When run on top of both configurations, it produced typology, surface, and efficiency results in line with the versions above, while reducing the share of families ending up with worse green-space access to about 1%.

An Allocation Solution: Why Stop at Housing?

The underlying pattern is not specific to housing. Any time a fixed set of "demand" units needs to be matched against a fixed set of "supply" units under hard eligibility rules and softer priorities, the same MILP structure applies; hospital-bed allocation, school-seat assignment, technician-to-route matching, and similar problems all fit the same mold. We work with closely related mixed-integer and combinatorial optimization techniques for other supply-and-demand balancing problems.

Conclusion

We can all agree that manually assigning housing at this scale is definitely a time consuming task, to say the least. But, the most important thing here is that it is impossible to justify the exact criteria after the decision is made. Nobody can say with certainty whether a better distribution existed. 

Framing it as a MILP problem removes that uncertainty. Introducing hard habitability rules that are enforced structurally through the admissibility matrix, and expressing institutional priorities as weights on a single objective function, makes the solver return a provably best assignment for whichever configuration is active. The result is a process that runs in minutes, instead of weeks, and produces a distribution that can actually be explained. Plus, it extends to new priorities by adding a weighted term rather than rebuilding the system, all of it validated on a real program with more than 1200 families and 1500 housing units.

If you're looking for an allocation system of want to create a new solution, get in touch with us at hello@digitalsense.ai.

For more projects, make sure to check our success stories.