Find the sequence of dependencies a set of nodes in a directed acyclic graph (DAG).
Sample use case: concurrent task processing: given a set of tasks, determine which ones can be
executed in parallel, and which ones need to run in sequence.
Find the sequence of dependencies a set of nodes in a directed acyclic graph (DAG).
Sample use case: concurrent task processing: given a set of tasks, determine which ones can be
executed in parallel, and which ones need to run in sequence.
Attributes
Throws:
java.lang.AssertionError
if given nodes have cyclic dependencies
Algorithm: variant of Kahn's algorithm for topological sort
for given nodes, find all leaves, i.e. the those without parents (e.g. task dependencies)
disregard all that have already been visited and add to the results sequence