graph.isMaximal

pyagrum.graph.isMaximal(g)

Whether an ancestral graph (family K) is maximal: two non adjacent nodes are always m-separated by some set of nodes.

Parameters:

g (MarkedGraph | PAG | MAG) – the graph, supposed ancestral

Returns:

True if the graph is maximal (always True for a MAG)

Return type:

bool

References

T. Richardson, P. Spirtes. Ancestral graph Markov models. The Annals of Statistics 30(4):962-1030, 2002.

Example

import pyagrum as gum
import pyagrum.graph as gg

gg.isMaximal(gum.fastMarkedGraph("A->B<->C"))
# True
gg.isMaximal(gum.fastMarkedGraph("A<->B<->C<->D;B->D;C->A"))  # inducing path A<->B<->C<->D
# False