Class DiscriminatingPath
java.lang.Object
edu.cmu.tetrad.search.utils.DiscriminatingPath
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
ConstructorsConstructorDescriptionDiscriminatingPath(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 TypeMethodDescriptionbooleanDetermines whether a discriminating path exists in the given graph.Retrieves the list of nodes that represents the collider path in the discriminating path.getV()Retrieves the middle node that forms a collider in the discriminating path.getW()Retrieves the node following the starting node in the discriminating path.getX()Retrieves the starting node of the discriminating path.getY()Retrieves the ending node of the discriminating path.toString()Returns a string representation of the DiscriminatingPath object.
-
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
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
Retrieves the starting node of the discriminating path.- Returns:
- the starting node in the discriminating path.
-
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
Retrieves the middle node that forms a collider in the discriminating path.- Returns:
- the middle node in the discriminating path.
-
getY
Retrieves the ending node of the discriminating path.- Returns:
- the ending node in the discriminating path.
-
getColliderPath
-
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.
-