causaldag.classes.dag.DAG.remove_arc

DAG.remove_arc(i: Hashable, j: Hashable, ignore_error=False)[source]

Remove the arc i -> j.

Parameters:
  • i – source of arc to be removed.
  • j – target of arc to be removed.
  • ignore_error – if True, ignore the KeyError raised when arc is not in the DAG.

Examples

>>> import causaldag as cd
>>> g = cd.DAG(arcs={(1, 2)})
>>> g.remove_arc(1, 2)
>>> g.arcs
set()