I have two processors, and I want to schedule as many jobs as I can. I have their starting time and finishing time, and each job has to be unique to a processor (no overlap). I looked around and found one processor, or n
processors - but none for two. I thought it'd be popular but I can't find if anyone's done this before?
My idea is just like the normal interval scheduling algorithm, to implement a greedy approach. First, sort by earliest starting time. Then, start by scheduling the first job to the first processor. The second job to the second processor. From there, schedule the next job to the processor who is going to finish their job first.
I think it would work, but I think this is in O(n^2)
time and I'm trying to get to O(n)
or O(n log n)
Any help is appreciated :)