algorithms – Allocating workers to jobs

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.

Job1:

  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?