Let’s say I have three operations that each take different time to complete:
“hack” takes 10 seconds
“grow” takes 20 seconds
“weaken” takes 30 seconds
I want to launch these operations in such a way that they finish one after another in a specified order. For example I want grow to finish first, followed immediately (Realistically with a small delay like 200ml) by hack finishing, and then weaken finishing. Is there some kind of algorithm I can follow to figure out in which order I should launch my operations and how long to wait before launching each operation?
The example problem is trivial, but I need to be able to solve this problem for an arbitrary number of operations and execution times and desired execution orders, and I don’t know how.