An Efficient Algorithm for Counting Markov Equivalent DAGs

Robert Ganian, Thekla Hamm, Topi Talvitie

Abstract

We consider the problem of counting the number of DAGs which are Markov-equivalent, i.e., which encode the same conditional independencies between random variables. The problem has been studied, among others, in the context of causal discovery, and it is known that it reduces to counting the number of so-called moral acyclic orientations of certain undirected graphs, notably chordal graphs. Our main empirical contribution is a new algorithm, AnonMAO, which outperforms previously known exact algorithms for the considered problem by a significant margin. On the theoretical side, we show that our algorithm is guaranteed to run in polynomial time on a broad class of chordal graphs, including interval graphs.

Introduction

In causal discovery, the goal is to identify the directed acyclic graph (DAG) that represents the underlying causal relationships between variables. However, observational data often yields a Markov equivalence class (MEC)—a set of DAGs that represent the same conditional independencies. Counting the number of DAGs within an MEC is crucial for quantifying uncertainty in causal models and designing interventions.

Mathematically, this task is equivalent to counting the moral acyclic orientations (MAOs) of an undirected chordal graph. While fundamental, this problem is computationally challenging, particularly for dense graphs where previous exact algorithms often encounter exponential time complexity.

Methodology: The AnonMAO Algorithm

AnonMAO builds upon the recursive RootPicking approach, which selects a vertex as a source and solves the resulting sub-problems. The primary innovation of AnonMAO is the integration of vertex anonymization with dynamic programming to exploit structural symmetries.

The algorithm follows three key steps:

  1. Core Identification: It identifies "dominating vertices"—those connected to all other vertices in a sub-graph—and strips them away to reveal the "core" structure.
  2. Memoization: Results for sub-problems are stored based on their core structure and the count of removed dominating vertices.
  3. Symmetry Exploitation: By recognizing isomorphic sub-problems regardless of specific vertex labels, AnonMAO avoids redundant computations.

Theoretically, the authors demonstrate that AnonMAO runs in polynomial time if the graph's clique-tree has a polynomial number of subtrees. This provides the first proof that counting MAOs is polynomial-time solvable for interval graphs.

Experimental Evaluation

The algorithm was evaluated using randomly generated undirected connected chordal graphs (UCCGs) with vertex counts ($n$) ranging from 32 to 1024 and density parameters ($r$) from 2 to 32. Performance was averaged over 50 repetitions for each configuration. Synthetic data allowed for rigorous testing across varying densities, a known weak point for prior methods.

Key Results

AnonMAO demonstrates significant improvements in both speed and scalability compared to existing baselines like RootPicking and tree-decomposition-based dynamic programming.

Performance comparison of AnonMAO against baseline algorithms across various graph sizes (n) and densities (r).

As shown in the results, AnonMAO consistently outperforms other methods, especially as graph density increases. While previous state-of-the-art methods timed out on graphs with 128 vertices at moderate densities, AnonMAO successfully processed graphs with up to 1024 vertices. Its ability to handle dense graphs makes it particularly valuable for complex causal discovery tasks.

Discussion and Future Work

The success of AnonMAO highlights the importance of exploiting structural symmetries in graph-based counting problems. However, the general problem of counting MAOs remains computationally difficult, and the authors identify specific graph sequences where sub-problem growth remains exponential.

Future research may focus on identifying additional structural properties of chordal graphs to further optimize sub-problem identification. Additionally, while AnonMAO excels in dense graphs, specialized tree-decomposition methods may still offer advantages in extremely sparse settings.

Summary updated

BibTeX
@inproceedings{ganian2020efficient,
  author = {Robert Ganian and Thekla Hamm and Topi Talvitie},
  title = {{An Efficient Algorithm for Counting Markov Equivalent DAGs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i06.6573},
}
Figure