I have a list of Tasks and each Task has a List of Tasks that depends on this Task and a time it takes to finish the task.
I have n processors and am trying to get the quickest time to finish all the Tasks.
For example:
Task 1 -> Tasks 2 and 3 depend it and takes 10 seconds
Task 2 -> no dependent Tasks and takes 5 seconds
Task 3 -> no dependent Tasks and takes 10 seconds
Task 4 -> no dependent Tasks and takes 12 seconds
I have 2 processors.
The quickest time to finish would be 20s. Task 1 and Task 4 are run in parallel. When Task 1 finishes it runs Task 3 and when Task 4 finishes it runs Task 2.
I've thought about first using topological sort to get a list of what tasks need to be completed first and then compare the times of all the tasks that can be run and pick the ones with the longest time and do those first.
Any ideas?