Greetings,
Can anyone please tell me what algorithm is used for traversing a directed acyclic graph/ diagram like this :
Ex.
Diagram nodes : A, B, C, D1, D2, D3, E
Diagram edges : A → B, B → C, C → D1, C → D2, C → D3, D1 → E, D2 → E, D3 → E
The traversal is like this :
A → B → C → D1, then C → D2, then C → D3,
And after that, they join : D1 → E, D2 → E, D3 → E
My graph represents real time operations. Most operations are linear, but when operations split on condition, each split (ex. node C splits to D1, D2 and D3) waits for all operations to finish before they join again (ex. nodes D1, D2 and D3 join at node E)
I need to iter over my nodes and call each operation in this exact order.
I use Python with pygraph, but you can use any language if you want to post some algorithm.
Maybe it’s a standard name for this algorithm, like Depth-first search, Dijkstra’s algorithm, Hill climbing, i don’t know ?…
Thank you very very much !
A topological sort will give you the order that you need to perform the operations in given the edges.