Hacker News new | ask | show | jobs
by mattcarkci 4643 days ago
I'm the author of the book...

It may be fairly simple for you to change your design to generate a static call graph for the nodes using topographical sort. Then on each "tick" you simply execute each node, in order, from top to bottom.

I always like to use a stack to schedule execution because I can then change the algorithm that schedules them to use a very different method.

- Matt Carkci

1 comments

Topographical sort is actually what I use, storing the results of the sort in a run list as you describe. The tricky part was dealing with cycles in the graph.