Assignation of tasks to workers. OpenMP version

We have nt tasks to be solved by nw workers. Each worker i has a capacity c(i), which indicates the maximum number of tasks that can be assigned to worker i. The benefit obtained if the task j is solved by the worker i is represented in a table b(i,j). Some workers do not know how to solve some tasks, which is represented with b(i,j)=0. The problem consists on obtaining a assignation of the tasks to the workers which maximizes the total benefit (the sum of the benefits) and satisfies the restrictions (tasks can not be assigned to workers they do not know how to solve them, and a worker can not be assigned more tasks as capacity he has).


A number of problems is solved. For each problem the function to parallelize has:

Input parameters:

-int nw: the number of workers

-int nt: the number of tasks

-int *c: the vector of size nw with the capacities of the workers

-int *b: the matrix nw x nt with the benefices

Returns the maximum benefit


Files

For more instructions: general instructions.