package owl-base
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7e7725e9a1a967b2af54d7f091a0aea76c54e9abeb4220947921864ef6ffe7d0
md5=247e4b6e6190df68830095441e71e69a
doc/owl-base/Owl_graph/index.html
Module Owl_graphSource
Graph module supports basic operations on DAG.
Type definition
type definition of a node
Obtaining properties
Manipulation functions
val node :
?id:int ->
?name:string ->
?prev:'a node array ->
?next:'a node array ->
'a ->
'a node``node ~id ~name ~prev ~next attr`` creates a node with given id and name string. The created node is also connected to parents in ``prev`` and children in ``next``. The ``attr`` will be saved in ``attr`` field.
``connect parents children`` connects a set of parents to a set of children. The created links are the Cartesian product of parents and children.
``remove_node x`` removes node ``x`` from the graph by disconnecting itself from all its parent nodes and child nodes.
``remove_edge src dst`` removes a link ``src -> dst`` from the graph. Note that it does not remove dst -> src if there exists one.
``copy ~dir x`` makes a copy of ``x`` and all its ancestors (if ``dir = Ancestor``) or all its descendants (if ``dir = Descendant``).
Note that this function only makes a copy of the graph structure, ``attr`` fileds of the nodes in the new graph share the same memory with those in the original graph.
Iterators
Iterate the ancestors of a given node.
Iterate the descendants of a given node.
Filter the ancestors of a given node.
Iterate the descendants of a given node.
Fold the ancestors of a given node.
Fold the descendants of a given node.
Iterate all the in-edges of a given node.
Iterate all the out-edges of a given node.
Fold all the in-edges of a given node.
Fold all the out-edges of a given node.
Helper functions
Pretty print a given node.