Abstract 1 Introduction 2 Preliminaries 3 Sampling unlabeled chordal graphs 4 Counting labeled chordal graphs with a given automorphism 5 Conclusion References

Sampling Unlabeled Chordal Graphs in
Expected Polynomial Time

Úrsula Hébert-Johnson ORCID University of California, Santa Barbara, CA, USA Daniel Lokshtanov ORCID University of California, Santa Barbara, CA, USA
Abstract

We design an algorithm that generates an n-vertex unlabeled chordal graph uniformly at random in expected polynomial time. Along the way, we develop the following two results: (1) an 𝖥𝖯𝖳 algorithm for counting and sampling labeled chordal graphs with a given automorphism π, parameterized by the number of moved points of π, and (2) a proof that the probability that a random n-vertex labeled chordal graph has a given automorphism πSn is at most 1/2cmax{μ2,n}, where μ is the number of moved points of π and c is a constant. Our algorithm for sampling unlabeled chordal graphs calls the aforementioned 𝖥𝖯𝖳 algorithm as a black box with potentially large values of the parameter μ, but the probability of calling this algorithm with a large value of μ is exponentially small.

Keywords and phrases:
Chordal graphs, graph sampling, graph counting, unlabeled graphs
Funding:
Úrsula Hébert-Johnson: Supported by NSF grant CCF-2147094.
Copyright and License:
[Uncaptioned image] © Úrsula Hébert-Johnson and Daniel Lokshtanov; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Generating random combinatorial structures
; Theory of computation Graph algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2501.05024
Acknowledgements:
We would like to thank Eric Vigoda for discussions that led to a concise proof of an important step in the running time analysis.
Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim Thắng

1 Introduction

A graph is chordal if it has no induced cycles of length at least 4. The term was coined by Gavril in 1972 [12], more than fifty years ago, but the notion of chordal graphs in fact goes as far back as 1958 [13]. In the early papers, chordal graphs were referred to by other names, such as triangulated graphs. By now, many structural results have been proved about chordal graphs, and there are many algorithms that take a chordal graph as input. Thus it would be useful to have an efficient algorithm for generating random chordal graphs, both for the practical purpose of software testing, as well as the more mathematical purpose of testing conjectures.

In [14], Hébert-Johnson et al. designed an algorithm that generates n-vertex labeled chordal graphs uniformly at random. This algorithm runs in polynomial time, using at most O(n7) arithmetic operations for the first sample and O(n4) arithmetic operations for each subsequent sample. However, when discussing the performance of an algorithm that is being tested, the correct output typically does not depend on the labeling of the vertices. If we use a labeled-graph sampling algorithm to generate random test cases, then asymmetric graphs will be given too much weight/probability compared to those that happen to have many automorphisms. This naturally leads to the question of efficiently generating unlabeled chordal graphs uniformly at random. In this paper, we present an algorithm that solves this problem and runs in expected polynomial time.

Theorem 1.

There is a randomized algorithm that given n, generates a graph uniformly at random from the set of all unlabeled chordal graphs on n vertices. This algorithm uses O(n7) arithmetic operations in expectation.

It is worth mentioning the difference between the running times for labeled vs. unlabeled chordal graph sampling. The sampling algorithm of Hébert-Johnson et al. generates a random n-vertex labeled chordal graph in polynomial time, even in the worst case. However, obtaining a worst-case polynomial-time algorithm for sampling unlabeled chordal graphs – or an expected-polynomial-time counting algorithm for such graphs – appears to be very difficult since these questions remain open even for general graphs. This is relevant because the class of chordal graphs is known to be 𝖦𝖨-complete. While there exist classes of graphs (which we discuss below) for which efficient unlabeled sampling algorithms are known, we are not aware of any 𝖦𝖨-complete graph class with such an algorithm.

Our algorithm for sampling unlabeled chordal graphs builds upon an algorithm of Wormald that generates n-vertex unlabeled graphs uniformly at random in expected time O(n2) [20]. This in turn builds upon a related algorithm by Dixon and Wilf [7] that solves the same problem but assumes that the exact number of n-vertex unlabeled graphs has already been computed. In [20], the algorithm of Wormald follows a somewhat similar structure but removes that assumption. As mentioned above, the question of computing the exact number of n-vertex unlabeled graphs in expected polynomial time remains open to this day.

It often happens that we wish to sample from a particular graph class (e.g., chordal graphs). For unlabeled trees, there is a uniform sampling algorithm that runs in polynomial time [19]. One can also count the exact number of unlabeled trees on n vertices in polynomial time [17, A000055]. On the topic of counting, an algorithm for counting unlabeled k-trees is presented in [9], but the running time is not stated. An expected-polynomial-time algorithm for uniform sampling of 2-connected unlabeled planar graphs was presented by Bodirsky et al. in 2005 [4], followed by the same result for connected unlabeled cubic planar graphs in 2008 [6]. For the class of connected unlabeled bipartite permutation graphs, a uniform sampling algorithm was designed by Saitoh et al. that runs in O(n) time [18].

Although extensive research has been done on the topic of labeled graph sampling [5, 8, 10, 11], to the best of our knowledge, the literature on sampling unlabeled graphs from a given graph class is relatively sparse. As is the case for chordal graphs, the corresponding labeled sampling problem tends to be solved first for a given graph class, and then perhaps one can address the problem of efficiently sampling unlabeled graphs from the same graph class.

1.1 Methods

The sampling algorithm of Wormald [20] is based on the fact that unlabeled graphs correspond to orbits of the following group action: the symmetric group Sn acts on the set of labeled graphs by permuting the vertex labels. This correspondence follows from the Frobenius-Burnside lemma. Therefore, to sample a random unlabeled graph, it is enough to sample a random orbit of this group action.

To make this approach work for chordal graphs, we need two ingredients: (1) an algorithm for counting and sampling labeled chordal graphs with a given automorphism π, and (2) a proof that the probability that a random n-vertex labeled chordal graph has a given automorphism πSn is at most 1/2cmax{μ2,n}, where μ is the number of moved points of π and c is a constant.

For (1), we design an 𝖥𝖯𝖳 (fixed-parameter tractable) counting algorithm that is parameterized by μ, the number of moved points of π. This algorithm uses O(27μn9) arithmetic operations. Using the standard sampling-to-counting reduction of [15], we also obtain a corresponding sampling algorithm with the same running time. Our main algorithm (for sampling unlabeled chordal graphs) calls each of these 𝖥𝖯𝖳 algorithms as a black box with potentially large values of the parameter μ. Nevertheless, using the bound from (2), we are able to show that the probability of using a large value of μ is exponentially small, so the expected running time is not significantly affected.

To design the counting algorithm for (1), we rewrite each of the recurrences from the algorithm of Hébert-Johnson et al., now carrying around information about the automorphism π and its moved points. The original algorithm is a dynamic-programming algorithm in which there is a constant number of types of vertices (X, L, etc.) in each graph that we wish to count. In our updated version, we now keep track of the type of each vertex that is moved by π.

