问题
I have a similar to this task but with some differencies in bold. That is:
- I have a set of J jobs that need to be completed. Jobs are organized into set of directed graphs. Each job can have one or more preceding(parent) jobs that have to be completed before it starts
- All jobs take different times to complete, but the time is known
- I have a set of R human resources. Important!!! Each resource has a schedule when this resource is available
- Some jobs can be preempted once started. E.g. if a resource is not available at some specific hours then it can process the job after
- A job may has a predefined amount of resource which can be changed. If algorithm can't find desired decision (all jobs couldn't be finished at some known date) then we can increase/decrease resources amount. The duration of a job changes proportionally with amount. E.g. J1 require 1 human resource initially and estimated duration 1 hour. If we set 2 human resource than duration decreases to 0.5 hour
- Resources have parameters that match tasks. E.g. If J1 has constraints {A,B} then we can assign resource R1 with permissions {A,B} which satisfied these constraints. If there is no appropriate resources then we can assign any of available.
My Goal: Assign as much appropriate resources as possible so that the job would finish at the time.
Is there a way to solve this problem via simplex method? How equatinons would look like. What will be a complexity? Could you please help me to build a math model or share some links. Any help would be appreciate. I can't get close to resource schedules without brute permutation.
I've tried to implement something similar to greedy algorithm:
Firstly I sheduled tasks from job start date without resources calendars considering only relations between tasks (I calculated order for each task which is in chain. Where order 0 - the earliest predecessor) E.g. In chain J1 -> J2 -> J3 J3 must be done after finishing J1 and J2. J1.Order = 0, J2.Order = 1, J3.Order = 3.
Then I sorted tasks by order and operations count in chain. First goes the task with higher count of children. Then I sorted by count of required resources. And finally by initial duration of a task
For each order I take a task and assign resources with satisfied skills and can do the task then earlier then better considering their calendars and buisiness into another job
This algorithm doesn't take into account predefined job finish date. I'm worried that it's far away from optimal solution and another approach is needed. The greedy algorithm with a proof of correctness would also make the deal for me.
来源:https://stackoverflow.com/questions/63463124/resource-with-schedules-allocation-problem