Enforcing the pre-computed level when generating dependencies
The original code suffers from a probable inconsistency between the nodes topology decided by generateTasks and that of the actual generated DAG.
Explanation:
In the task scheduling literature, the level of a node (task) n is usually defined as [1]:
The maximum number of edges of the paths from the entry node to node
n
In DAGGEN, the nodes topology (i.e. the number of nodes in each level) is first decided by generateTasks, but it is not enforced later when generating the edges in generateDependencies. More specifically, by considering the above definition of level, a non-entry node that was decided to belong to level i might end up belonging to any level between [Max(1, i-jump+1), i] in the generated DAG. In other words, for jump > 1 the generated DAG is probable to have a drastically different nodes topology from what was decided by generateTasks.
To enforce the nodes topology decided by generateTasks, every node in level i should have at least one parent in level i-1.
Side note: I also could not think of any other definition for level using which does not result in the explained probable inconsistency between the nodes topology decided by generateTasks and that of the generated DAG.
[1] H. Arabnejad and J. G. Barbosa, "List Scheduling Algorithm for Heterogeneous Systems by an Optimistic Cost Table," in IEEE Transactions on Parallel and Distributed Systems, vol. 25, no. 3, pp. 682-694, March 2014, doi: 10.1109/TPDS.2013.57.