causaldag.classes.dag.DAG.add_arc¶
-
DAG.
add_arc
(i: Hashable, j: Hashable, check_acyclic=True)[source]¶ Add the arc
i
->j
to the DAGParameters: - i – source node of the arc
- j – target node of the arc
- check_acyclic – if True, check that the DAG remains acyclic after adding the edge.
See also
Examples
>>> import causaldag as cd >>> g = cd.DAG({1, 2}) >>> g.add_arc(1, 2) >>> g.arcs {(1, 2)}