arXiv:2608.13480cs.DSAug 2026

Manuscript Offprint

arXiv:2608.13480

Compact Path Representation in DAGs via Colored Edge Pebbling

Paola Bonizzoni, Alessio Conte, Gianluca Della Vedova, Younan Gao, Roberto Grossi, Brian Riccardi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Compactly representing a variation graph is a core problem in computational pangenomics that is usually attacked with techniques that have been originated on texts and adapted to graphs. In this paper we propose a new framework that takes a topology-centric perspective instead. A variation graph is modeled as a directed acyclic graph (DAG) together with a set of distinguished paths, where each path is assigned a distinct color. Our compact representation is centered on pebbling the graph, i.e. placing colored pebbles on edges so that every predefined path can be univocally reconstructed from the pebbled edges. In particular, a saturated pebbling marks each chosen edge with every path (color) traversing it.

We first propose a data structure to represent and query a variation graph with storage space depending on the size of the pebbling. The supported queries are: (i) path query, which recovers a path given its color, and (ii) edge query, which reports the colors of paths traversing a given edge. We then prove that the problem of finding a pebbling of minimum size is solvable in polynomial time. On the contrary, we prove that finding a saturated pebbling of minimum size is NP\mathsf{NP}-hard, but can be reduced to the minimum-weight set cover problem, allowing us to leverage integer linear programming (ILP) solvers. We show how to exploit saturated pebblings to achieve faster queries times than minimum size pebbling.

Our framework opens a new algorithmic viewpoint on developing more efficient variation graph representations rooted on the study of the topology of those graphs.

1 Introduction

Computational pangenomics is an emerging field in algorithmic bioinformatics that addresses the limitations of a single linear reference genome by moving towards graph-based representations capable of capturing genomic variation across entire populations [3, 9, 15]. In these models, genome sequences are represented as paths in a graph whose vertices are labeled with subsequences [3]. Such pangenome graphs allow many genomes to be represented within a single structure, but they also introduce algorithmic challenges in representing, indexing, and querying these graphs efficiently.

A central goal is to obtain compact representations of a collection of genomic sequences that still support useful query operations. In particular, a pangenome graph exhibits local topological structures, known as bubbles [18], where multiple distinct sequence paths diverge from a common starting node and converge at a common ending node, representing alternative genetic variants. In colored pangenome graphs, called variation graphs, each genome sequence is distinguished by assigning a color to the path identifying the sequence. Then, the colored bubbles in variation graphs capture at a topological level the main variations that differentiate one genomic sequence from another. Capturing bubbles that distinguish a colored path from another is particularly relevant in applications such as sequence to graph alignment to pangenome graphs —where the goal is to efficiently locate the subpath that best matches an input sequence— or path inference from a collection of strings, which involves identifying a path whose sequence-labeled vertices match most strings in the collection [2]. Although the topological structure of the graph is relevant in these applications, most existing work focuses on indexing genome sequences for graph querying and identifying sequence-labeled paths, whereas comparatively little attention has been devoted to exploiting the graph’s topology. Given this graph representation, a natural question is how to compactly represent the specific topology of the graph, combined with the sequence-labeled vertices, to uniquely identify and differentiate the paths underlying the genome sequences.

Motivated by this question from a theoretical perspective, in this work, we abstract away sequence information and study compact graph representations based on the graph’s topology that can be used to identify edges that differentiate a predefined set of paths. In doing so, we use edge colors of bubbles in the graph to unequivocally identify each colored path in the graph. Our main objective is to explore novel algorithmic approaches to indexing and querying variation graphs that complement path labeling with the topological structure, therefore leveraging the later for graph-based applications in pangenomics. Under this aim, we formalize the notion of colored edge pebbles. Intuitively, a pebble of color ii placed on an edge indicates that the edge belongs to the ii-th predefined path. Then we investigate the following general question on colored graphs: How to place colored pebbles only on few edges of predefined paths while still enabling unambiguosly the full recovery of the path? We address this question by studying the following computational problem: given a DAG GG, which we call variation graph, defined as the triple (V,E,H)(V,E,\mathcal{H}), where H\mathcal{H} is a set of paths such that each edge in GG is traversed by at least one path, each identified by an integer (or color) in {1,⋯ ,∣H∣}\{1,\cdots,|\mathcal{H}|\}, we want to find the minimum number of edges in each path hi∈Hh_{i}\in\mathcal{H} that must be colored with ii so that the entire path of that color can be reconstructed without ambiguities. While path reconstruction may follow different criteria, in this paper we adopt a natural one: pebbling under the unique path condition, that is, placing pebbles so that each pebbled edge can be reached from the previously pebbled edge of the same color through a unique path.

Figure 1 illustrates the idea.

Figure 1: Example of pebbling and guardians. The set H\mathcal{H} consists of four paths (sequence of edges): hgreen=(e2,e7,e10)h_{\mathrm{green}}=(e_{2},e_{7},e_{10}), hred=(e1,e5,e10)h_{\mathrm{red}}=(e_{1},e_{5},e_{10}), hblue=(e1,e4,e6,e8,e11)h_{\mathrm{blue}}=(e_{1},e_{4},e_{6},e_{8},e_{11}), and hbrown=(e3,e9,e11)h_{\mathrm{brown}}=(e_{3},e_{9},e_{11}). The elements of the chosen pebbling P\mathcal{P} are pictured as small colored squares over the edges. For example, (e5,red)(e_{5},\mathrm{red}), (e10,green)(e_{10},\mathrm{green}) and (e8,blue)(e_{8},\mathrm{blue}) are some of the elements of P\mathcal{P}. From P\mathcal{P} we derive the following guardians, one for each path: Ggreen=(e2,e10)\mathcal{G}_{\mathrm{green}}=(e_{2},e_{10}), Gred=(e5,e10)\mathcal{G}_{\mathrm{red}}=(e_{5},e_{10}), Gblue=(e1,e8)\mathcal{G}_{\mathrm{blue}}=(e_{1},e_{8}), and Gbrown=(e3,e9)\mathcal{G}_{\mathrm{brown}}=(e_{3},e_{9}).

We refer to such graphs as variation graphs, and to the process of assigning colored pebbles to selected edges as pebbling.

To ensure that paths can be reconstructed from the pebbled edges, we introduce a structural constraint called the unique path condition. Intuitively, pebbles are placed so that each pebbled edge of a given color can be reached from the previously pebbled edge of the same color via a unique path in the graph, enabling unambiguous reconstruction of the path. We observe that the study of pebbling problem in digraphs is of more general theoretical interest and it is not limited to pangenomics. However, it opens new perspectives that may impact the field of graph pangenomics with practical topological-oriented approaches to address main fundamental questions on variation-graphs, such as the path-inference problem that asks for distinguishing paths in the graph. While this problem is currently solved at the sequence level by mainly considering sequence-labeled vertices, the compact graph representation based on pebbling that we propose in the paper, combined with sequence-labeling of paths, could provide alternative algorithmic solutions to path detection.