3.1.4. pywhy_graphs.algorithms.discriminating_path#
- pywhy_graphs.algorithms.discriminating_path(graph: PAG, u: Union[int, float, str, Any], a: Union[int, float, str, Any], c: Union[int, float, str, Any], max_path_length: Optional[int] = None) Tuple[bool, List[Union[int, float, str, Any]], Set[Union[int, float, str, Any]]] [source]#
Find the discriminating path for <…, a, u, c>.
A discriminating path, p = <v, …, a, u, c>, is one where: - p has at least 3 edges - u is non-endpoint and u is adjacent to c - v is not adjacent to c - every vertex between v and u is a collider on p and parent of c
- Parameters:
graph : PAG
PAG to orient.
u : node
A node in the graph.
a : node
A node in the graph.
c : node
A node in the graph.
max_path_length : optional, int
The maximum distance to check in the graph. By default None, which sets it to 1000.
- Returns:
explored_nodes : set
A set of explored nodes.
disc_path : list
The discriminating path starting from node c.
found_discriminating_path : bool
Whether or not a discriminating path was found.