3.1.9. pywhy_graphs.algorithms.check_pag_definition#
- pywhy_graphs.algorithms.check_pag_definition(G: PAG, L: set | None = None, S: set | None = None)[source]#
Checks if the provided graph is a valid Partial Ancestral Graph (PAG).
A valid PAG as defined in [1] is a mixed edge graph that has no directed or almost directed cycles and no inducing paths between any two non-adjacent pair of nodes. It is graph representing all conditional independence (CI) statements that are present in a DAG, forming an equivalence class of DAGs that encode the same CI statements.
The steps involved in this check are as follows:
Check for any directed cycles in the PAG.
Check for any almost directed cycles in the PAG.
For every pair of non-adjacent nodes, check for inducing paths.
- Parameters:
- GGraph
The graph.
- Returns:
- is_validbool
A boolean indicating whether the provided graph is a valid PAG or not.