ExMAG: Learning of Maximally Ancestral Graphs

Petr Ryšavý, Pavel Rytíř, Xiaoyu He, Georgios Korpas, Jakub Marecek · Submission to ICLR 2026 · Desk rejected

TL;DR

Learning causal relationships from observational data is notoriously vulnerable to hidden confounders, which can distort or completely invert apparent cause-and-effect relationships. ExMAG introduces a compact Mixed-Integer Quadratic Programming (MIQP) formulation to learn Maximal Ancestral Graphs (MAGs)—which model both direct causal links and confounding—using a lazy branch-and-cut approach. By generating cycle and inducing-path constraints on the fly, ExMAG scales to 25+ variables (compared to just 4–5 in prior exact integer-programming formulations) while outperforming existing constraint- and score-based methods in accuracy.

What Problem Does This Paper Address?

Standard causal discovery tools typically represent causal systems as Directed Acyclic Graphs (DAGs). However, DAGs assume causal sufficiency—that all relevant common causes are observed. When hidden confounders exist (as in Simpson’s paradox), standard methods often infer spurious, direct causal edges between confounded variables.

Maximal Ancestral Graphs (MAGs) solve this by allowing two types of edges: directed edges ($\rightarrow$) for direct causal effects and bidirected edges ($\leftrightarrow$) for latent confounding. Unfortunately, learning MAGs is computationally brutal:

  • Factorization in MAGs requires tracking connected components formed by bidirected edges (c-components or districts).
  • Prior exact integer programming (IP) formulations scaled exponentially with the number of vertices, choking on systems with more than 4–5 variables.
  • Heuristic constraint-based methods (like FCI) scale better but often suffer from poor sample efficiency and lower accuracy.

Methods

ExMAG formulates MAG structure learning as an MIQP with a compact, polynomial number of decision variables:

  • Representation: Uses continuous weight matrices for directed ($W_D$) and bidirected ($W_B$) edges, alongside binary adjacency matrices ($E$ and $B$). A symmetric background knowledge matrix $F$ can optionally specify known non-causal pairs.
  • Objective Function: Minimizes the $\ell_q$ prediction error ($q \in \{1, 2\}$) derived from structural equation modeling (SEM) with latent confounders, combined with an $\ell_0$-like penalty on total edge count ($\lambda$).
  • Linearized Bounds: Employs big-$c$ bounds to avoid bilinear interaction terms between weights and indicator variables.
  • Branch-and-Cut (Lazy Constraints): Instead of pre-generating exponentially many constraints to prohibit directed cycles, almost-directed cycles, and inducing paths:
  • Solves a relaxed MIQP.
  • Runs polynomial-time separation routines: a Floyd–Warshall distance matrix checks for almost-directed cycles, while a depth-first search (DFS) detects violating inducing paths.
  • Violations are lazily added as linear cut constraints, iterating until convergence to a globally optimal MAG.

Datasets

The authors benchmarked ExMAG across both synthetic benchmarks and real-world data:

  1. Erdős–Rényi (ER) Graphs: Synthetic graphs with varying edge densities (e.g., ER-2, ER-3, ER-5, ER-7), where 20% of the variables are hidden as latent confounders.
  2. Bow-Free (BF) Graphs: Synthetic mixed graphs where no pair shares both a directed and bidirected edge ($i \rightarrow j$ and $i \leftrightarrow j$ cannot co-occur).
  3. 3BF Graphs: A modified bow-free graph where node degrees are capped at 3, allowing fair comparison against competitors whose preprocessing steps explode on dense graphs.
  4. European Credit Default Swaps (CDS): A real-world financial risk dataset featuring 16 time series from the banking, insurance, transportation, and manufacturing sectors.
  5. UC Berkeley Admissions: A classic synthetic demonstration of Simpson’s paradox.

Key Insights and Ideas

  • Compact vs. Extended Formulations: Prior exact formulations relied on an exponential number of variables to represent every possible district/c-component. ExMAG shifts this burden: it maintains a polynomial number of variables and pushes the exponential complexity into lazy cut constraints that are only invoked when violated.
  • Unified Modeling of Latent Error Covariance: Rather than treating latent variables as separate unobserved graph nodes, their influence is absorbed into an error covariance matrix represented by bidirected edges ($W_B$), directly connecting distributional robustness and causal risk minimization.
  • Lazy Separation via All-Pairs Distances: Floyd–Warshall shortest-path evaluations on directed edges make it straightforward to detect almost-directed cycles ($u \rightarrow \dots \rightarrow v \leftrightarrow u$) and trace which edges participate in inducing paths.

Key Results

  • Scalability: ExMAG scales to instances with $d = 25$ or more variables, whereas prior exact IP methods (ip4ancadmg and its LP-relaxation variant ipbm) are restricted to around 4–5 variables (or strictly low-degree graphs due to exponential preprocessing requirements).
  • Structure Recovery:
  • Across all sample sizes ($n \in [20, 1000]$) and variable counts ($d \in [5, 25]$), ExMAG achieves lower Structural Hamming Distance (SHD) and higher F1-scores than the FCI baseline.
  • On the bounded-degree 3BF dataset, ExMAG outperforms both ip4ancadmg and ipbm in both SHD and runtime.
  • Real-World Discovery: On the CDS dataset, ExMAG avoided spurious direct cross-sector causation, correctly identifying Lufthansa (transportation) and Deutsche Bank (banking) as key systemic risk importers while attributing cross-sector co-movement to latent confounding.

Limitations and Future Work

  • Worst-Case Complexity: Because it is an exact branch-and-cut algorithm for an NP-hard problem, the worst-case runtime remains exponential in the number of variables.
  • Room for Solver Enhancements: The separation routines currently add simple cuts. The authors suggest that specialized facet-defining valid inequalities (inspired by TSP solvers) could substantially accelerate convergence.
  • Extension to Time-Series Forecasting: Future work includes leveraging confounding-aware MAG structures to improve predictive performance and forecasting in Dynamic Bayesian Networks.

Summary updated

BibTeX
@misc{rysavy2025exmag,
  author = {Petr Ryšavý and Pavel Rytíř and Xiaoyu He and Georgios Korpas and Jakub Marecek},
  title = {{ExMAG: Learning of Maximally Ancestral Graphs}},
  year = {2025},
  eprint = {2503.08245},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.08245},
}
Figure