DirectedAcyclicGraphs

DirectedAcyclicGraphs.NodeTypeType

A trait hierarchy denoting types of DAG nodes NodeType defines an orthogonal type hierarchy of node types, so we can dispatch on node type regardless of the graph type. See @ref{https://docs.julialang.org/en/v1/manual/methods/#Trait-based-dispatch-1}

Base.filterMethod

Retrieve list of nodes in DAG matching predicate p

Base.foreachFunction

Apply a function to each node in a graph, bottom up

Base.inFunction

Is the node contained in the DAG?

Base.parentMethod

Get the parent of a given tree node (or nothing if the node is root)

DirectedAcyclicGraphs.find_inodeMethod

Find a binary inner node that has left in its left subtree and right in its right subtree. Supports nothing as a catch-all for either left or right. Returns nothing if no such node exists.

DirectedAcyclicGraphs.foldupMethod
foldup(node::DAG, 
    f_leaf::Function, 
    f_inner::Function, 
    ::Type{T})::T where {T}

Compute a function bottom-up on the graph. f_leaf is called on leaf nodes, and f_inner is called on inner nodes. Values of type T are passed up the circuit and given to f_inner as a function on the children.

DirectedAcyclicGraphs.foldup_aggregateMethod

Compute a function bottom-up on the circuit. f_leaf is called on leaf nodes, and f_inner is called on inner nodes. Values of type T are passed up the circuit and given to f_inner in aggregate as a vector from the children.

DirectedAcyclicGraphs.lcaMethod

Find the least common ancestor. Assumes the Tree has access to a parent. A given descends_from function is required to quickly check whether a node is an ancestor.