A company has some workers who need to perfrom some jobs. Each job requires workers of a combination of departments and seniority.

Departments : HR, Legal, Product, Development

Seniority : Junior, Mid Level, Senior

For example, a job might have the following minimum requirements.


  1. Total Workers - 8
  2. Atleast 2 workers from Development
  3. Atleast 2 workers from Product
  4. Atleast 4 Senior workers
  5. Atleast 1 Junior worker

If there are not sufficient workers available, we can hire outside contractors. Our objective is to allocate workers to jobs so as to minimize the number of contractors we have to hire.

What is a good algorithm to allocate workers to jobs optimally?

New contributor
user296527 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    $\begingroup$ Can you credit the original source where you encountered this task? What context can you provide? What topic have you been studying, where this arose? $\endgroup$ – D.W. May 4 at 5:42
  • $\begingroup$ I don't immediately see how this is different from the following problem. We have $n$ boxes and $m$ balls. We want to fill each box with one ball. If we need more balls, we can buy new ones, for a fixed cost. What is the optimal way to fill each box with one ball, expending as little money as possible? $\endgroup$ – Yuval Filmus May 4 at 7:00

Your Answer

user296527 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.