I have a list of dependencies (or better a DAG without cycles):
Input (for example):
Item A depends on nothing
Item B depends on C, E
Item C depends on A
Item D depends on E
Item E depends on A
What I'm looking for is: "What is the best* parallel order of the items?"
*best means: maximum concurrency level
Result (for example):
[A], [E, C], [D, B]
The best approach seems to be Pseudocode for getting order based on Dependency but I think I miss a basic algorithm on this.
This looks a lot like https://en.wikipedia.org/wiki/Program_Evaluation_and_Review_Technique and https://en.wikipedia.org/wiki/Critical_path_method
Assuming that you want the maximum concurrency level to get the thing done as soon as possible, once you have organised things so that it takes no longer than the critical path you have something that does as well as the best possible solution - and if there is no limit on the amount of parallel tasks you can run, you can get the critical path just by scheduling every action as soon as all of its dependencies have completed.