English

Inferring DAGs and Phylogenetic Networks from Least Common Ancestors

Combinatorics 2026-05-06 v2 Discrete Mathematics

Abstract

A least common ancestor (LCA) of two leaves in a directed acyclic graph (DAG) is a vertex that is an ancestor of both leaves and has no proper descendant that is also their common ancestor. LCAs capture hierarchical relationships in rooted trees and, more generally, in DAGs. In 1981, Aho et al. introduced the problem of determining whether a set of pairwise LCA constraints on a set XX, of the form (i,j)<(k,l)(i,j)<(k,l) with i,j,k,lXi,j,k,l\in X, can be realized by a rooted tree whose leaf set is XX, such that whenever (i,j)<(k,l)(i,j)<(k,l), the LCA of i,ji,j is a descendant of that of k,lk,l. They also presented a polynomial-time algorithm, BUILD, to solve this problem. However, many such constraint systems cannot be realized by any tree, prompting the question of whether they can be realized by a more general DAG. We extend Aho et al.'s framework from trees to DAGs, providing both theoretical and algorithmic foundations for reasoning about LCA constraints in this broader setting. Given a collection RR of LCA constraints, we define its ++-closure R+R^+, capturing additional LCA relations implied by RR. Using R+R^+, we construct a canonical DAG GRG_R and prove that RR is DAG-realizable if and only if it is realized by GRG_R. We further adapt this construction to phylogenetic networks, defining a canonical network NRN_R and prove that it is regular, i.e., it coincides with the Hasse diagram of its underlying set system. Finally, we show that for any DAG-realizable RR, its classical closure - comprising all LCA constraints that hold in every DAG realizing RR - coincides with its ++-closure. All constructions are computable in polynomial time, and we provide explicit algorithms for each. All algorithms developed in this paper are implemented in the freely available Python package RealLCA.

Keywords

Cite

@article{arxiv.2511.07965,
  title  = {Inferring DAGs and Phylogenetic Networks from Least Common Ancestors},
  author = {Anna Lindeberg and Anton Alfonsson and Vincent Moulton and Guillaume E. Scholz and Marc Hellmuth},
  journal= {arXiv preprint arXiv:2511.07965},
  year   = {2026}
}

Comments

14 figures