3.1.4. pywhy_graphs.algorithms.discriminating_path#

pywhy_graphs.algorithms.discriminating_path(graph: PAG, u: int | float | str | Any, a: int | float | str | Any, c: int | float | str | Any, max_path_length: int | None = None) Tuple[bool, List[int | float | str | Any], Set[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:
graphPAG

PAG to orient.

unode

A node in the graph.

anode

A node in the graph.

cnode

A node in the graph.

max_path_lengthoptional, int

The maximum distance to check in the graph. By default None, which sets it to 1000.

Returns:
explored_nodesset

A set of explored nodes.

disc_pathlist

The discriminating path starting from node c.

found_discriminating_pathbool

Whether or not a discriminating path was found.