graphical_models.classes.mags.ancestral_graph.AncestralGraph.remove_edges
- AncestralGraph.remove_edges(edges: Iterable, ignore_error=False)[source]
Remove all edges in
edges
from the graph, regardless of edge type.- Parameters
edges – The edges to be removed from the graph.
ignore_error – If False, raises an error when any edge does not belong to the graph.
Examples
>>> from graphical_models import AncestralGraph >>> g = AncestralGraph(directed={(1, 2), (1, 3)}, undirected={(1, 4)}) >>> g.remove_edges([(1, 4), (1, 2)]) >>> g Directed edges: {(1, 3)}, Bidirected edges: set(), Undirected edges: set()