arXiv:2608.26488cs.DSAug 2026

Manuscript Offprint

arXiv:2608.26488

Cheaper by the Batch: Shared Traversal for Genotype Graph Editing

Aaron Li, Yifan Li, Drew DeHaas, Giulia Guidi

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

Aaron Li

Cornell University

Ithaca, NY, USA

al2633@cornell.edu

Yifan Li

Cornell University

Ithaca, NY, USA

yl3722@cornell.edu

Drew DeHaas

Cornell University

Ithaca, NY, USA

dcd239@cornell.edu

Giulia Guidi

Cornell University

Ithaca, NY, USA

gg434@cornell.edu

Abstract—Updating a graph by inserting or replacing nodes while preserving semantics and reusing existing structure is a recurring computational problem. In population genetics, this problem arises in the genotype representation graph (GRG), a directed acyclic graph that losslessly encodes phased genetic variation across hundreds of thousands of samples by sharing subgraph structure for individual mutations. In a GRG, each mutation's carrier set is implicitly encoded as the set of leaf nodes reachable from the node it is assigned to. Updating a mutation is therefore a structural editing problem, and current approaches remap mutations individually.

This paper introduces a batched mutation-remapping algorithm that replaces independent reuse-aware traversals with a single shared reverse-topological pass, identifying reuse candidates for an entire batch at once. The pass propagates compact bit-parallel per-mutation state and uses an adaptive sparse/dense carrier set representation spanning rare-to-common variant densities. Batching is the memory-scalable complement to split-based parallelism, which instead replicates graph and traversal state per worker. Our remapping is evaluated on a controlled update workload and on end-to-end allele polarization, a bulk carrier set update that is common in population genetic analysis. Our approach is up to 10.5×10.5\times faster than independent remapping while preserving exact carrier-set semantics.

Index Terms—Genotype Representation Graph, Graph Algorithm, Graph Traversal, Graph Editing.

I. INTRODUCTION

Biobank datasets contain the genomes of hundreds of thousands of people, each differing from the reference at millions of sites [1], [2]. This variation is often stored in compressed dense matrix formats such as VCF [3] or BCF [4]. As sample sizes grow, these representations scale poorly because they cannot capture the extensive structure shared across genetically similar samples. Recent formats such as PLINK PGEN store data sparsely and leverage the commonality between samples to compress it in place [5]. This commonality, however, is generated by a hierarchical process, namely the genealogy of the individuals, yet most formats fail to exploit hierarchical sharing for compression. Recent work addresses this with the genotype representation graph (GRG), a multi-tree directed acyclic graph that losslessly encodes phased genetic variation across hundreds of thousands of samples by sharing subgraph structure across mutations [6], [7].

This shared substructure is what makes GRGs compact, but it also means the information is baked into the graph's topology. A GRG does not store which samples carry a mutation; the carrier set is implied by the leaves reachable from the node to which the mutation is assigned. Editing a GRG therefore fundamentally differs from updating a sparse genotype matrix, where the carriers of a mutation are revised by rewriting a column. Downsampling to a subset of samples or mutations is straightforward, but changing which samples carry a mutation is not a local edit. The carrier set is encoded through reachability, so altering it requires restructuring the graph. Because post-construction revision is difficult, the typical workflow builds a graph from a fixed callset and treats it as a static substrate for downstream analysis.

Consider a GRG constructed from an initial set of mutations. Over time, updates may affect only a subset of them, such as corrections to carrier sets or the addition of newly identified mutations. The core operation underlying such updates is mutation remapping: given a mutation and its desired carrier set, attach it to reusable graph structure when possible, and introduce new structure only when necessary. This is an irregular graph workload: each mutation induces a different, data-dependent traversal whose size and shape depend on its carrier set. As a result, different mutations visit different parts of the graph and require different amounts of work.

Our proposed batched formulation solves this at scale and enables post-construction GRG editing. Rather than treating each mutation independently, it processes a batch of edits in a single traversal of the existing graph, propagating compact, mutation-specific state to identify reusable structures for many mutations at once. An adaptive sparse/dense carrier-set representation, mirroring the sparse accumulator choice in sparse linear algebra, keeps that state cheap across a range of densities. By amortizing traversal and carrier-set processing across a batch, updates become more efficient, and the strategy composes with existing parallel mutation mapping, enabling traversal sharing and parallel execution together.

The representative editing task in the evaluation is allele polarization, a population genetics operation that reorients each variant based on which allele is ancestral. Polarization rewrites carrier sets in bulk across many sites, exercising the reuse-aware remapping this method targets. In Section II-D, we develop the reduction to mutation remapping.

Our contributions are:

• A mutation remapping algorithm for editing a genotype representation graph after construction via a single shared traversal over a batch of carrier set updates;

  • A compact bit-parallel representation that reduces permutation state overhead during shared traversal, improving memory efficiency;

• An end-to-end evaluation of polarization, achieving up to 10.5×10.5\times speedup while preserving carrier-set semantics.

The code can be found at https://github.com/CornellHPC/grg-shared-traversal.

References (25)