To prove the bound for (2), we distinguish between the cases when μ is small and μ is large (μ is either less than or greater than ndlogn, where d is a constant). When μ is small, we use the fact that almost every chordal graph is a split graph [1], and we strengthen this by showing that in fact, almost every chordal graph is a balanced split graph. For the case of balanced split graphs, the argument is easy and is similar to the proof of the bound for general graphs [16]. When μ is large, the argument is more complicated. We observe that the vast majority of n-vertex labeled chordal graphs have maximum clique size close to n/2. Along the way, we also use the fact that for every chordal graph G, there exists a PEO (perfect elimination ordering) of G such that some maximum clique appears at the tail end of that PEO.

2 Preliminaries

Let be the set of natural numbers, not including 0. For n, we use the notation [n]{1,2,,n}. For a graph G and vertex subsets S,TV(G), we say S sees all of T if TN(S).

Definition 2.

Let A={a1,,ar} and B={b1,,br} be finite subsets of such that |A|=|B|, where the elements ai and bi are listed in increasing order. We define ϕ(A,B):AB as the bijection that maps ai to bi for all i[r].

2.1 Permutations and labeled graphs

For n, let Sn denote the group of all permutations of [n]. For a permutation πSn, we define Mπ{i[n]:π(i)i} to be the set of points moved by π. For n, [n]0{0,2,3,,n} denotes the set of all possible values of |Mπ| for πSn.

Suppose πSn, C[n]. We write π(C){π(i):iC} to denote the image of C under π. We say C is invariant under π if π(i)C for all iC. For a set C that is invariant under π, we write π|C to denote the permutation π restricted to the domain C.

A labeled graph is a pair G=(V,E), where the vertex set V is a finite subset of and the edge set E is a set of two-element subsets of V. For a permutation πSn and a labeled graph G such that V(G)[n] is invariant under π, we say π|V(G) is an automorphism of G if for all u,vV(G), u and v are adjacent if and only if π(u) and π(v) are adjacent.

2.2 Chordal graphs and related notions

A vertex v in a graph G is simplicial if its neighborhood N(v) is a clique. A perfect elimination ordering (PEO) of a graph G is an ordering v1,,vn of the vertices of G such that for all i[n], vi is simplicial in the subgraph induced by the vertices vi,,vn. A graph is chordal if and only if it has a perfect elimination ordering [3]. The following two lemmas are well-known facts about chordal graphs. The proof of the first can be found in [3].

Lemma 3.

Every chordal graph G contains a simplicial vertex. If G is not a complete graph, then G contains two non-adjacent simplicial vertices.

Lemma 4.

A chordal graph G on n vertices has at most n maximal cliques.

Proof.

Let C be a maximal clique in G, and let vi be the leftmost vertex of C in a given perfect elimination ordering v1,,vn of G. We claim that C is equal to the closed neighborhood to the right of vi, i.e., C=N[vi]{vi,,vn}. It is clear that C is contained in N[vi]{vi,,vn} since vi has no other neighbors to its right, so we indeed have C=N[vi]{vi,,vn} by maximality of C. Therefore, there are at most n maximal cliques.

Definition 5.

Let G1, G2 be two graphs, and suppose CV(G1)V(G2) is a clique in both G1 and G2. When we say we glue G1 and G2 together at C to obtain G, this means G is the union of G1 and G2: the vertex set is V(G)=V(G1)V(G2), and the edge set is E(G)=E(G1)E(G2).

As is shown in [14], if G1 and G2 are both chordal, then the resulting graph G is chordal.

2.3 Evaporation sequences

Our algorithm for counting the number of labeled chordal graphs with a given automorphism will use the notion of evaporation sequences from [14].

Suppose we are given a chordal graph G and a clique XV(G). The evaporation sequence of G with exception set X is defined as follows: If X=V(G), then the evaporation sequence of G is the empty sequence. If XV(G), then let L~1 be the set of all simplicial vertices in G, and let L1=L~1X. Suppose L2,,Lt is the evaporation sequence of GL1 (with exception set X). Then L1,L2,,Lt is the evaporation sequence of G. As is shown in [14], the fact that X is a clique implies that all vertices outside of X eventually evaporate, so this is well-defined.

If the evaporation sequence L1,L2,,Lt of G has length t, then we say G evaporates at time t with exception set X, and t is called the evaporation time. We define LG(X)Lt to be the last set in the evaporation sequence of G, and we let LG(X)= if the sequence is empty. Similarly, we define the evaporation time of a vertex subset. Suppose G has evaporation sequence L1,L2,,Lt with exception set X, and suppose SV(G)X is a nonempty vertex subset. Let tS be the largest index i such that LiS. We say S evaporates at time tS in G with exception set X.

3 Sampling unlabeled chordal graphs

In [20], Wormald presented an algorithm that generates an n-vertex unlabeled graph uniformly at random in expected time O(n2). In this paper, we achieve a similar result for chordal graphs:

See 1

The sampling algorithm of Wormald makes use of the fact that unlabeled graphs correspond to orbits of a particular group action. Since our algorithm will follow a similar outline, we begin by discussing some of the ideas behind the algorithm of Wormald.

Suppose we have been given n as input, and let Ω be the set of all labeled graphs with vertex set [n]. The symmetric group Sn acts on Ω in the following way: For each πSn and GΩ, πG is the graph that results from permuting the vertex labels of G according to π. The orbits of Ω under the action of Sn are the isomorphism classes of labeled graphs, each of which corresponds to an unlabeled graph. Let

Γ={(π,G)Sn×Ω:π is an automorphism of G}.

Suppose we fix an n-vertex unlabeled graph H, and let the corresponding isomorphism class of labeled graphs be . As is shown in [20], the number of pairs (π,G)Γ such that G is equal to |Sn|=n!. This follows from the Frobenius-Burnside lemma. Therefore, if we sample a random pair (π,G)Γ uniformly at random, and then we forget the labels on the graph G, this amounts to sampling an n-vertex unlabeled graph uniformly at random.

In the case of chordal graphs, the same statements hold true. Let Ωchord be the set of all labeled chordal graphs with vertex set [n]. The symmetric group Sn acts on Ωchord in the same way as above, by permuting the vertex labels. The set of orbits of this group action corresponds to the set of unlabeled chordal graphs. Let

Γchord={(π,G)Sn×Ωchord:π is an automorphism of G}.

Let Hc be an unlabeled chordal graph, and let c be the corresponding isomorphism class of labeled graphs. Applying the Frobenius-Burnside lemma to the orbit corresponding to c shows that the number of pairs (π,G)Γchord such that Gc is equal to n!.

In [20], Wormald describes an algorithm for sampling a random pair (π,G)Γ in order to sample a random unlabeled graph. The same outline can be used to sample a random pair (π,G)Γchord. However, there are two key points where some difficulty arises. First of all, in one of the steps of the algorithm that samples from Γ, it is necessary to count the number of n-vertex labeled graphs with a given automorphism (and sample from the set of such graphs). This is easy to do for general graphs but becomes more complicated for chordal graphs (see Section 4). Second, the algorithm of Wormald uses the fact that the number of labeled graphs with a given automorphism π is at most 2(n2)μn/2+μ(μ+2)/4, where μ=|Mπ| is the number of moved points of π. To transform this into an algorithm for sampling unlabeled chordal graphs, it is necessary to prove similar bounds on the number of labeled chordal graphs with a given automorphism. These will be the bounds Bμ in our algorithm.

