Class DiscriminatingPath

java.lang.Object
edu.cmu.tetrad.search.utils.DiscriminatingPath

public class DiscriminatingPath extends Object
Represents a discriminating path in a graph.

The path has the form <X, ..., W, V, Y>, where: - V is the discriminated vertex, - V is adjacent to Y on the path, - X is not adjacent to Y (in the strict/original setting), - every vertex between X and V is a collider on the path and a parent of Y.

The colliderPath field stores the subpath from X to V excluding X and V but including W. Its order is from W backward toward X, matching the historical Tetrad convention; thus, if the full path is <X, A, ..., W, V, Y>f, colliderPath is [W, ..., A].

  • Constructor Summary

    Constructors
    Constructor
    Description
    DiscriminatingPath(Node x, Node w, Node v, Node y, LinkedList<Node> colliderPath, boolean checkXyNonadjacency)
    Constructs a DiscriminatingPath object with the specified parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsIn(Graph graph)
    Determines whether a discriminating path exists in the given graph.
    Retrieves the list of nodes that represents the collider path in the discriminating path.
    Retrieves the middle node that forms a collider in the discriminating path.
    Retrieves the node following the starting node in the discriminating path.
    Retrieves the starting node of the discriminating path.
    Retrieves the ending node of the discriminating path.
    Returns a string representation of the DiscriminatingPath object.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DiscriminatingPath

      public DiscriminatingPath(Node x, Node w, Node v, Node y, LinkedList<Node> colliderPath, boolean checkXyNonadjacency)
      Constructs a DiscriminatingPath object with the specified parameters.
      Parameters:
      x - the starting node in the discriminating path.
      w - the node following x in the discriminating path.
      v - the middle node that forms a collider in the path.
      y - the ending node in the discriminating path.
      colliderPath - the list of nodes that represents the collider path between nodes.
      checkXyNonadjacency - a flag indicating whether non-adjacency between certain nodes should be checked.
  • Method Details

    • existsIn

      public boolean existsIn(Graph graph)
      Determines whether a discriminating path exists in the given graph.

      The method evaluates specific conditions such as adjacency, collider properties, and path structure to verify the existence of the discriminating path that starts with a sequence of nodes and satisfies the required constraints.

      Parameters:
      graph - the graph in which to verify the existence of the discriminating path.
      Returns:
      true if the discriminating path exists in the graph; false otherwise.
    • getX

      public Node getX()
      Retrieves the starting node of the discriminating path.
      Returns:
      the starting node in the discriminating path.
    • getW

      public Node getW()
      Retrieves the node following the starting node in the discriminating path.
      Returns:
      the node immediately after the starting node in the discriminating path.
    • getV

      public Node getV()
      Retrieves the middle node that forms a collider in the discriminating path.
      Returns:
      the middle node in the discriminating path.
    • getY

      public Node getY()
      Retrieves the ending node of the discriminating path.
      Returns:
      the ending node in the discriminating path.
    • getColliderPath

      public List<Node> getColliderPath()
      Retrieves the list of nodes that represents the collider path in the discriminating path.
      Returns:
      a list of nodes constituting the collider path.
    • toString

      public String toString()
      Returns a string representation of the DiscriminatingPath object. The string provides a detailed view of the object's fields including the starting node, intermediate nodes, ending node, and the collider path.
      Overrides:
      toString in class Object
      Returns:
      a string describing the DiscriminatingPath object and its field values.