Counting and Sampling Git Graphs
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 ∑k=2n ∑f = 1k−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 e1/8/2 (n/2e)n/2 exp(1/2 lnn/2 √(n/2) + √(2 n) + (lnn/2)2/32 ) (n/2)−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.
Related
BibTeX
@misc{courtiel2026counting,
title = {{Counting and Sampling Git Graphs}},
author = {Julien Courtiel and Martin Pépin},
howpublished = {HAL},
year = {2026},
month = oct,
doi = {10.48550/arxiv.2610.37208},
eprint = {2610.37208},
archivePrefix = {arXiv},
url = {https://hal.science/hal-05840557v1},
note = {CC BY 4.0},
}
RIS
TY - UNPB
TI - Counting and Sampling Git Graphs
AU - Julien Courtiel
AU - Martin Pépin
PY - 2026
DA - 2026/10/27
PB - HAL
DO - 10.48550/arxiv.2610.37208
UR - https://hal.science/hal-05840557v1
AB - 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 ∑_k=2^n ∑_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 e^1/8/2 (n/2e)^n/2 exp(1/2 lnn/2 √(n/2) + √(2 n) + (lnn/2)^2/32 ) (n/2)^−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.
ER -