Problem
A visual automation scenario is a graph of connected modules, where an edge from module A to module B means B depends on A's output. Given the module dependencies, compute a valid execution order (each module runs only after its dependencies) and detect whether the graph contains a cycle (which makes execution impossible).
Input / Output
Constraints
Example
A -> B -> C => run order A, B, C. A cycle (e.g. A -> B -> A) is invalid.