Package edu.cmu.tetrad.search.utils
Class R5R9Dijkstra.Graph
java.lang.Object
edu.cmu.tetrad.search.utils.R5R9Dijkstra.Graph
- Enclosing class:
R5R9Dijkstra
Represents a graph for Dijkstra's algorithm. This wraps a Tetrad graph and provides methods to get neighbors and
nodes. The nodes are just the nodes in the underlying Tetrad graph, and neighbors are determined dynamically
based on the edges in the graph. There are two modes of operation, one for potentially directed graphs and one
for nondirected graphs. In the potentially directed mode, the algorithm will only traverse edges that are
semidirected, i.e., edges that are all directable in one direction but not the other. This is suitable for R9. In
the nondirected mode, the algorithm will traverse nondirected edges only in both directions. This is suitable for
R5.
-
Constructor Summary
ConstructorsConstructorDescriptionGraph
(Graph graph, R5R9Dijkstra.Rule rule) Represents a graph for Dijkstra's algorithm. -
Method Summary
Modifier and TypeMethodDescriptiongetNeighbors
(Node node) Retrieves the filtered neighbors of a given node.getNodes()
Retrieves the nodes in the graph.
-
Constructor Details
-
Graph
Represents a graph for Dijkstra's algorithm. This wraps a Tetrad graph and provides methods to get neighbors and nodes. The nodes are just the nodes in the underlying Tetrad graph, and neighbors are determined dynamically based on the edges in the graph.- Parameters:
graph
- The Tetrad graph to wrap.rule
- The rule to implement, R5 or R9.
-
-
Method Details
-
getNeighbors
Retrieves the filtered neighbors of a given node.- Parameters:
node
- The node for which to retrieve the neighbors.- Returns:
- The filtered neighbors of the given node.
-
getNodes
-