3.1 Algorithm for sampling unlabeled chordal graphs

Let Count_Chordal_Lab(n) stand for the counting algorithm in [14] that computes the number of n-vertex labeled chordal graphs. In the full version of the paper, we prove the following two theorems.

Theorem 6.

There is a deterministic algorithm that given n and πSn, computes the number of labeled chordal graphs with vertex set [n] for which π is an automorphism. This algorithm uses O(27μn9) arithmetic operations, where μ=|Mπ|.

Theorem 7.

There is a randomized algorithm that given n and πSn, generates a graph uniformly at random from the set of all labeled chordal graphs with vertex set [n] for which π is an automorphism. This algorithm uses O(27μn9) arithmetic operations, where μ=|Mπ|.

See Section 4 for the details of the counting algorithm of Theorem 6 along with some intuition behind the proof of correctness. In our algorithm for sampling unlabeled chordal graphs, Count_Chordal_Lab(n,π) stands for the algorithm of Theorem 6 and Sample_Chordal_Lab(n,π) stands for the algorithm of Theorem 7.

Recall that [n]0={0,2,3,,n}. For μ[n]0, let Rμ{πSn:|Mπ|=μ} be the set of permutations with exactly μ moved points. For πSn, let Fix(π) denote the set of n-vertex labeled chordal graphs G such that π is an automorphism of G. To follow the same approach as the algorithm of Wormald, for each μ[n]0, we need an upper bound Bμ that satisfies Bμ|Rμ||Fix(π)| for all πRμ. Let B0 be the number of n-vertex labeled chordal graphs, which is exactly equal to |R0||Fix(id)|. For 2μn200logn, let

Bμ=(B0(9/10)n+2n22n2/9+n2n2/4+n/2)nμμ!, (1)

and for n200logn<μn, let

Bμ=n2n+12n2/4f(μ)nμμ!, (2)

where f(μ)=μ2900μ10. In Section 3.2, we will prove that we indeed have Bμ|Rμ||Fix(π)| for all πRμ, when n is sufficiently large. Let B=μ[n]0Bμ.

Our algorithm for sampling a random n-vertex unlabeled chordal graph is given in Algorithm 1. The general idea is as follows. For μ[n]0, let Γμ={(π,G)Γchord:|Mπ|=μ}. We choose μ such that the probability of each value of μ is Bμ/B, which is approximately equal to Γμ/Γchord. (We do not know how to efficiently compute the exact value of Γμ/Γchord since we do not know the exact number of unlabeled chordal graphs.) Since Bμ/B is not exactly equal to Γμ/Γchord, we adjust for this by restarting with a certain probability in Step 11. We then proceed to select a random pair (π,G)Γμ, and we output the graph G without labels.

Algorithm 1 Unlabeled chordal graph sampler.

Step 10 can easily be implemented in O(n) time in the following way. If μ=0, let π=id. For μ2, we can repeatedly choose a random permutation of [μ] until we obtain a derangement. The expected number of trials for this is a constant (see [20]).

In Step 11, to compute |Rμ|, we observe that |R0|=1 and |Rμ|=!μ(nμ) for μ2. Here !μ is the number of derangements of μ. We compute !μ using the formula !m=m!i=0m(1)i/i! for m, which can be derived using the inclusion-exclusion principle.

3.2 Correctness of Algorithm 1

The correctness of Count_Chordal_Lab(n,π) and Sample_Chordal_Lab(n,π) is proved in the full version of the paper.

We need to show that the output graph is chosen uniformly at random. One “iteration” refers to one run of Steps 9 to 11 or 9 to 14. In a given iteration, we say the pair (π,G) was “chosen” if π was chosen from Rμ and G was chosen by Sample_Chordal_Lab(n,π). We claim that for all (π,G)Γchord, in any given iteration, the probability that (π,G) is chosen is 1/B. Indeed, this probability is equal to

BμB1|Rμ||Rμ||Fix(π)|Bμ1|Fix(π)|=1B,

where μ=|Mπ|, since the probability of choosing G in Step 12 is 1/|Fix(π)|. Therefore, we output all n-vertex unlabeled chordal graphs with equal probability.

Next, we need to show that Bμ|Rμ||Fix(π)| for all πRμ to verify that the probability |Rμ||Fix(π)|/Bμ in Step 11 is at most 1. When μ=0 this is an equality, so suppose μ2. Clearly |Rμ|nμμ!, so we just need to prove that the number of n-vertex labeled chordal graphs with automorphism π is at most Bμ/(nμμ!) for all πSn with μ moved points.

In the case when Bμ is defined according to Equation 2, this follows from Theorem 8. The proof this theorem can be found in the full version of the paper. (The bound in Theorem 8 is in fact true for all values of μ – the reason why we define Bμ differently for smaller values of μ will become clear when we discuss the running time in Section 3.3.)

Theorem 8.

Let n, πSn, and let μ=|Mπ|. The number of labeled chordal graphs with vertex set [n] for which π is an automorphism is at most

n2n+12n2/4f(μ),

where f(μ)=μ2900μ10.

For the other case, suppose 2μn200logn, and suppose πSn is a permutation with μ moved points. We need to show that the number of n-vertex labeled chordal graphs with automorphism π is at most Bμ/(nμμ!). We begin by reducing to the case of split graphs. A split graph is a graph whose vertex set can be partitioned into a clique and an independent set, with arbitrary edges between the two parts. It is easy to see that every split graph is chordal. Furthermore, the following result by Bender et al. [1] shows that a random n-vertex labeled chordal graph is a split graph with probability 1o(1).

Proposition 9 (Bender et al. [1]).

If α>3/2, n is sufficiently large, and G is a random n-vertex labeled chordal graph, then

Pr(G is a split graph)>1αn.

Applying this proposition with α=910 tells us that the number of n-vertex labeled chordal graphs that are not split is at most B0(910)n. To bound the number of n-vertex labeled split graphs with automorphism π, we consider two cases: balanced split graphs and unbalanced split graphs. We say a partition of the vertex set of a split graph G is a split partition if it partitions G into a clique and an independent set; i.e., a split partition is a partition that demonstrates that G is split. We denote a split partition that consists of the clique C and the independent set I by the ordered pair (C,I). We say an n-vertex split graph is balanced if |C|n3 and |I|n3 for every split partition (C,I) of G. It is easy to bound the number of unbalanced split graph as follows.

Lemma 10.

The number of labeled split graphs on n vertices that are not balanced is at most 2n22n2/9.

Proof.

Suppose (C,I) is a partition of [n] into two parts such that |C|<n3 or |I|<n3. The number of labeled split graphs with this particular split partition is at most 2|I||C|2n32n3=22n2/9. Therefore, the number of unbalanced labeled split graphs on n vertices is at most 2n22n2/9 since there are at most 2n possible partitions.

The following lemma will be useful for bounding the number of balanced split graphs.

Lemma 11.

