June 9, 2023

Allocating scarce resources in the social sector

From figuring out goals to identifying potential trade-offs and constraints, here are some tips to keep in mind while allocating scarce resources.

4 min read

“How do I optimally allocate my resources?” is a critical question for policymakers in low- and middle-income countries where resources are scarce and needs are acute. The types of challenges that fall under this question are frequent and wide-ranging. They include questions like where to build public infrastructure, how to design optimal transportation routes, or where to assign personnel like teachers or community health workers to maximize benefits to communities.

Recently, a ministry of education reached out to IDinsight to optimally allocate a cohort of around 1,000 new teachers to their schools. In this article, we highlight some of our lessons from deploying this and other optimization models to inform policy decisions. If you are interested in the technical details of the model, check out this blog post.

Building the model: Figure out your goal and constraints 

At first, allocating 1,000 additional teachers to schools may seem simple – why not evenly distribute them? One reason is that some schools have more classrooms without a teacher than others. Another is that some core subjects like Mathematics may be considered more important than others. In addition, teachers have their own expertise; we shouldn’t assign a skilled science teacher to teach history.


To design any optimization model, one has to know what the goal is and what the constraints are, i.e., the factors to which one must adhere. An example is from this sample transportation project where the goal was to minimize the cost of transporting lab samples from remote clinics to a central lab while ensuring (1) each driver travels a maximum of 50 km (2) all samples are picked up within 24 hrs (3) A driver visits a maximum of 10 clinics. 

This can be simple, yet we have learned from working on optimization projects in India and North Africa that building and running the model is often the easy part.

tap running out of wtaer_resource allocation
“How do I optimally allocate my resources?” is a critical question for policymakers. | Picture courtesy: Pexels

Beyond the math: Trade-offs, political priorities, and trust

In this case, our objective was to minimize the number of classrooms that don’t have a teacher. But the devil is in the details. We may want to prioritize some schools or subjects over others. Inevitably, we have to make some judgment calls to understand how to prioritize tradeoffs.  For example, is it twice as important to ensure a Math class is staffed as a Digital Arts class? 1.5 times? These questions can be difficult to answer. 

They can also be politically sensitive. On a different project, we built a model to help a government build optimal bus routes and dormitories to improve access to schools. The government knew that they wanted to prioritize girls, who historically have had a lower rate of enrollment, over boys. But quantifying “by how much” felt like a political landmine. How can anyone say that getting girls into school is 2x or 1.75x times as important as getting boys to school? But this may be the statement we need to make to build a model to optimize where the infrastructure is built.

We also have to think about who will be using the model. Have they had time to engage with the model and do they trust it? All of these are key questions when designing optimization models that actually work in the real world.

Lessons learned

Here are three lessons we have learned to address the issues mentioned above.

1. Prepare to run the model for multiple scenarios

Engaging with key decision-makers will help you nail down the right objective and constraints, saving you a lot of time and heartache. This may involve running the model multiple times for numerous scenarios so that your stakeholder can understand the trade-offs of different options.  

For example, we had to decide if we should prioritize a particular subset of schools or not. Before making a decision, the stakeholder wanted to understand what the implications would be on the schools that were not prioritized. So we ran the model twice––once for each scenario.

Keep in mind that if your model takes a few hours to run, you may want to avoid too many parameters. The combinations quickly add up to a whole bunch of models and you find yourself running models for days. On a previous project, we made this mistake. It took four days to run all the models so every time data changed or a constraint was refined, we lost four days.

2. Build for a human in the loop

The model should not replace a human decision-maker but rather support them in the process. No matter how nuanced you make the model, there will be some corner cases and constraints that will be missed. Understanding the current process and who would be making the decisions in the absence of a model can reveal where and for whom data and models can enhance decision-making.

For the teacher-allocation problem, the model outputs a draft allocation that the decision-maker reviews. She may know about new constraints or incorrect assumptions when reviewing the allocation. When coming up with the final allocation, she may adjust the allocation to take local nuance into account. 

This is good practice not only when building optimization models but when building any AI/ML solution that impacts real lives.

One way to ensure that the final decision-maker is indeed a human is to build that into the modeling process. For example, we didn’t allocate a particular teacher to a school but rather a type of teacher. This is the difference between allocating Barbara to School A versus a teacher who can teach “History, English Literature, and Civic Studies” to School A. The final decision-maker can decide who the actual teacher should be. This allows them to take local context and circumstances into account when developing the final allocation.

3. Build trust in the model and data

While the design of the model and its logistical deployment are instrumental in creating a valuable tool for social sector leaders, our team is learning that building trust in these approaches must also happen simultaneously. As we reflect on this project with our counterparts at the state ministry of education, we recognize that incorporating more time for our partners to engage with the tool and more training to integrate it into routine activities, would have helped them orient towards its value and shortcomings. This familiarization needs to happen over time and be incorporated into the project planning.

Interested in the technical details? See this blogpost on how we used Julia, JuMP, and Gurobi to solve this problem.

This article was originally published on IDinsight.

We want IDR to be as much yours as it is ours. Tell us what you want to read.
Leah Mwai-Image
Leah Mwai

Leah Mwai is a public health specialist and holds expertise in cross-sectoral evidence and data systems. She is also the director at IDinsight.

Sid Ravinutala-Image
Sid Ravinutala

Sid Ravinutala leads the data science capability at IDinsight.