SlowGuess/NeurIPS_2023_OCR huggingface dataset:
For any edge type proposed in the edge union definition, there are relevant instances of  $k$ -essential graphs. In Figure 2, the edges  $a-b$ ,  $ao \rightarrow c$ ,  $c \leftarrow b$  appear in the  $k$ -essential graph. Similarly, the  $k$ -essential graph of  $D$  in Figure 8 will contain the edge  $co-od$  since  $c \rightarrow d$ ,  $c \leftarrow d$ ,  $c \leftrightarrow d$  are all possible edges in different Markov equivalent  $k$ -closures. Figure 9 in Section D.3 shows an instance where  $\leftrightarrow$  appears in the  $k$ -essential graph. This example also demonstrates that our representation is strictly richer than the graph union that is recovered by LOCI [23], which orients  $d \rightarrow c$ ,  $a \rightarrow c$ , and hence cannot distinguish them from the possible edges between  $c \leftarrow b$  unlike our representation. Similarly, consider the simple graph  $u \rightarrow v$  with  $k = 0$ . Our representation yields  $u - v$  since there is no DAG where  $u, v$  are confounded in any way other than the direct edge. In a triangle graph  $w \rightarrow u$ ,  $w \rightarrow v$ ,  $u \rightarrow v$ , our representation recovers  $uo-ov$  which shows there are graphs where  $u, v$  do not cause each other. LOCI cannot make such distinction as it uses  $u - v$  in both graphs.
Therefore, the variant edges that can be arrowheads or tails among different  $k$ -Markov equivalent graphs are replaced with circles and invariant arrowheads and invariant tails are preserved in the  $k$ -essential graph. Thus,  $k$ -essential graph captures the causal information that is preserved across all  $k$ -Markov equivalent causal graphs. Different from essential graphs where we can test all the
<sup>1</sup>The reader will notice  $k$ -essential graph visually resembles a partial ancestral graph (PAG) [25] more than an essential graph due to the circle marks. Our choice of the name  $k$ -essential is motivated by the fact that we assume no latent confounders in the system and thus it positions our work better with respect to the related work.
Algorithm 1  $k$ -PC Algorithm
Input: Observational Data,  $\mathcal{V}$ ,  $k$ , CI Tester (.  $\perp$  .|).
Step 0: Initiate a complete graph  $K$  between  $\mathcal{V}$  with circle edges  $o - o$ .
Step 1: Find separating sets  $S_{a,b}$  for every pair  $a, b \in \mathcal{V}$  by conditioning on subsets of size at most  $k$ .
Step 2: Update  $K$  by removing the edges between pairs that are separable.
Step 3: Orient unshielded colliders of  $K$ : For any induced subgraph  $a o - o c o - o b$ , set  $a o \rightarrow c \leftarrow o b$  for any non-adjacent pair  $a, b$  where  $S_{a, b}$  does not contain  $c$ .
Step 4:  $K\gets \mathrm{FCI\_Orient}(K)$  # See Algorithm 2 in Section B.
Step 5: For any node  $a$  that has no incoming edges (i.e.,  $a \leftrightarrow, a \leftrightarrow, a \leftrightarrow o$ ) construct the sets  $\mathcal{B}, \mathcal{C}$ :
$$
\mathcal {B} = \{b \in N e (a): a o \rightarrow b \}, \quad \mathcal {C} = \{c \in N e (a): a o - o c \}
$$
and define sets  $\mathcal{B}^*$  as the set of nodes that are non-adjacent to any of the nodes in  $C$  and  $\mathcal{C}^*$  as the set of nodes that are non-adjacent to other nodes in  $C$ :
$$
\mathcal {B} ^ {*} = \{b \in \mathcal {B}: b, c \text {a r e n o n - a d j a c e n t} \forall c \in C \}, \quad \mathcal {C} ^ {*} = \left\{c ^ {\prime} \in \mathcal {C}: c ^ {\prime}, c \text {a r e n o n - a d j a c e n t} \forall c ^ {\prime} \neq c, c ^ {\prime} \in \mathcal {C} \right\}
$$
-  $\mathcal{R}11$ : Orient  $a o \to b$  as  $a \to b, \forall b \in \mathcal{B}^*$ .
-  $\mathcal{R}12$ : Orient  $ao$ — $oc$  as  $a - c, \forall c \in \mathcal{C}^*$ .
Output:  $K$
conditional independence relations, existence of an arrow  $a \to b$  in a  $k$ -essential graph does not mean  $a$  causes  $b$  in every  $k$ -Markov equivalent DAG. Rather, it means that in any  $k$ -Markov equivalent DAG where  $a, b$  are adjacent,  $a$  causes  $b$ .
It is worth noting that  $k$ -essential graphs are in general more informative than partial ancestral graphs (PAGs), which are defined as the edge union of all Markov equivalent MAGs, where the union of  $\leftarrow, \rightarrow \right.$  is defined to give  $o - o$  instead of the undirected edge. Since every Markov equivalent  $k$ -closure graph is a MAG but not every Markov equivalent MAG is a  $k$ -closure graph, in general  $k$ -essential graphs may have invariant arrowheads and tails where PAGs only have circles. We call any graph that contains arrowheads, tails, or circles as edge marks a partial mixed graph (PMG).
Definition 3.17. For two partial mixed graphs  $A, B$  with the same skeleton,  $A$  is said to be a subset of  $B$ , shown by  $A \subseteq B$ , iff the following conditions hold for any pair  $a, b$
$$
1. (a - * b) _ {A} \Leftarrow (a - * b) _ {B}, \quad 2. (a \leftarrow * b) _ {A} \Leftarrow (a \leftarrow * b) _ {B}. \tag {1}
$$
Note that asterisk  $*$  stands for a wild-card which can either be an arrowhead, tail, or circle. According to the definition, any circle mark in  $A$  is also a circle mark in  $B$ . We have the following lemma that relates  $k$ -essential graphs to partial ancestral graphs of  $k$ -closures.
Lemma 3.18.  $\varepsilon_{k}(D)\subseteq PAG(\mathcal{C}_{k}(D))$
Proof. By Theorem 3.9, every  $k$ -closure graph is a MAG whereas every MAG is not a  $k$ -closure graph. Thus the set of Markov equivalent  $k$ -closure graphs form a subset of the set of Markov equivalent MAGs. Thus, the arrowheads and tails that appear in all Markov equivalent MAGs must also appear in all the Markov equivalent  $k$ -closure graphs. The result follows from Definition 3.17.  $\square$
In the next section, we propose a sound algorithm for learning  $k$ -essential graphs from data.
4 Learning  $k$ -essential Graphs
Constraint-based causal discovery algorithms use CI tests to extract all the causal knowledge that can be identified from data. In the previous section, we proposed a compact graphical characterization of what is learnable from such statistical tests. In this section, we propose a constraint-based learning algorithm. Since  $k$ -closure graphs are a special class of maximal ancestral graphs, we can use FCI algorithm that is devised for learning the invariant arrowheads and tails of a maximal ancestral graph.
FCI algorithm is sound and complete for learning PAGs: It can recover all invariant arrowheads and all invariant tails. One might think that FCI algorithm may also be sound and complete for our task. However, this is not true. Although sound, FCI is not complete for learning  $k$ -essential graphs. $^2$
For soundness, we need the following lemma, which shows that discriminating paths do not carry extra information about the underlying causal structure.
Lemma 4.1. In any  $k$ -closure graph, if there is a discriminating path  $p$  for  $\langle u, Y, v \rangle$  and  $u \leftrightarrow Y \leftarrow *v$  is a collider along  $p$ , then the orientations  $u * \rightarrow Y$  and  $Y \leftarrow *v$  can be learned by first finding all unshielded colliders, and then applying the orientation rules  $\mathcal{R}1$  and  $\mathcal{R}2$  of  $FCI$ .
The above lemma shows that the colliders that are part of discriminating paths can be learned by simply orienting the unshielded colliders and then applying the orientation rules of FCI. This is useful since we do not need to search for colliders along discriminating paths during learning.
Our constraint-based causal discovery algorithm, called  $k$ -PC, is given in Algorithm 1. It uses FCI Orient algorithm in Section B, with two extra rules specific for learning  $k$ -essential graph.
Corollary 4.2.  $k$ -PC without Step 5 is sound and complete for learning  $PAG(\mathcal{C}_k(D))$  of any DAG  $D$ .
Proof. By Lemma A.18, any non-adjacent pair are separable by a set of size at most  $k$ . Thus, a valid separating set for any non-adjacent pair will be found in Step 1, and will be used to learn the skeleton in Step 2, and to orient all unshielded colliders in Step 3. [25] proved arrowhead and tail completeness of FCI with orientation rules  $\mathcal{R}1$  to  $\mathcal{R}10$ . By Lemma 4.1, colliders on discriminating paths will be oriented at the end of Step 4. Thus,  $\mathcal{R}4$  that is concerned with discriminating path colliders is not applicable. Similarly,  $\mathcal{R}5$ ,  $\mathcal{R}6$ ,  $\mathcal{R}7$  are only applicable in graphs with selection bias. Thus, they are not applicable. Since the rules that we omit are never applicable during the execution of the algorithm, Step 4 correctly returns the  $\mathrm{PAG}(\mathcal{C}_k(D))$  since the algorithm at that point is identical to the FCI algorithm for learning PAGs.
Definition 4.3. A distribution  $p$  is said to be  $k$ -faithful to a causal graph  $D = (V, E)$ , iff  $(a \perp b | c)_p$  implies  $(a \perp b | c)_D$  for all  $c \subset V : |c| \leq k$ .
Theorem 4.4.  $k$ -PC algorithm is sound for learning  $k$ -essential graph given a conditional independence oracle under the causal Markov and  $k$ -faithfulness assumptions, i.e., if  $k$ -PC returns  $K$ , we have  $\varepsilon_k(D) \subseteq K \subseteq PAG(\mathcal{C}_k(D))$
Proof Sketch. From Corollary 4.2,  $K$  obtained at the end of Step 4 is  $\mathrm{PAG}(\mathcal{C}_k(D))$  and by Lemma 3.18 we know  $\varepsilon_k(D) \subseteq \mathrm{PAG}(\mathcal{C}_k(D))$ , i.e., every edge and tail orientation of  $K$  is consistent with  $\varepsilon_k(D)$ . Thus, we only need to show that orientation rules  $\mathcal{R}11$ ,  $\mathcal{R}12$  are sound, i.e., there exists no  $k$ -closure graph in the Markov equivalence class that is inconsistent with these orientation rules. By Lemma A.2, we know that if  $a \leftrightarrow x$  for some  $x$ , then conditioned on any subset of size  $k$ , there exists a d-connecting path that starts with arrow at  $a$  and  $x$ . This means that, irrespective of  $k$ ,  $a$  must have some incoming edge. The rules use this fact together with the fact that if there were two incoming edges from two non-adjacent neighbors, this would create an unshielded collider, which would change the Markov equivalence class. Please see Section A.8 for the proof.
For two sample runs of the algorithm, please see Figure 5 and Figure 6 in Section C of Appendix. Note also that our algorithm can be seen as an improved version of AnytimeFCI algorithm [18] for causally sufficient systems, which the author shows can be stopped once every conditioning set of size at most  $k$  are tested. While FCI aims at learning arbitrary PAGs partially,  $k$ -PC learns  $k$ -closure graphs for causally sufficient systems. This allows extracting more causal information, evidenced by the additional orientation rules employed by  $k$ -PC. For more details on the differences and an example where AnytimeFCI is less informative than  $k$ -PC, please see Section D.7.
Computational Complexity. Suppose we are given two causal graphs. Our characterization gives an algorithmic way of testing  $k$ -Markov equivalence: Construct the  $k$ -closure graphs given the two DAGs and check whether they are Markov equivalent. The step to make two variables adjacent requires one to loop through all conditioning sets of size at most  $k$ . This would take  $\mathcal{O}(n^k)$ . This is the main time-consuming step. Afterward, one can test Markov equivalence using the existing
It is worth noting that FCI uses undirected edges to represent selection bias. We use undirected edges for a different purpose. Thus, orientation rules of FCI aimed at orienting undirected edges should not be used here.
(a) Arrowhead  $F_{1}$  Score
(b) Tail  $F_{1}$  Score
(c) Skeleton  $F_{1}$  Score
(d) Arrowhead  $F_{1}$  Score
(e) Tail  $F_{1}$  Score
(f) Skeleton  $F_{1}$  Score
Figure 3: Empirical cumulative distribution function of various  $F_{1}$  scores on 100 random DAGs on 10 nodes. For each DAG, conditional probability tables are independently and uniformly randomly filled from the corresponding probability simplex. Three datasets are sampled per model instance. The lower the curve the better. The maximum number of edges is 15.  $N$  is the number of data samples.
approaches. For example, [7] show that this can be done in  $\mathcal{O}(ne^2 + n^2 e)$  time, where  $e$  is the number of edges. Thus, the overall algorithm will indeed be polynomial-time when  $k = \mathcal{O}(1)$ .
The complexity of the learning algorithm,  $k$ -PC, will be similar to Anytime FCI, an early-stopped version of FCI [18]. Although this is more complicated and would depend on other parameters in the graph, such as primitive inducing paths, and thus the number and location of unobserved confounders, we can also roughly bound this by  $\mathcal{O}(n^{k + 2})$  since for any pair, we will not be searching for separating sets beyond the  $\mathcal{O}(n^k)$  subsets of size at most  $k$ . Further runtime improvements, such as RFCI by [6] might be possible, but this requires a further understanding of the structure of  $k$ -closure graphs.
5.1 Synthetic Data
In this section, we test our algorithm against the stable version of PC algorithm in causal-learn package. We randomly sample DAGs using the pyAgrum package. Variation of this experiment with a different sparsity level can be found in Section E.3 and gives similar results. All variables are binary with conditional probability tables filled randomly uniformly from the corresponding dimensional probability simplex, except the linear SCM experiments for comparing with NOTEARS. We observed similar results with a larger number of states, which are not reported. We report the  $F_{1}$  scores for identifying arrowheads, tails and skeleton correctly. The results are given in Figure 3. We observe that  $k$ -PC provides significant improvement to the arrowhead  $F_{1}$  score in the small-sample regime at little cost to the tail score.  $k$ -PC also helps improve skeleton discovery. Similar improvements are seen even for 10 samples whereas the advantage disappears for more than 500 samples (see Section E.3) since PC becomes reliable enough and  $k$ -PC does not use some of the informative CI tests in that high-sample regime. We report combined metrics such as the sum of all  $F_{1}$  scores in Section E.4.
In Section E.5, we compare with the conservative version of PC [14] and observe similar results. In Section E.2 we generate linear SCMs randomly and compare the performance of our algorithm with NOTEARS in addition to PC. Even though NOTEARS performs slightly better than PC in general,  $k$ -PC maintains an advantage over both in the small-sample regime. In Section E.1, we compare our algorithm with LOCI [23]. As expected, the two algorithms perform similarly. We observe that our algorithm shows better arrowhead and skeleton  $F_{1}$  score performance. As a side note, we show that
(a) Ground Truth
(b)  $k$ -PC,  $k = 0$
(c)  $k$ -PC,  $k = 1$
(d) PC Alg.
Figure 4: Causal discovery on Asia dataset using 500 random samples.  $k$ -PC can learn the approximate causal order and some edges accurately, whereas PC outputs a very sparse graph since it conditions on subsets of size 2, which over-sparsifies the graph. For example,  $k$ -PC with  $k = 1$  can recover that  $X_{2}$  is an ancestor of  $X_{6}$ , which is an ancestor of  $X_{7}$ , whereas PC cannot.
$k$ -PC output is at least as informative as LOCI in Section D.6. See Section D for further discussions. The Python code is provided at https://github.com/CausalML-Lab/kPC.
5.2 Semi-synthetic Data
We test our algorithm on the semi-synthetic Asia dataset from bnlearn repository and compare it with PC algorithm. The dataset contains 8 binary variables. We randomly sample 500 datapoints from the observational distribution and run PC as well as  $k$ -PC for  $k = 0$  and  $k = 1$ .  $k$ -PC for  $k = 0$  correctly gets some of the causal and ancestral relations (Figure 4). PC, on the other hand, recovers a very sparse graph as it utilizes unreliable conditional independence tests with conditioning size of 2.  $k$ -PC with  $k = 1$  recovers a graph in-between the two, still more informative about the structure than PC.
A limitation of the method is that it assumes all independence statements up to degree  $k$  can be tested for some  $k$ . In some cases, the set of available, or the set of reliable CI statements might not have such a structure. Our method is not directly applicable in such scenarios. Another limitation is that we assume that we can run CI tests for the tests that are deemed reliable. This is a non-trivial problem when the data is non IID, such as time-series data. We also make some other usual assumptions that are commonly made in causal discovery, such as acyclicity.
For more remarks, such as a demonstration of incompleteness of  $k$ -PC, please see Section D.
We proposed a new notion of equivalence between causal graphs called the  $k$ -Markov equivalence. This new equivalence allows us to learn parts of the causal structure from data without relying on CI tests with large conditioning sets that tend to be unreliable. We showed that our learning algorithm is sound, and demonstrated that it can help correct some errors induced by other algorithms in practice.
This research has been supported in part by NSF CAREER 2239375. We would like to thank Marcel Wienobst for his insightful comments and suggestions on an earlier version of the manuscript that led to a more thorough comparison with LOCI [23]. We would like to also thank the anonymous reviewers for their constructive comments and feedback during the review process.
[22] Tom S Verma and Judea Pearl. Equivalence of causal models. 1990.
[23] Marcel Wienobst and Maciej Liskiewicz. Recovering causal structures from low-order conditional independencies. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 10302-10309, 2020.
[24] Jiji Zhang. Causal reasoning with ancestral graphs. Journal of Machine Learning Research, 9:1437-1474, 2008.
[25] Jiji Zhang. On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16-17):1873-1896, 2008.
[26] Junzhe Zhang and Elias Bareinboim. Fairness in decision-making—the causal explanation formula. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
[27] Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target and conditional shift. In International Conference on Machine Learning, pages 819-827. PMLR, 2013.
[28] Xun Zheng, Bryon Aragam, Pradeep K Ravikumar, and Eric P Xing. Dags with no tears: Continuous optimization for structure learning. Advances in neural information processing systems, 31, 2018.
In this section, we provide proofs for the lemmas and theorems in the paper. We also present FCI orientation rules for completeness, demonstrate why  $k$ -PC is incomplete, and give two sample runs of the  $k$ -PC algorithm. Each subsection starts from a new page to clearly separate the proofs of different lemmas/theorems.
A.1 Proof of Lemma 3.6
We will crucially use the following three lemmas to prove our main results. We say a collider  $\langle u, v, w \rangle$  is closed, or blocks the path in context if no node in  $De(v)$  is in the conditioning set. Similarly, a path is called closed if it is not d-connecting, and open otherwise.
Lemma A.1. Consider a DAG where  $X \notin \mathsf{An}(Y)$ . Suppose there is a  $d$ -connecting path  $p$  between  $X, Y$  given  $T$  that starts with an arrow out of  $X$ .
1. There is at least one collider along  $p$ .
2. Let  $K$  be the collider closest to  $X$  on  $p$ . Then conditioning on  $T' = T - De(K)$  instead of  $T$  does not introduce new  $d$ -connecting paths that start with an arrowhead at  $X$ .
Proof. 1. Any path that starts with  $X \to \ldots$  must either be directed, or there must be at least one collider along the path. Since the path is between  $X, Y$  and  $X \notin An(Y)$ , it must be that the path has at least one collider on it.
2. First note that without loss of generality,  $p$  has the following form for some integer  $m \geq 0$  ( $m = 0$  means  $X \to K$ ):
$$
X \rightarrow U _ {1} \rightarrow U _ {2} \dots \rightarrow U _ {m} \rightarrow K \leftarrow \dots Y. \tag {2}
$$
Suppose for the sake of contradiction that conditioned on  $T'$  there is a new d-connecting path  $q$  that starts with an arrowhead into  $X$ .  $q$  was clearly closed conditioned on  $T$  and become open by us removing nodes from the conditioning set  $T$ . This can only happen if we removed some node from  $T$  that is a non-collider along  $q$ . Consider the non-collar we removed that was closest to  $X$ , call this  $M$ . Thus, we have the path  $q$  that looks like this:
$$
X \leftarrow W \dots M \dots Y, \tag {3}
$$
for some  $W$ , where  $M$  is a non-collider on this path and is in  $De(K)$ .
We observe that the subpath between  $M$  and  $X$  cannot be directed from  $M$  to  $X$ . Because this would create the following cycle:
$$
M \rightarrow \dots \rightarrow X \rightarrow U _ {1} \dots U _ {m} \rightarrow K \rightarrow \dots \rightarrow M. \tag {4}
$$
Thus a closer look at the path  $q$  reveals the following structure for some integer  $m'$  and node  $V$ :
$$
X \leftarrow W _ {1} \leftarrow W _ {2} \dots \leftarrow W _ {m ^ {\prime}} \rightarrow V \dots M \dots Y \tag {5}
$$
We will consider the following two cases: The edge adjacent to  $M$  along the subpath between  $W_{m'}$  and  $M$  is a tail or an arrowhead.
Suppose the edge adjacent to  $M$  along the subpath between  $W_{m'}$  and  $M$  is a tail: This means there is at least one collider between  $W_{m'}$  and  $M$ . Any such collider must be active since  $q$  is active given  $T'$ . Consider the collider that is closest to  $M$ . Since it is active, this collider must be an ancestor of  $T'$ . However, observe that  $K$  is an ancestor of this collider which implies that  $K$  is an ancestor of  $T'$  as well. However, we obtained  $T'$  by removing all descendants of  $K$  from  $T$ , which is a contradiction.
This establishes that the edge adjacent to  $M$  along the subpath between  $W_{m'}$  and  $M$  is an arrowhead. Thus, this reveals the following structure for  $q$ :
$$
X \leftarrow W _ {1} \leftarrow W _ {2} \dots \leftarrow W _ {m ^ {\prime}} \rightarrow \dots \rightarrow M \dots Y \tag {6}
$$
Suppose the directed path from  $K$  to  $M$  is as follows:
$$
K \rightarrow \theta_ {1} \rightarrow \dots \theta_ {m ^ {\prime \prime}} \rightarrow M \tag {7}
$$
Recall that  $M$  is a non-collider along  $q$ . Thus the subpath of  $q$  between  $M$  and  $Y$  must start with a tail as  $M \to \ldots Y$ . Now observe that if the subpath of  $q$  between  $M$  and  $Y$  had no collider, then we would have the following directed path from  $X$  to  $Y$ :
$$
X \rightarrow U _ {1} \rightarrow U _ {m} \rightarrow K \rightarrow \theta_ {1} \rightarrow \dots \rightarrow \theta_ {m ^ {\prime \prime}} \rightarrow M \rightarrow \dots Y \tag {8}
$$
However, we know  $X$  is a non-ancestor of  $Y$ . Thus, there must be at least one collider between  $M$  and  $Y$  along  $p$ , all of which are open given  $T'$ . Consider the collider that is closest to  $M$ . There is a directed path from  $M$  to this collider, and a directed path from this collider to a member of  $T'$  since it is open conditioned on  $T'$ . But this means there is a directed path from  $K$  to a member of  $T'$  since there is a directed path from  $K$  to this collider. This is a contradiction since we obtained  $T'$  by removing all descendants of  $K$  from  $T$ .
This establishes the claim that removing descendants of the collider along any d-connecting path that starts with a tail at  $X$  cannot introduce a d-connecting path that starts with an arrow into  $X$  when  $X \notin An(Y)$ .
Lemma A.2. Consider a DAG  $D$  where  $X \notin \operatorname{An}(Y)$  and  $Y \notin \operatorname{An}(X)$ ,  $X, Y$  are non-adjacent and  $k$ -covered. Then conditioned on any subset  $T: |T| \leq k$ , there exists a  $d$ -connecting path between  $X, Y$  that has an arrowhead at both  $X$  and  $Y$ .