We present the first polynomial-time algorithm to exactly compute the number of labeled chordal graphs on $n$ vertices. Our algorithm solves a more general problem: given $n$ and $\omega$ as input, it computes the number of $\omega$-colorable labeled chordal graphs on $n$ vertices, using $O(n^7)$ arithmetic operations. A standard sampling-to-counting reduction then yields a polynomial-time exact sampler that generates an $\omega$-colorable labeled chordal graph on $n$ vertices uniformly at random. Our counting algorithm improves upon the previous best result by Wormald (1985), which computes the number of labeled chordal graphs on $n$ vertices in time exponential in $n$. An implementation of the polynomial-time counting algorithm gives the number of labeled chordal graphs on up to $30$ vertices in less than three minutes on a standard desktop computer. Previously, the number of labeled chordal graphs was only known for graphs on up to $15$ vertices. In addition, we design two approximation algorithms: (1) an approximate counting algorithm that computes a $(1\pm\varepsilon)$-approximation of the number of $n$-vertex labeled chordal graphs, and (2) an approximate sampling algorithm that generates a random labeled chordal graph according to a distribution whose total variation distance from the uniform distribution is at most $\varepsilon$. The approximate counting algorithm runs in $O(n^3\log{n}\log^7(1/\varepsilon))$ time, and the approximate sampling algorithm runs in $O(n^3\log{n}\log^7(1/\varepsilon))$ expected time.
翻译:我们提出了首个多项式时间算法,用于精确计算具有 $n$ 个顶点的带标签弦图的数量。我们的算法解决了一个更一般的问题:给定 $n$ 和 $\omega$ 作为输入,它使用 $O(n^7)$ 次算术运算,计算具有 $n$ 个顶点且可 $\omega$ 着色的带标签弦图的数量。随后,通过标准的采样-计数归约,我们得到一个多项式时间的精确采样器,该采样器能够均匀随机地生成一个具有 $n$ 个顶点且可 $\omega$ 着色的带标签弦图。我们的计数算法改进了 Wormald (1985) 之前的最佳结果,该结果计算具有 $n$ 个顶点的带标签弦图数量所需的时间是 $n$ 的指数级。该多项式时间计数算法的一个实现,在一台标准台式计算机上,能够在三分钟内计算出顶点数不超过 $30$ 的带标签弦图的数量。此前,带标签弦图的数量仅已知对于顶点数不超过 $15$ 的图。此外,我们设计了两种近似算法:(1) 一个近似计数算法,用于计算具有 $n$ 个顶点的带标签弦图数量的 $(1\pm\varepsilon)$ 近似值;(2) 一个近似采样算法,用于生成一个随机带标签弦图,其分布与均匀分布的总变差距离不超过 $\varepsilon$。近似计数算法的运行时间为 $O(n^3\log{n}\log^7(1/\varepsilon))$,近似采样算法的期望运行时间为 $O(n^3\log{n}\log^7(1/\varepsilon))$。