causal_networkx.algorithms.is_markov_equivalent#

causal_networkx.algorithms.is_markov_equivalent(graph, other_graph)[source]#

Check markov equivalence of two graphs.

For DAGs, two graphs are Markov equivalent iff. they have the same skeleton and same v-structures.

For ADMGs, two graphs are Markov equivalent iff. they are MEC in the DAG-sense and if whenever there is the same discriminating path for some node in both graphs, the node is a collider on that path in one graph iff. it is a collider on that path in the other graph.

Parameters:

graph : instance of DAG

Causal graph.

other_graph : instance of DAG

Another causal graph to compare to.

Returns:

is_mec : bool

If the two graphs are markov equivalent.

:rtype:py:class:bool