With limited-resources, is it really more efficient to process more time-consuming tasks first?

51 Views Asked by At

I have the task of re-encoding 900 video files of varying sizes. I can only encode a maximum of 12 files in parallel at any given time. (Yes, CPU threads on single-threaded rendering.)

My intuition tells me that I may increase the likelihood of completing the task earlier if I arrange the files from largest to smallest, and start encoding from the largest files first.

That's intuition. Is there mathematical proof for that?

1

There are 1 best solutions below

1
On BEST ANSWER

What you describe is a greedy heuristic that is not guaranteed optimal but is a $4/3$ approximation. See https://en.m.wikipedia.org/wiki/Longest-processing-time-first_scheduling