pywhy_graphs.algorithms.inducing_path#

pywhy_graphs.algorithms.inducing_path(G, node_x: int | float | str | Any, node_y: int | float | str | Any, L: Set | None = None, S: Set | None = None)[source]#

Checks if an inducing path exists between two nodes.

An inducing path is defined in [1].

Parameters:
GGraph

The graph.

node_xnode

The source node.

node_ynode

The destination node.

LSet

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:
pathTuple[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