pywhy_graphs.algorithms.inducing_path#
- pywhy_graphs.algorithms.inducing_path(G, node_x: Union[int, float, str, Any], node_y: Union[int, float, str, Any], L: Optional[Set] = None, S: Optional[Set] = None)[source]#
Checks if an inducing path exists between two nodes.
An inducing path is defined in [1].
- Parameters:
G : Graph
The graph.
node_x : node
The source node.
node_y : node
The destination node.
L : Set
Nodes that are ignored on the path. Defaults to an empty set. See Notes for details.
S: Set
Nodes that are always conditioned on. Defaults to an empty set. See Notes for details.
- Returns:
path : Tuple[bool, path]
A tuple containing a bool and a path if the bool is true, an empty list otherwise.
Notes
An inducing path intuitively is a path between two non-adjacent nodes that cannot be d-separated. Therefore, the path is always “active” regardless of what variables we condition on. L contains all the non-colliders, these nodes are ignored along the path. S contains nodes that are always conditioned on (hence if the ancestors of colliders are in S, then those collider paths are always “active”).
References