causaldag.classes.ancestral_graph.AncestralGraph.remove_directed¶
-
AncestralGraph.
remove_directed
(i: Hashable, j: Hashable, ignore_error=False)[source]¶ Remove the directed edge from
i
toj
.Parameters: - i – source of directed edge.
- j – target of directed edge.
- ignore_error – If False, raises an error when the directed edge does not belong to the graph.
Examples
>>> import causaldag as cd >>> g = cd.AncestralGraph(bidirected={(1, 2), (1, 4)}, directed={(1, 3), (2, 3)}) >>> g.remove_directed(1, 3) >>> g Directed edges: {(2, 3)}, Bidirected edges: {frozenset({1, 4}), frozenset({1, 2})}, Undirected edges: set()