Closure

Computes the closure of a set of nodes XX with respect to conditioning set ZZ and ancestors AA. It can be used to find a nearest d-separator as described by van der Zander, Liśkiewicz (2020).

EDGES --> <--, <->
SETS X, Z, A
START <-- AT X
OUTPUT ...

-->, <-> | <--, <-> | next in A
...      | ...      | next in A and current not in Z