I have a simple finite directed acyclic graph (DAG) stored in two tables
- Nodes (node primary key)
- Arrows (parent , child, primary key (parent, child))
Both parent and child in the Arrows table are foreign keys referencing the Nodes table.
Each node may occur more than once, i.e. each node may have multiple parents, but there is no cycles in the graph.
I want to write a perl function that read from the two tables and output a string for each full path from the root to a leaf node.
Is this a simple job? Better yet, is there any code avilable on line somewhere that I can borrow, and perhaps customize to my need?
Thanks,
pac
Start Free Trial