diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Fas.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Fas.java index 435cfbc710..cd07b3d3ac 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Fas.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Fas.java @@ -158,7 +158,7 @@ public Graph search() { this.logger.log("info", "Starting Fast Adjacency Search."); sepset = new SepsetMap(); - sepset.setReturnEmptyIfNotSet(sepsetsReturnEmptyIfNotFixed); +// sepset.setReturnEmptyIfNotSet(sepsetsReturnEmptyIfNotFixed); int _depth = depth; diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetMap.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetMap.java index 2c520a54fc..fde034087d 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetMap.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetMap.java @@ -53,7 +53,7 @@ public final class SepsetMap implements TetradSerializable { private Map> parents = new HashMap<>(); private Set> correlations; - private boolean returnEmptyIfNotSet = false; + private boolean returnEmptyIfNotSet = true; //=============================CONSTRUCTORS===========================// @@ -107,11 +107,13 @@ public List get(Node a, Node b) { return Collections.emptyList(); } - if (returnEmptyIfNotSet && sepsets.get(pair) == null) { + List nodes = sepsets.get(pair); + + if (returnEmptyIfNotSet && nodes == null) { return Collections.emptyList(); } - return sepsets.get(pair); + return nodes; } public double getPValue(Node x, Node y) { diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetsSet.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetsSet.java index 1069845964..0c3160d630 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetsSet.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetsSet.java @@ -23,6 +23,7 @@ import edu.cmu.tetrad.graph.Node; +import java.util.Collections; import java.util.List; /** @@ -48,8 +49,7 @@ public List getSepset(Node a, Node b) { @Override public boolean isCollider(Node i, Node j, Node k) { List sepset = sepsets.get(i, k); - isIndependent(i, k, sepsets.get(i, k)); - return sepset != null && !sepset.contains(j); + return !sepset.contains(j); } @Override