DAG
Directed Acyclic Graph with labeled nodes. This structure is a very thin wrapper around SimpleDiGraph
from LightGraphs
package.
Dagitty.DAG
— TypeDAG
Structure with fields:
graph::SimpleDiGraph
- underlying directed graphlabels::Vector{Symbol}
- vector of each nodes' label
Could be constructed by passing list of Pair{Symbol, Symbol}
Examples
julia> using Dagitty
julia> g = DAG(:A => :B)
DAG: {2, 1} directed simple Int64 graph with labels [:A, :B])
julia> g.graph
{2, 1} directed simple Int64 graph
julia> g.labels
2-element Vector{Symbol}:
:A
:B
julia> g = DAG(:A => :A)
ERROR: DAGHasLoops()
Dagitty.DAGEdge
— TypeDAGEdge
Pair of symbols representing DAG edge.
Dagitty.DAGHasLoops
— TypeDAGHasLoops
Exception, thrown when loops are detected on DAG construction.
Examples
julia> using Dagitty
julia> g = DAG(:A => :B, :B => :A)
ERROR: DAGHasLoops()
Dagitty.LabelNotFound
— TypeLabelNotFound
Exception thrown on attempt to resolve label which is not present in the DAG.
Examples
```jldoctest julia> using Dagitty
julia> g = DAG(:A => :B) DAG: {2, 1} directed simple Int64 graph with labels [:A, :B])
julia> node(g, :C)