Skip to content

Commit c29b11e

Browse files
JicquelNikokrock
andcommitted
Implement a directed graph and its iterator
This implementation comes initially from the one in gpr2 (GPR2.View_Ids.DAGs) and from e3-core (src/e3/collection/dag.py). Each node in the graph is identified by a node ID and can have other nodes as predecessors. Acyclic graphs can be iterated with an iterator that can be external or internal to the graph. Each graph node supports three different states during an iteration: non-visited, visiting and visited: * Non_Visited : The node has not been iterated. * Visiting : The node has been iterated but it has not been processed by the graph iterator caller. Use the "Complete" procedure to go from the "Visiting" to the "Visited" state. * Visited : The node has been iterated and processed. However, it is also possible to only keep the non-visited and visited states to simplify the process. Nodes can be added or their predecessors updated during an iteration. Notice that a node can not be removed, for simplicity and efficiency. Co-authored-by: Nicolas Roche <roche@adacore.com>
1 parent 5dd2c70 commit c29b11e

File tree

4 files changed

+1430
-0
lines changed

4 files changed

+1430
-0
lines changed

0 commit comments

Comments
 (0)