There are n jobs to be scheduled on m machines, with each machine taking a different time t_i for a job. The machines are ordered, with priority given to 1st machine if free and so on.
I have to code in C++ an algorithm to efficiently calculate the machine on which the nth job will run.
So far, my pseudo-code looks like this :
initialise rem_time[m] to 0 // Remaining time for m machines
for each element(i) in job array
machine(j)= find_min(rem_time[]) //Find the lowest rem_time among all machines
append joblist[j] with element_i
rem_time[j] += t_j
I'm looking for other solutions I can use here to further optimise the solution as using find_min n times, and storing all the jobs scheduled on every machine seems like a waste.
Thanks!