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.
翻译:有向无环图(DAG)是一种不存在从顶点到自身路径的有向图。DAG是计算机科学中无处不在的数据结构,关于计算给定顶点数的DAG数量以及对其进行均匀随机采样的问题,已分别在20世纪70年代和21世纪初得到解决。在本文中,我们提出探索该模型的一个新变体,其中DAG的每个顶点的出边被赋予一个独立的顺序,从而能够对多种现有数据结构进行建模。我们为这一新类别对象的采样提供了高效算法(无论是否控制边数),并获得了其数量的渐近等价式。我们还通过基于类似方法、为具有指定顶点数和边数的经典标记DAG提供有效的随机生成算法,展示了我们方法的适用性。这是首个已知的能够完全控制边数的标记DAG采样算法,它满足了文献中已得到认可的应用程序需求。