diff --git a/pywhy_graphs/algorithms/pag.py b/pywhy_graphs/algorithms/pag.py index 042ea9bc9..f7a2d1fe9 100644 --- a/pywhy_graphs/algorithms/pag.py +++ b/pywhy_graphs/algorithms/pag.py @@ -7,9 +7,12 @@ import numpy as np from pywhy_graphs import ADMG, CPDAG, PAG, StationaryTimeSeriesPAG -from pywhy_graphs.algorithms.generic import single_source_shortest_mixed_path +from pywhy_graphs.algorithms.generic import single_source_shortest_mixed_path, valid_mag from pywhy_graphs.typing import Node, TsNode +from dodiscover.constraint.fcialg import FCI +from dodiscover.ci import Oracle + logger = logging.getLogger() __all__ = [ @@ -1193,4 +1196,13 @@ def valid_pag(G: PAG): is_valid : bool The MAG constructed from the PAG. """ + + # check if the graph is a vald PAG + converted_mag = pag_to_mag(G) + valid_mag = valid_mag(converted_mag) + + # convert the mag back to a pag + + # check if the converted pag is equivalent to the original + return True \ No newline at end of file