Let πSn, and let G be an n-vertex labeled split graph. If π is an automorphism of G, then there exists a split partition (C,I) of G such that C and I are invariant under π.

Proof.

Let C^ be the set of vertices that belong to the clique in every split partition of G, let I^ be the set of vertices that belong to the independent set in every split partition of G, and let Q^=V(G)(C^I^). By Observation 7.3 in [14], every vertex in Q^ is adjacent to every vertex in C^ and is non-adjacent to every vertex in I^. By Lemma 7.4 in [14], Q^ is either a clique or an independent set. Suppose π is an automorphism of G. If Q^ is a clique, then the split partition (C^Q^,I^) has the desired property. If Q^ is an independent set, then the split partition (C^,I^Q^) has the desired property.

Lemma 12.

Let πSn, and suppose |Mπ|2. The number of balanced labeled split graphs G on n vertices such that π is an automorphism of G is at most

n2n2/4+n/2.

Proof.

Suppose (C,I) is a partition of [n] into two parts. Let i=|I| and c=|C|. The number of labeled split graphs with this particular split partition is 2ic. Therefore, the number of labeled split graphs with automorphism π for which (C,I) has the property from Lemma 11 is at most 2ic. Let Z(C,I) be the number of such graphs. Whenever two vertices u,vI (resp. C) belong to the same cycle in the cycle decomposition of π, u and v must have the same relationship as each other to each of the vertices in C (resp. I). Therefore, we in fact have an upper bound of max{2(i1)c,2i(c1)} on Z(C,I), since π has at least two moved points. If in3 and cn3, then we have max{2(i1)c,2i(c1)}2n2/4n/2.

By Lemma 11, every balanced labeled split graph on n vertices with automorphism π has a split partition (C,I) such that C and I are invariant under π. Furthermore, this split partition is balanced (i.e., both parts have size at least n3). Therefore, the number of balanced labeled split graphs on n vertices with automorphism π is at most

n3i2n32n2n2/4n/2n2n2/4+n/2

since the number of partitions (C,I) with |I|=i is certainly at most 2n.

Putting together Propositions 9, 10, and 12, we can see that

(B0(9/10)n+2n22n2/9+n2n2/4+n/2)nμμ!

is an upper bound on |Rμ||Fix(π)| when n is sufficiently large.

Let N0 be the cutoff such that this works for nN0. To be precise, when implementing this algorithm, we would solve the problem by brute force if n<N0 (by generating all possible n-vertex chordal graphs and then selecting one at random), and we would run Algorithm 1 as written if nN0.

3.3 Running time of Algorithm 1

The running time of Steps 1-6 is O(n7) arithmetic operations since that is the running time of Count_Chordal_Lab(n). In this section, we will show that the rest of the algorithm uses only O(n7) arithmetic operations in expectation.

If we choose μ=0 in Step 9 of Algorithm 1, then the algorithm is guaranteed to terminate in that iteration. Thus the expected number of iterations is at most B/B0. Let T be the expected running time of Algorithm 1 after completing Step 6 (this is where we choose μ at random and the loop begins). In Lemma 13, we show that 𝐄[T] is at most the product of B/B0 and the expected running time of one iteration.

Let N be the number of iterations of Algorithm 1, and let Tj be the time spent in iteration j for each j[N]. We have T=j=1NTj.

Lemma 13.

We have 𝐄[T]BB0𝐄[T1].

Proof.

Clearly 𝐄[T] is finite since the expected number of iterations is finite and the procedures Count_Chordal_Lab(n,π) and Sample_Chordal_Lab(n,π) have worst-case running time bounds. Therefore, we can solve for 𝐄[T] in the following way.

The steps that we run in one iteration (Steps 9-14) do not depend on j – they are always the same, regardless of how many iterations have happened so far. Thus we have 𝐄[j=2NTj|N>1]=𝐄[T], which implies 𝐄[TN>1]=𝐄[T1N>1]+𝐄[T]. Therefore, we have

𝐄[T] =𝐄[TN=1]Pr(N=1)+𝐄[TN>1]Pr(N>1)
=𝐄[T1N=1]Pr(N=1)+(𝐄[T1N>1]+𝐄[T])Pr(N>1)
𝐄[T](1Pr(N>1)) =𝐄[T1N=1]Pr(N=1)+𝐄[T1N>1]Pr(N>1)
=𝐄[T1]
𝐄[T] =𝐄[T1]Pr(N=1)BB0𝐄[T1].

For μ[n]0, let T(n,μ) be an upper bound on the time it takes to run one iteration, assuming we have chosen this particular value of μ in Step 9. By the running time of Count_Chordal_Lab(n,π) and Sample_Chordal_Lab(n,π), we can assume T(n,μ)=O(27μn9). We have

𝐄[T1]=μ[n]0BμBT(n,μ).

To prove a bound on 𝐄[T1], we will start by proving a bound on Bμ/B for all μ[n]0. Since B0B, it is sufficient to prove a bound on Bμ/B0 for all μ[n]0. The following lemma gives us a lower bound on B0.

Lemma 14.

For n2, the number of n-vertex labeled chordal graphs is at least

2n2n2/4n2.

Proof.

It is enough to just consider n-vertex labeled split graphs with a split partition (C,I) such that |C|=n2. Since (nn2)2n/n for n2, the number of such graphs is at least

(nn2)2n2/4n2n2n2/4n2.

We divide by n in the first expression since each split graph can have up to n distinct split partitions in which C is of a given size [2].

Lemma 15.

Suppose n13. If 2μn200logn, then

BμB03n16μ.

Proof.

Let Bμ(1), Bμ(2), and Bμ(3) be the three terms that are added together in Equation 1, in order, so that Bμ=(Bμ(1)+Bμ(2)+Bμ(3))nμμ!. We have

Bμ(1)nμμ!B0=(910)nnμμ!,

and we claim that this is at most 1/n16μ. Since μ!nμ, it is sufficient to show n18μ(10/9)n, which is true when μn200logn.

For the next term, by Lemma 14 we have

Bμ(2)nμμ!B0n22n2/36nμμ!.

To see that this is at most 1/n16μ, it is sufficient to show n19/2002n/36 since μn200. This is indeed true for n13.

For the third term, by Lemma 14 we have

Bμ(3)nμμ!B0n32n/2nμμ!.

To see that this is at most 1/n16μ, it is sufficient to show n20μ2n/2, which is true when μn40logn. Adding together these three terms, we obtain Bμ/B03/n16μ.

Lemma 16.

For sufficiently large n, if n200logn<μn, then

BμB01n16μ.

Proof.

Lemma 14 implies B02n2/4 for n4, so we have

BμB0n2n+12f(μ)nμμ!,

where f(μ)=μ2900μ10. We claim that this expression is at most 1/n16μ. Since μ!nμ, it is sufficient to show n2n+1n18μ2f(μ). When n is sufficiently large,111This holds for n2.6105. we have log3n120021800n22n+1. Since μn200logn, this implies

n2n+12μ2/1800. (3)

When n is sufficiently large,222This holds for n3.3109. we also have n18900200log2n+90200logn. Since μn200logn, this implies

n18μ2μ2/1800μ/10. (4)

Multiplying Equations 3 and 4 gives us the desired bound of n2n+1n18μ2f(μ).

By Lemmas 15 and 16, the above summation for 𝐄[T1] is at most T(n,0)+O(1) since T(n,μ) is certainly at most O(n16μ). For an iteration in which we have chosen μ=0, when counting and sampling n-vertex labeled chordal graphs with automorphism π=id, we can simply run the counting and sampling algorithms of [14], rather than passing in π=id as an input. Thus the expected running time 𝐄[T1] of one iteration is at most O(n7) arithmetic operations. Lemmas 15 and 16 also immediately give us a bound on B/B0, since we have

BB0=B0B0+B2B0++BnB0=O(1).

Therefore, by Lemma 13, the overall running time is at most O(n7) arithmetic operations in expectation.

4 Counting labeled chordal graphs with a given automorphism

In this section, we describe the algorithm for Count_Chordal_Lab(n,π), which counts the number of labeled chordal graphs with a given automorphism. In the full version of the paper, we prove correctness, analyze the running time, and derive the corresponding sampling algorithm (Theorem 7).

See 6

There is a known dynamic-programming algorithm for computing the number n-vertex labeled chordal graphs that uses O(n7) arithmetic operations, if we do not require the graphs to have a particular automorphism [14]. Our algorithm is closely based on that one, but we add more arguments and more details to each of the recurrences to keep track of the behavior of the automorphism. As was done in [14], we evaluate the recurrences top-down using memoization.

4.1 Reducing from counting chordal graphs to counting connected chordal graphs

For k, let a(k) denote the number of labeled chordal graphs with vertex set [k], and let c(k) denote the number of connected labeled chordal graphs with vertex set [k]. The algorithm of [14] begins by reducing from counting chordal graphs to counting connected chordal graphs via the following recurrence, which appears as Lemma 3.13 in [14]. (We omit the “ω-colorable” requirement since we will not need that here.)

Lemma 17 ([14]).

The number of labeled chordal graphs with vertex set [k] is given by

a(k)=k=1k(k1k1)c(k)a(kk)

for all k.

Here k stands for the number of vertices in the connected component that contains the label 1. The remaining connected components have a total of kk vertices. Since this recurrence is relatively simple, most of the difficulty in the algorithm of [14] lies in the recurrences for counting connected chordal graphs. However, when counting graphs with a given automorphism, the step of reducing to connected graphs is already quite a bit more involved.

Suppose we are given n and πSn as input. From now on, whenever we refer to n or π, we mean these particular values from the input.

We will first define a(k,p,M) and c(k,p,M), which are variations of a(k) and c(k) that only count graphs for which πp|V(G) is an automorphism (see Definition 18). Here πp stands for π to the power p, i.e., the permutation that arises from applying π a total of p times. The reason for raising π to a power will be apparent in the recurrence for a(k,p,M). In the initial, highest-level recursive call, we will have p=1 and thus πp=π.

In [14], when counting the number of possibilities for a subgraph of size k (for example, a connected component), the authors essentially relabel that subgraph to have vertex set [k], so that one can count the number of possibilities using, for example, c(k). In our algorithm, we want to relabel the vertices of each subgraph in a similar way. However, this time, we do not relabel the vertices that are moved by π. This ensures that the automorphism in each later recursive call will still be π, or a permutation closely related to π.

As a consequence, the vertex sets of the subgraphs that we wish to count become slightly more complicated. For example, suppose we wish to count the number of possibilities for a 5-vertex subgraph that originally contains the moved vertices 2,8,9Mπ. Since we do not relabel the moved vertices, the resulting vertex set after relabeling is {1,2,3,8,9} rather than {1,2,3,4,5}. More formally, suppose we have been given k and MMπ, where |M|k. Let V be the set of the first k|M| natural numbers in Mπ. We define Vk,MVM. For example, if k=5 and M=Mπ={2,8,9}, then Vk,M={1,2,3,8,9}. Intuitively, Vk,m is the label set of size k whose intersection with Mπ is M and that otherwise contains labels that are as small as possible.

For π^Sn and M[n], recall that M is invariant under π^ if π^(i)M for all iM. For M,M[n], we write Mπ^M to indicate that MM and M is invariant under π^. Intuitively, M is a subset of M that respects the cycles of π^ by taking all or nothing of each cycle.

Definition 18.

Suppose k,p[n] and suppose MπpMπ, where |M|k. Let a(k,p,M) (resp. c(k,p,M)) denote the number of labeled chordal graphs (resp. connected labeled chordal graphs) with vertex set Vk,M for which πp|V(G) is an automorphism.

Our algorithm returns a(n,1,Mπ). This is precisely the number of labeled chordal graphs with vertex set [n] and automorphism π since Vn,Mπ=[n].

Suppose we have been given fixed values of the arguments k,p,M of a(k,p,M). Let s be the smallest label in the vertex set Vk,M. For k[k], let 𝒫k be the family of sets MπpM such that |M|k+k|M|k and such that the following condition holds: if sM, then sM, and otherwise, |M|k1. This last condition will ensure that s belongs to the connected component of size k in the recurrence for a(k,p,M).

Suppose C[n], σSn. For an element iC, we say the period of i with respect to (C,σ) is the smallest positive integer j such that σj(i)C. Let 𝒬 be the family of sets CM such that all elements of C have the same period j2 with respect to (C,πp), and such that sC. For a set C𝒬, we write pC to denote the period of the elements of C (with respect to (C,πp)), and we let CσCσ(C)σpC1(C) denote the union of the sets that C is mapped to by powers of σ, where σ=πp.

To compute a(k,p,M), we use the following recurrence. The dot in front of the curly braces denotes multiplication. Note that we have |M|k and |MM|kk by the definition of 𝒫k.

Lemma 19.

Let k,p[n] and suppose MπpMπ, where |M|k. We have

a(k,p,M) =1kkM𝒫kc(k,p,M)a(kk,p,MM){(k|M|k|M|) if sM(k1|M|k1|M|) otherwise
+C𝒬c(|C|,ppC,C)a(kpC|C|,p,MCπp).

For some intuition, suppose G is a graph counted by a(k,p,M), and let C be the connected component of G that contains s. The first line of the recurrence for a(k,p,M) covers the case when C is invariant under πp. This case is analogous to Lemma 17. In the first summation, k stands for |C| and M stands for the set of vertices in C that can be moved by πp. If sM, then in addition to the vertices in M, we need to choose k|M| additional vertices for C so that |C|=k. For these, we must choose non-moved vertices, so there are k|M| possible vertices to choose from. If sM, then we subtract 1 from each of the numbers in the binomial coefficient since we already know that s is a non-moved vertex in C.

The second line covers the case when C is not invariant under πp, which means all of C is mapped to some other connected component of G by πp. In this case, we have pC components of size |C| that are all isomorphic to C, and the rest of the graph has kpC|C| vertices. We do not need a binomial coefficient in this case because all of the vertices in C are moved. There are c(|C|,ppC,C) possibilities for the edges of C since πppC is an automorphism of C. As an example, suppose p=1. If we apply πp=π to the vertices of C a total of pC times, then the image πpC(C) is equal to C, although these two sets might not match up pointwise. To ensure that the image πpC(C) matches up with the edges of C, we require that πpC is an automorphism of C. This is why we need the argument p in a(k,p,M) and c(k,p,M).

Note that for a graph G counted by a(k,p,M), we have MπpV(G)MπV(G)M since V(G)=Vk,M. This means no vertex in V(G)M is moved by πp, so we are free to relabel these vertices in the proof of Lemma 19 without changing the automorphism. In the initial recursive call a(n,1,Mπ), we have p=1 and M=Mπ, so MπpV(G)=M. Later on in the algorithm, it is possible that some vertices in M are not actually moved by πp. For example, in the previous paragraph, it could happen that πppC is the identity on C (and then ppC becomes the new value of p). However, we always have MMπ by the definition of a(k,p,M), so if |Mπ|=μ, then |M|μ. This fact will be useful for the running time analysis.

The proof of Lemma 19, along with the proofs of all of the following recurrences, can be found in the full version of the paper.

4.2 Recurrences for counting connected chordal graphs

To compute c(k,p,M), we will define various counter functions that are analogous to those in [14]. First, we recall the counter functions from [14]. We refer to functions 1-4 in Definition 20 as g-functions, and we refer to the others as f-functions. See Figure 1 in [14] for an illustration of all of these functions.

Definition 20 ([14]).

The following functions count various subclasses of chordal graphs. The arguments t,x,l,k,z are nonnegative integers, where tn, zn, x+kn for g-functions, and x+l+kn for f-functions. These also satisfy the domain requirements listed below.

  1. 1.

    g(t,x,k,z) is the number of labeled connected chordal graphs G with vertex set [x+k] that evaporate in time at most t with exception set X[x], where X is a clique, with the following property: every connected component of GX (if any) has at least one neighbor in X[z]. Domain: t0, x1, z<x.

  2. 2.

    g~(t,x,k,z) is the same as g(t,x,k,z), except every connected component of GX (if any) evaporates at time exactly t in G. Note: A graph with V(G)=X would be counted because in that case, g~ is the same as g. Domain: t1, x1, z<x.

  3. 3.

    g~p(t,x,k,z) is the same as g~(t,x,k,z), except no connected component of GX sees all of X. Domain: t1, x1, z<x.

  4. 4.

    g~1(t,x,k) and g~2(t,x,k) are the same as g~(t,x,k,z), except every connected component of GX sees all of X (hence we no longer require every component of GX to have a neighbor in X[z]), and furthermore, for g~1 we require that GX has exactly one connected component, and for g~2 we require that GX has at least two components. Domain for g~1: t1, x0. Domain for g~2: t1, x1.

  5. 5.

    f(t,x,l,k) is the number of labeled connected chordal graphs G with vertex set [x+l+k] that evaporate at time exactly t with exception set X[x], such that GX is connected, LG(X)={x+1,,x+l}, and XLG(X) is a clique. Domain: t1, x0, l1.

  6. 6.

    f~(t,x,l,k) is the same as f(t,x,l,k), except every connected component of G(XLG(X)) evaporates at time exactly t1 in G, and there exists at least one such component, i.e., XLG(X)V(G). Domain: t2, x0, l1.

  7. 7.

    f~p(t,x,l,k) is the same as f~(t,x,l,k), except no connected component of G(XLG(X)) sees all of XLG(X). Domain: t2, x0, l1.

  8. 8.

    f~p(t,x,l,k,z) is the same as f~p(t,x,l,k), except rather than requiring that GX is connected, we require that G[z] is connected. Domain: t2, x0, l1, zx.

The counter functions for our algorithm will be similar to these, except we only want to count graphs with a particular automorphism. Therefore, we will have several more arguments in addition to the usual ones t,x,l,k,z from Definition 20. As above, the argument p will indicate that πp is the current automorphism. We also introduce the arguments MX, ML, MZ, and MK, each of which is a subset of Mπ. Roughly, these sets specify which vertices – in X, LLG(X), Z[z], and the rest of the graph, respectively – can be moved by the current permutation (but the sets X, L, and Z will be modified slightly).

In Definition 20, the g-functions count graphs with vertex set [x+k], and the f-functions count graphs with vertex set [x+l+k]. For our algorithm, we will make some adjustments to these vertex sets to ensure that the vertices moved by the current permutation still appear in the graph. This is similar to how we defined Vk,M above. To do so, we define several symbols for these vertex sets and vertex subsets (Vargs, etc.). Each of these depends on the list of arguments of the function in question, which we denote by args. For example, when defining g, we have args=(txkzpMXMKMZ) (see Definition 21).

First, suppose args comes from one of the g-functions in Definition 21. Let VX be the set of the first x|MX| natural numbers in Mπ, and let VK be the set of the first k|MK| natural numbers in (VXMπ). We define XargsVXMX and VargsXargsVKMK. Also, if z is included in args, then let VZ be the set of the first z|MZ| natural numbers in Mπ. In this case, we define ZargsVZMZ.

For the other case, suppose args comes from one of the f-functions. Let VX be the set of the first x|MX| natural numbers in Mπ, let VL be the set of the first l|ML| natural numbers in (VXMπ), and let VK be the set of the first k|MK| natural numbers in (VXVLMπ). We define XargsVXMX, Largs=VLML, and VargsXargsLargsVKMK. Also, if z is included in args, then let VZ be the set of the first z|MZ| natural numbers in Mπ. In this case, we again define ZargsVZMZ.

These vertex subsets still have the same sizes as they did in the original algorithm: the size of Vargs is x+k or x+l+k, |Xargs|=x, |Largs|=l, the rest of the graph has size k, and |Zargs|=z. Just as we had ZX in the original algorithm, we now have ZargsXargs. This is because we require MZMX in Definition 21, and we also require z|MZ|x|MX|, which implies VZVX.

For g-functions, we have MπpVargsMXMK, and for f-functions, we have MπpVargsMXMLMK, by the definition of Vargs. We are now ready to define our new counter functions.

Definition 21.

The following functions count various subclasses of chordal graphs. The arguments t,x,l,k,z are nonnegative integers with the same domains as in Definition 20. We have p[n], and the arguments MX,ML,MK,MZ are subsets of Mπ. All other requirements for their domains are specified below.

  1. 1.

    g(txkzpMXMKMZ), g~(txkzpMXMKMZ), g~p(txkzpMXMKMZ),
    g~1(txkpMXMK), and g~2(txkpMXMK) are the same as g(t,x,k,z), g~(t,x,k,z), g~p(t,x,k,z), g~1(t,x,k), and g~2(t,x,k), respectively, except we only count graphs for which πp|V(G) is an automorphism, and we make the following changes to the vertices of the graph: the vertex set is Vargs rather than [x+k], the exception set is Xargs rather than [x], and [z] is replaced by Zargs.

    Domain: MXπpMπ, MKπpMπMX, MZπpMX, |MX|x, |MK|k, |MZ|z, and z|MZ|x|MX|.

  2. 2.

    f(txlkpMXMLMK), f~(txlkpMXMLMK), f~p(txlkpMXMLMK), and
    f~p(txlkzpMXMLMKMZ) are the same as f(t,x,l,k), f~(t,x,l,k), f~p(t,x,l,k), and f~p(t,x,l,k,z), respectively, except we only count graphs for which πp|V(G) is an automorphism, and we make the following changes to the vertices of the graph: the vertex set is Vargs rather than [x+l+k], the exception set is Xargs rather than [x], the last set to evaporate is Largs rather than {x+1,,x+l}, and [z] is replaced by Zargs.

    Domain: MXπpMπ, MLπpMπMX, MKπpMπ(MXML), MZπpMX, |MX|x, |ML|l, |MK|k, |MZ|z, and z|MZ|x|MX|.

For a graph G counted by one of these functions, πp|V(G) is indeed a permutation of V(G) since MX and MK (and ML if needed) are invariant under πp.

To compute c(k,p,M), we consider all possibilities for the evaporation time. In the following recurrence, g~1 (with those particular arguments) counts the number of labeled connected chordal graphs with vertex set Vargs=Vk,M and automorphism πp|V(G) that evaporate at time exactly t with empty exception set.

Lemma 22.

Let k,p[n] and suppose MπpMπ, where |M|k. We have

c(k,p,M)=t=1kg~1(t0kpM).

To compute g~1, we consider all possibilities for the size l of Largs. The set M in the inner sum stands for the set of vertices in Largs that can be moved by πp. Note that we have |M|l and |MKM|kl by the definition of l. For g~1 and all of the following functions, we recommend reading the analogous recurrences in [14] for further insight into what is happening with the arguments t,x,l,k,z in each recursive call.

Lemma 23.

For g~1, we have

g~1(txkpMXMK)=l=1kMl(k|MK|l|M|)f(txlklpMXMMKM),

where l={MπpMK:|MK|k+l|M|l}.

To compute f, we consider all possibilities for the set of labels that appear in connected components of G(XargsLargs) that evaporate at time exactly t1. These components correspond to the recursive call to f~. The set M stands for the set of vertices in components that evaporate at time exactly t1 that can be moved by πp. Note that we have |M|k and |MKM|kk by the definition of k. Since |ML|l, we also have x|MX|x+l|MXML|, which is required by the domain of g.

Lemma 24.

For f, we have

f(txlkpMXMLMK)=
k=1kMk(k|MK|k|M|)f~(txlkpMXMLM)g(t2x+lkkxpMXMLMKMMX),

where k={MπpMK:|MK|k+k|M|k}.

To compute g, we consider all possibilities for the set of labels that appear in connected components of GXargs that evaporate at time exactly t. These components correspond to the recursive call to g~. The set M stands for the set of vertices in components that evaporate at time exactly t that can be moved by πp.

Lemma 25.

For g, we have

g(txkzpMXMKMZ)=
k=0kMk(k|MK|k|M|)g~(txkzpMXMMZ)g(t1xkkzpMXMKMMZ),

where k={MπpMK:|MK|k+k|M|k}.

For the next recurrence, we will need a few more definitions. Suppose we have been given fixed values of the arguments of g~. Let s be the smallest label in VargsXargs. For k[k], let 𝒫k be the family of sets MπpMK such that |MK|k+k|M|k and such that the following condition holds: if sMK, then sM, and otherwise, |M|k1. For x[x], let x={MπpMX:|M|x}.

Let 𝒬 be the family of pairs (C,M), where CMK and MMX, such that all elements of C have the same period pC2 with respect to (C,πp), such that sC, and such that M is invariant under πppC. For a set C from such a pair, we let CσCσ(C)σpC1(C), where σ=πp.

To compute g~, we consider all possibilities for the label set of the connected component C of GXargs that contains s. In the definition of g~, the components of GXargs are similar enough (since they all evaporate at time t) that they can potentially be mapped to one another by πp. Thus we consider two cases: either C is invariant under πp, or C is mapped to some other component of GXargs by πp. We add together the summations from these two cases, in a similar way to the recurrence for a(k,p,M). In the recurrence for g~, k stands for |C|, and x stands for |N(C)|. The set M stands for the set of vertices in C that can be moved by πp, and M stands for the set of vertices in N(C) that can be moved by πp.

Lemma 26.

For g~, we have

g~(txkzpMXMKMZ)=1kk1xxM𝒫kMxg~1(txkpMM)g~(txkkzpMXMKMMZ)
{(k|MK|k|M|) if sMK(k1|MK|k1|M|) otherwise
{(x|MX|x|M|) if MMZ(x|MX|x|M|)(z|MZ|x|M|) otherwise
+1xx(C,M)𝒬g~1(tx|C|ppCMC)g~(txkpC|C|zpMXMKCπpMZ)
{(x|MX|x|M|) if MMZ(x|MX|x|M|)(z|MZ|x|M|) otherwise.

To compute f~, we consider three cases: either no component of G(XargsLargs) sees all of XargsLargs, exactly one component sees all of XargsLargs, or at least two components see all of XargsLargs. The recursive calls to g~1 and g~2 correspond to the component/components that see all of XargsLargs. In the second and third cases, the set M stands for the set of vertices that can be moved by πp in components that see all of XargsLargs.

Lemma 27.

For f~, we have

f~(txlkpMXMLMK) =f~p(txlkpMXMLMK)
+1kkMk(k|MK|k|M|)g~1(t1x+lkpMXMLM)f~p(txlkkpMXMLMKM)
+1kkMk(k|MK|k|M|)g~2(t1x+lkpMXMLM)g~p(t1x+lkkxpMXMLMKMMX),

where k={MπpMK:|MK|k+k|M|k}.

For the next recurrence, suppose we have been given fixed values of the arguments of g~2. Let s be the smallest label in VargsXargs, and let 𝒫k be defined as it was in the recurrence for g~. Let 𝒬 be the family of sets CM such that all elements of C have the same period pC2 with respect to (C,πp), and such that sC. For a set C𝒬, we let CσCσ(C)σpC1(C), where σ=πp.

Lemma 28.

For g~2, we have

g~2(txkpMXMK)=
1kkM𝒫kg~1(txkpMXM)(g~1(txkkpMXMKM)+g~2(txkkpMXMKM))
{(k|MK|k|M|) if sMK(k1|MK|k1|M|) otherwise
+C𝒬g~1(tx|C|ppCMXC)(g~1(txkpC|C|pMXMKCπ)+g~2(txkpC|C|pMXMKCπ)).

To compute g~p, all we need to do is make a slight adjustment to the recurrence for g~.

Lemma 29.

The recurrence for g~p is exactly the same as the recurrence for g~ in Lemma 26, except for the two sums over x: In both summations, rather than summing over x such that 1xx, we sum over x such that 1xx1.

To compute f~p, we first observe that when z=x, requiring GZargs to be connected is the same as requiring GXargs to be connected.

Lemma 30.

We have f~p(txlkpMXMLMK)=f~p(txlkxpMXMLMKMX).

For the next f~p recurrence, we need one last round of definitions. Suppose we have been given fixed values of the arguments of f~p, including z and MZ. Let s be the smallest label in Vargs(XargsLargs). For k[k], let 𝒫k be the family of sets MπpMK such that |MK|k+k|M|k and such that the following condition holds: if sMK, then sM, and otherwise, |M|k1. For 0xx, let x={MπpMX:|M|x}. Also, for 0ll, let 𝒥l={MπpML:|M|l}.

Let 𝒬 be the family of triples (C,MX,ML), where CMK, MXMX, and MLML, such that all elements of C have the same period pC2 with respect to (C,πp), such that sC, and such that MXML is invariant under πppC. For a set C from such a triple, we let CσCσ(C)σpC1(C), where σ=πp.

Lemma 31.

For f~p with the argument z, we have

f~p(txlkzpMXMLMKMZ)=1kk0xx0ll0<x+l<x+lM𝒫kMXxML𝒥lg~1(t1x+lkpMXMLM)
(l|ML|l|ML|){(k|MK|k|M|) if sMK(k1|MK|k1|M|) otherwise
{(x|MX|x|MX|) if l>0 or MXMZ(x|MX|x|MX|)(z|MZ|x|MX|) otherwise
{f~p(tx+lllkkzpMXMLMLMLMKMMZ) if l<lg~p(t1x+lkkzpMXMLMKMMZ) otherwise
+0xx0ll0<x+l<x+l(C,MX,ML)𝒬g~1(t1x+l|C|ppCMXMLC)(l|ML|l|ML|)
{(x|MX|x|MX|) if l>0 or MXMZ(x|MX|x|MX|)(z|MZ|x|MX|) otherwise
{f~p(tx+lllkpC|C|zpMXMLMLMLMKCπMZ) if l<lg~p(t1x+lkpC|C|zpMXMLMKCπMZ) otherwise.

See the full version of the paper for more intuition behind the recurrences for g~2 and f~p. The base cases for all of these counter functions are the same as in [14] since they only depend on the arguments t,x,l,k,z.

5 Conclusion

We built upon the algorithm of Wormald for generating random unlabeled graphs to design an algorithm that, given n, generates a random unlabeled chordal graph on n vertices in expected polynomial time. This serves as a proof of concept that one can obtain a sampling algorithm for unlabeled graphs from a 𝖦𝖨-complete graph class 𝒢 using the following two ingredients: (1) an 𝖥𝖯𝖳 algorithm for counting labeled graphs in 𝒢 with a given automorphism π parameterized by the number of moved points of π and (2) a bound on the probability that a labeled graph in 𝒢 has a given automorphism. A few potential candidates for this are bipartite graphs, strongly chordal graphs, and chordal bipartite graphs, all of which are 𝖦𝖨-complete. An additional open problem would be to design a uniform, or approximately uniform, sampling algorithm – either for unlabeled chordal graphs or general unlabeled graphs – that runs in expected polynomial time even when we condition on the output graph.

References

  • [1] Edward A. Bender, L. Bruce Richmond, and Nicholas C. Wormald. Almost all chordal graphs split. Journal of the Australian Mathematical Society, 38(2):214–221, 1985.
  • [2] Vladislav Bína and Jiří Přibil. Note on enumeration of labeled split graphs. Commentationes Mathematicae Universitatis Carolinae, 56(2):133–137, 2015.
  • [3] Jean R.S. Blair and Barry Peyton. An introduction to chordal graphs and clique trees. In Graph theory and sparse matrix computation, pages 1–29. Springer, 1993.
  • [4] Manuel Bodirsky, Clemens Gröpl, and Mihyun Kang. Sampling unlabeled biconnected planar graphs. In Algorithms and Computation: 16th International Symposium, ISAAC 2005, Sanya, Hainan, China, December 19-21, 2005. Proceedings 16, pages 593–603. Springer, 2005. doi:10.1007/11602613_60.
  • [5] Manuel Bodirsky, Clemens Gröpl, and Mihyun Kang. Generating labeled planar graphs uniformly at random. Theoretical Computer Science, 379(3):377–386, 2007. doi:10.1016/J.TCS.2007.02.045.
  • [6] Manuel Bodirsky, Clemens Gröpl, and Mihyun Kang. Generating unlabeled connected cubic planar graphs uniformly at random. Random Structures & Algorithms, 32(2):157–180, 2008. doi:10.1002/RSA.20206.
  • [7] John D. Dixon and Herbert S. Wilf. The random selection of unlabeled graphs. Journal of Algorithms, 4(3):205–213, 1983. doi:10.1016/0196-6774(83)90021-4.
  • [8] Éric Fusy. Uniform random sampling of planar graphs in linear time. Random Structures & Algorithms, 35(4):464–522, 2009. doi:10.1002/RSA.20275.
  • [9] Andrew Gainer-Dewar and Ira M. Gessel. Counting unlabeled k-trees. Journal of Combinatorial Theory, Series A, 126:177–193, 2014. doi:10.1016/J.JCTA.2014.05.002.
  • [10] Pu Gao and Nicholas Wormald. Uniform generation of random regular graphs. SIAM Journal on Computing, 46:1395–1427, 2017. doi:10.1137/15M1052779.
  • [11] Pu Gao and Nicholas Wormald. Uniform generation of random graphs with power-law degree sequences. In Proceedings of the 29th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1741–1758, 2018. doi:10.1137/1.9781611975031.114.
  • [12] Fănică Gavril. Algorithms for minimum coloring, maximum clique, minimum covering by cliques, and maximum independent set of a chordal graph. SIAM Journal on Computing, 1(2):180–187, 1972. doi:10.1137/0201013.
  • [13] András Hajnal and János Surányi. Über die auflösung von graphen in vollständige teilgraphen. Ann. Univ. Sci. Budapest, Eötvös Sect. Math, 1:113–121, 1958.
  • [14] Úrsula Hébert-Johnson, Daniel Lokshtanov, and Eric Vigoda. Counting and sampling labeled chordal graphs in polynomial time, 2023. doi:10.48550/arXiv.2308.09703.
  • [15] Mark R. Jerrum, Leslie G. Valiant, and Vijay V. Vazirani. Random generation of combinatorial structures from a uniform distribution. Theoretical Computer Science, 43:169–188, 1986. doi:10.1016/0304-3975(86)90174-X.
  • [16] Walter Oberschelp. Kombinatorische anzahlbestimmungen in relationen. Mathematische Annalen, 174:53–78, 1967.
  • [17] OEIS Foundation Inc. Entry A058862 in the On-Line Encyclopedia of Integer Sequences, 2024. Published electronically at http://oeis.org.
  • [18] Toshiki Saitoh, Yota Otachi, Katsuhisa Yamanaka, and Ryuhei Uehara. Random generation and enumeration of bipartite permutation graphs. Journal of Discrete Algorithms, 10:84–97, 2012. doi:10.1016/J.JDA.2011.11.001.
  • [19] Herbert S. Wilf. The uniform selection of free trees. Journal of Algorithms, 2(2):204–207, 1981. doi:10.1016/0196-6774(81)90021-3.
  • [20] Nicholas C. Wormald. Generating random unlabelled graphs. SIAM Journal on Computing, 16(4):717–727, 1987. doi:10.1137/0216048.