Skip to content

Commit 2a38a47

Browse files
committed
Fixed FCI bugs
Signed-off-by: ZhiyiHuang <[email protected]>
1 parent 0cdde5e commit 2a38a47

File tree

1 file changed

+3
-4
lines changed
  • causallearn/search/ConstraintBased

1 file changed

+3
-4
lines changed

causallearn/search/ConstraintBased/FCI.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ def existOnePathWithPossibleParents(self, previous, node_w: Node, node_x: Node,
8282
continue
8383

8484
if self.existsSemidirectedPath(node_r, node_x, graph) or self.existsSemidirectedPath(node_r, node_b, graph):
85-
if self.existOnePathWithPossibleParents(previous, node_r, node_x, node_b, graph):
86-
return True
85+
return True
8786
return False
8887

8988
def getPossibleDsep(self, node_x: Node, node_y: Node, maxPathLength: int) -> Set[Node]:
@@ -108,7 +107,7 @@ def getPossibleDsep(self, node_x: Node, node_y: Node, maxPathLength: int) -> Set
108107
if node_list is None:
109108
node_list = []
110109
node_list.append(node_b)
111-
# previous[node_x] = node_list
110+
previous.update({node_x: node_list})
112111
dsep.add(node_b)
113112

114113
while not Q.empty():
@@ -136,7 +135,7 @@ def getPossibleDsep(self, node_x: Node, node_y: Node, maxPathLength: int) -> Set
136135
if node_list is None:
137136
node_list = []
138137
node_list.append(node_b)
139-
# previous[node_c] = node_list
138+
previous.update({node_c: node_list})
140139

141140
# isDefCollider
142141
edge1 = self.graph.get_edge(node_a, node_b)

0 commit comments

Comments
 (0)