causaldag.classes.dag.DAG.incoming_arcs

DAG.incoming_arcs(node: Hashable) → Set[Tuple[Hashable, Hashable]][source]

Return all arcs with target node.

Parameters:node – The node.
Returns:Return all arcs of the form i->``node``.
Return type:Set[arc]

Example

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