3.2.1. pywhy_graphs.algorithms.pds#
- pywhy_graphs.algorithms.pds(graph: PAG, node_x: Union[int, float, str, Any], node_y: Optional[Union[int, float, str, Any]] = None, max_path_length: Optional[int] = None) Set[Union[int, float, str, Any]] [source]#
Find all PDS sets between node_x and node_y.
- Parameters:
graph : PAG
The graph.
node_x : node
The node ‘x’.
node_y : node
The node ‘y’.
max_path_length : optional, int
The maximum length of a path to search on. By default None, which sets it to 1000.
- Returns:
dsep : set
The possibly d-separating set between node_x and node_y.
Notes
Possibly d-separating (PDS) sets are nodes V, along an adjacency paths from ‘node_x’ to some ‘V’, which has the following characteristics for every subpath triple <X, Y, Z> on the path:
Y is a collider, or
Y is a triangle (i.e. X, Y and Z form a complete subgraph)
If the path meets these characteristics, then ‘V’ is in the PDS set.
If Y is a triangle, then it will be uncertain with circular edges due to the fact that it is a shielded triple, not allowing us to infer that it is a collider. These are defined in [1] and [2].
References