arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.01902cs.DSmath.CO
收藏

Git 图的随机生成

Random Generation of Git Graphs

Julien Courtiel, Martin Pépin

AI总结:

针对特性分支工作流约束下的 Git 有向无环图,提出三种不同场景下的均匀随机生成算法,均具备线性时间复杂度,覆盖小k值、任意k值及恒定k/n比值的大规模图生成需求。

摘要:

版本控制系统(如 Git 和 Mercurial)将项目的历史管理为有向无环图,对项目生命周期中发生的各种分支分化与同步进行编码。业界一种流行的工作流名为特性分支工作流,它将这些图约束为特定形状:唯一的主分支,以及互不干扰的特性分支。本文聚焦于具有 n 个顶点(其中 k 个顶点位于主分支)的这类图的均匀随机生成,针对三种不同使用场景提供了三种算法。第一种基于拒绝采样,在 k 值较小时(更准确地说,当 k = O(√n) 时)效率较高。第二种以主分支中任意数量的提交 k 作为输入,但需要高昂的预计算成本。最后一种是 Boltzmann 生成器,能够在目标 k/n 比值恒定的情况下生成超大规模的图。所有这些算法的时间复杂度均与其输出规模呈线性关系。

英文摘要:

Version Control Systems, such as Git and Mercurial, manage the history of a project as a Directed Acyclic Graph encoding the various divergences and synchronizations happening in its life cycle. A popular workflow in the industry, called the feature branch workflow, constrains these graphs to be of a particular shape: a unique main branch, and non-interfering feature branches. Here we focus on the uniform random generation of those graphs with n vertices, including k on the main branch, for which we provide three algorithms, for three different use-cases. The first, based on rejection, is efficient when aiming for small values of k (more precisely whenever k = O($\sqrt$ n)). The second takes as input any number k of commits in the main branch, but requires costly precalculation. The last one is a Boltzmann generator and enables us to generate very large graphs while targeting a constant k/n ratio. All these algorithms are linear in the size of their outputs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