Counting and Sampling Git Graphs

Version Control Systems, like Git and Mercurial, represent the history of a project as a Directed Acyclic Graph, capturing divergences and merges throughout development. A widely adopted workflow, the feature branch workflow, imposes a particularly simple structure: a single main branch and features branches evolving in parallel without interfering with one another. This work presents an enumerative study of these Git graphs. We first establish a bijection between Git graphs and a simpler combinatorial class, which we term cyclariums, and derive their exact count at size n, namely \( \sum\_{k=2}^n \sum\_{f = 1}^{k-1} {k \brack f} { n - k - 1 \choose k - f - 1} \). Using a saddle-point method, we further show that this number is asymptotically equivalent to \[ \frac{e^{1/8}}{2} \left(\frac{n}{2e}\right)^{\frac n 2} \exp\left(\frac 1 2 \ln\frac n 2 \sqrt{\frac n 2} + \sqrt{2 n} + \frac{(\ln\frac n 2)^2}{32} \right) \left(\frac n 2\right)^{-3/8}. \] Additionally, we analyze the limit laws of key parameters. Finally, we address random generation by designing both a uniform sampler and a Boltzmann sampler for these graphs.

Authors

Institutions

Publication Details

Journal
arXiv (Cornell University)
Published
2026-10-27
DOI
https://doi.org/10.48550/arxiv.2610.37208
Primary Topic
Advanced Combinatorial Mathematics
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Counting and Sampling Git Graphs

Julien Courtiel, Martin Pépin
arXiv (Cornell University)
Advanced Combinatorial Mathematics
preprint

Counting and Sampling Git Graphs

Julien Courtiel, Martin Pépin
preprint en

Abstract

Version Control Systems, like Git and Mercurial, represent the history of a project as a Directed Acyclic Graph, capturing divergences and merges throughout development. A widely adopted workflow, the feature branch workflow, imposes a particularly simple structure: a single main branch and features branches evolving in parallel without interfering with one another. This work presents an enumerative study of these Git graphs. We first establish a bijection between Git graphs and a simpler combinatorial class, which we term cyclariums, and derive their exact count at size n, namely \( \sum\_{k=2}^n \sum\_{f = 1}^{k-1} {k \brack f} { n - k - 1 \choose k - f - 1} \). Using a saddle-point method, we further show that this number is asymptotically equivalent to \[ \frac{e^{1/8}}{2} \left(\frac{n}{2e}\right)^{\frac n 2} \exp\left(\frac 1 2 \ln\frac n 2 \sqrt{\frac n 2} + \sqrt{2 n} + \frac{(\ln\frac n 2)^2}{32} \right) \left(\frac n 2\right)^{-3/8}. \] Additionally, we analyze the limit laws of key parameters. Finally, we address random generation by designing both a uniform sampler and a Boltzmann sampler for these graphs.

arXiv (Cornell University)
GREYC (FR)
Advanced Combinatorial Mathematics
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon