We present the first polynomial-time algorithm to exactly compute the number of labeled chordal graphs on vertices. Our algorithm solves a more general problem: given and as input, it computes the number of -colorable labeled chordal graphs on vertices, using arithmetic operations. A standard sampling-to-counting reduction then yields a polynomial-time exact sampler that generates an -colorable labeled chordal graph on 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 vertices in time exponential in . An implementation of the polynomial-time counting algorithm gives the number of labeled chordal graphs on up to 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 vertices. In addition, we design two approximation algorithms: (1) an approximate counting algorithm that computes a -approximation of the number of -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 . The approximate counting algorithm runs in time, and the approximate sampling algorithm runs in expected time.

生成讲解博客的中文版本

生成AI智能校验的中文版本