causal_networkx.algorithms.discriminating_path#

causal_networkx.algorithms.discriminating_path(graph, u, a, c, max_path_length)[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 : int

The maximum distance to check in the graph.

Returns:

explored_nodes : dict

A hash map of explored nodes.

found_discriminating_path : bool

Whether or not a discriminating path was found.

disc_path : list

The discriminating path starting from node c.