Package edu.cmu.tetrad.search
Class PermutationSearch
java.lang.Object
edu.cmu.tetrad.search.PermutationSearch
Implements common elements of a permutation search. The specific parts for each permutation search are implemented as a SuborderSearch.
This class specifically handles an optimization for tiered knowledge, whereby tiers in the knowledge can be searched one at a time in order from the lowest to highest, taking all variables from previous tiers as a fixed previs for a later tier. This allows these permutation searches to search over many more variables than otherwise, so long as tiered knowledge is available to organize the search.
This class is configured to respect the knowledge of forbidden and required edges, including knowledge of temporal tiers.
- Author:
- bryanandrews
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPermutationSearch
(SuborderSearch suborderSearch) Constructs a new PermutationSearch using the given SuborderSearch. -
Method Summary
Modifier and TypeMethodDescriptionstatic Graph
Construct a graph given a specification of the parents for each node.static Graph
Construct a graph given a specification of the parents for each node.Returns the variables.search()
Performe the search and return a CPDAG.void
setKnowledge
(Knowledge knowledge) Sets the knowledge to be used in the search.void
setVerbose
(boolean verbose) Sets whether verbose output should be printed.
-
Constructor Details
-
PermutationSearch
Constructs a new PermutationSearch using the given SuborderSearch.- Parameters:
suborderSearch
- The SuborderSearch (see).- See Also:
-
-
Method Details
-
search
Performe the search and return a CPDAG.- Returns:
- The CPDAG.
-
getGraph
Construct a graph given a specification of the parents for each node.- Parameters:
nodes
- The nodes.parents
- A map from each node to its parents.cpDag
- Whether a CPDAG is wanted, if false, a DAG.- Returns:
- The construted graph.
-
getGraph
public static Graph getGraph(List<Node> nodes, Map<Node, Set<Node>> parents, Knowledge knowledge, boolean cpDag) Construct a graph given a specification of the parents for each node.- Parameters:
nodes
- The nodes.parents
- A map from each node to its parents.knowledge
- the knoweldge to use to construct the graph.cpDag
- Whether a CPDAG is wanted, if false, a DAG.- Returns:
- The construted graph.
-
getVariables
Returns the variables.- Returns:
- This lsit.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Parameters:
verbose
- True if so.
-
setKnowledge
Sets the knowledge to be used in the search.- Parameters:
knowledge
- This knowledge.
-