Directed acyclic graphs (DAGs) are directed graphs in which there is no path from a vertex to itself. DAGs are an omnipresent data structure in computer science and the problem of counting the DAGs of given number of vertices and to sample them uniformly at random has been solved respectively in the 70's and the 00's. In this paper, we propose to explore a new variation of this model where DAGs are endowed with an independent ordering of the out-edges of each vertex, thus allowing to model a wide range of existing data structures. We provide efficient algorithms for sampling objects of this new class, both with or without control on the number of edges, and obtain an asymptotic equivalent of their number. We also show the applicability of our method by providing an effective algorithm for the random generation of classical labelled DAGs with a prescribed number of vertices and edges, based on a similar approach. This is the first known algorithm for sampling labelled DAGs with full control on the number of edges, and it meets a need in terms of applications, that had already been acknowledged in the literature.
翻译:有向无环图是一类不存在从顶点出发返回自身路径的有向图。作为计算机科学中无处不在的数据结构,关于给定顶点数的有向无环图计数问题及其均匀随机采样问题,已分别于20世纪70年代和21世纪初得到解决。本文提出对该模型的一种新变体进行探索:为每个顶点的出边赋予独立序关系,从而能够建模更广泛的数据结构。我们针对此类新对象,分别给出可控制边数与否的高效采样算法,并推导出其数量的渐近等价形式。通过基于相似方法提出经典标记有向无环图在指定顶点数与边数条件下的有效随机生成算法,本文进一步验证了该方法的适用性。这是已知首个能完全控制边数进行标记有向无环图采样的算法,填补了文献中已指出的应用需求空白。