This problem is a variation of the Knapsack Problem.
Given the following model.
There is a set of $ n $ workers, each with a given capacity $ \left{ {c}{j} \right}{j = 1}^{n} $.
There are $ m $ tasks where the same task can be done by many workers or none at all. Each task has different gain and cost for each worker.
- The gain of completion of the $ i $ -th task by the $ j $ -th worker is given by $ {g}_{ij} $.
- The work of doing the $ i $ -th task by the $ j $ -th worker is given by $ {w}_{ij} $.
- The flag whether the $ i $ -th task is assigned to the $ j $ -th worker is given by $ {x}{ij} $. Where $ {x}{ij} = 1 $ means the work is assigned and $ {x}_{ij} = 0 $ means it is not assigned.
The objective is to maximize the gain of the assigned tasks according to the following constraints:
- Each task can be either not be assigned at all or be allocated to at least $ k $ workers and not more than $ l $ workers.
- No worker will exceed its work capacity.
This can be formulated as:
Where $ T = \left{ i \mid \exists j : {x}_{i, j} = 1 \right} $, namely the set of tasks which are assigned.
In the above, $ i $ (Rows of the matrix) is the task index and $ j $ is the worker index.
Optimized C based implementation of MATLAB's im2col() function.
Implementation of the Levinson Recursion on MATLAB.
This allows solving Linear System A x = b where A is a Toeplitz Matrix in O(N^2) complexity instead of O(N^3) using classic solution.
- Knapsack Problem - Wikipedia.
- List of Knapsack Problem.
- David Pisinger's Optimization Codes
Code for many variations of the Knapsack Problem. - fd