Class GraphTransforms

java.lang.Object
edu.cmu.tetrad.graph.GraphTransforms

public class GraphTransforms extends Object
Transformations that transform one graph into another.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • GraphTransforms

      public GraphTransforms()
  • Method Details

    • dagFromCpdag

      public static Graph dagFromCpdag(Graph graph)

      dagFromCpdag.

      Parameters:
      graph - a Graph object
      Returns:
      a Graph object
    • dagFromCpdag

      public static Graph dagFromCpdag(Graph graph, Knowledge knowledge)
      Returns a DAG from the given CPDAG. If the given CPDAG is not a PDAG, returns null.
      Parameters:
      graph - the CPDAG
      knowledge - the knowledge
      Returns:
      a DAG from the given CPDAG. If the given CPDAG is not a PDAG, returns null.
    • pagToMag

      public static Graph pagToMag(Graph pag)
      Transforms a partially ancestral graph (PAG) into a maximally ancestral graph (MAG) using Zhang's 2008 Theorem 2.
      Parameters:
      pag - The partially ancestral graph to transform.
      Returns:
      The maximally ancestral graph obtained from the PAG.
    • generateCpdagDags

      public static List<Graph> generateCpdagDags(Graph cpdag, boolean orientBidirectedEdges)
      Generates the list of DAGs in the given cpdag.
      Parameters:
      cpdag - a Graph object
      orientBidirectedEdges - a boolean
      Returns:
      a List object
    • getDagsInCpdagMeek

      public static List<Graph> getDagsInCpdagMeek(Graph cpdag, Knowledge knowledge)
      Retrieves a list of directed acyclic graphs (DAGs) within the given completed partially directed acyclic graph (CPDAG) using the Meek rules.
      Parameters:
      cpdag - The completed partially directed acyclic graph (CPDAG) from which to retrieve the DAGs.
      knowledge - The knowledge available to check if a potential DAG violates any constraints.
      Returns:
      A List of Graph objects representing the DAGs within the CPDAG.
    • getAllGraphsByDirectingUndirectedEdges

      public static List<Graph> getAllGraphsByDirectingUndirectedEdges(Graph skeleton)
      Returns a list of all possible graphs obtained by directing undirected edges in the given graph.
      Parameters:
      skeleton - the graph to transform
      Returns:
      a list of all possible graphs obtained by directing undirected edges
    • cpdagForDag

      public static Graph cpdagForDag(Graph dag)
      Returns the completed partially directed acyclic graph (CPDAG) for a given directed acyclic graph (DAG).
      Parameters:
      dag - The input DAG.
      Returns:
      The CPDAG resulting from applying Meek Rules to the input DAG.
    • dagToPag

      @NotNull public static @NotNull Graph dagToPag(Graph trueGraph)
      Converts a Directed Acyclic Graph (DAG) to a Partial Ancestral Graph (PAG) using the DagToPag algorithm.
      Parameters:
      trueGraph - The input DAG to be converted.
      Returns:
      The resulting PAG obtained from the input DAG.