I need an algorithm for work plan scheduling. Workers have a fix amout of time to work. They also provide information about which days(hours) they are available. The available time is higher then the workload per period. The algorithm should generate an optimal time schedule where:
- Every time-slot is filled with a bounded amount of workers.
- Every worker should get the most possible continuous time.
Example: 2 days (d1, d2) with 8 hours each. 4 workers (d1,...,d4) with 8 hours workload each are available all days. Optimal: d1: from 9 am to 5pm: w1, w2 d2: from 9 am to 5pm: w3, w4 not Optimal: d1: from 9 am to 1 pm: w1, w2 from 1 pm to 5 pm: w2, w3 d2: from 9 am to 1 pm: w1, w2 from 1 pm to 5 pm: w2, w3
Might it be a knapsack problem? Is there a common algorithm for that to solve it? An approximate solution is ok.