I am looking for an algorithm (and hopefully a .net implementation) that can do the following: I have the following data:
- a list of technicians each one with different skills (could be more than one).
- a service time window (e.g. 8-12)
- a list of all previously scheduled jobs within this time window (each with it's required skills)
given a new job (with required skills), I am supposed to check if the new job and be assigned to any of the technicians available (previous jobs may be moved between technicians as long as their skills support it). also the service time window cannot be exceeded so a 1 hour job cannot scheduled for 11:30
Initially I thought about doing bin packing FFD variant were I pre-load the bins (technicians) and when looking for a bin to place a job I would also check for skill matching. The job list would contain all previous jobs and the new one (sorted descending by size) and either the code stops because a job cannot be placed in any bin or it finishes after all jobs have been scheduled.
In theory it could work but then I thought of the following scenario:
- Technicians: T1(with skills S1 & S2), T2(with skills S2 & S3)
- Previous jobs: J1 (requires skill S2), Duration the whole time window.
- New Job J2 (requires skill S1)
A case could happen that J1 is assigned to T1 and then J2 has no place to fit.
So I thought about adding a second sort to the job list: Jobs will be sorted by size descending and then by the number of resources who can actually do them ascending. This would place J2 to be scheduled first as fewer technicians can do it.
Is there a specific algorithm for solving this or is my approach good enough?
Thanks