Enumeration of Chord Diagrams without Loops and Parallel Chords

We enumerate chord diagrams without loops and without both loops and parallel chords. We show that the former ones describe Hamiltonian paths in $n$-dimensional octahedrons. The latter ones are also known as shapes. For labelled diagrams we obtain generating functions, for unlabelled ones we derive recurrence relations.


Introduction
A chord diagram consists of 2n points on a circle labelled with the numbers 1, 2, . . . , 2n in a circular order, joined pairwise by chords (figure 1). Many different combinatorial objects are equivalent to chord diagrams, for instance one-face maps [1] or polygons with sides identified pairwise [2]. Chord diagrams appear in theory of finite type invariants of knots and links [3], the representation theory of Lie algebras [4], the geometry of moduli spaces of flat connections on surfaces [5], in mapping class groups [6] and in other fields of pure mathematics. They also find applications in RNA analysis [7], [8], classification of textile structures [9], [10] and analysis of data structures [11]. In practice, different classes of chord diagrams appear. In this paper we study two of them, which we will call loopless diagrams and simple diagrams. A loopless chord diagram is just a diagram without loops. It turns out that such diagrams correspond to Hamiltonian cycles in an n-dimensional octahedron. Consequently, by enumerating loopless chord diagrams we enumerate these cycles as well.
By a simple diagram we mean a diagram that doesn't have neither loops nor pairs of parallel chords. Simple diagrams correspond to so-called shapes, e.g. one-face maps without vertices of degree 1 or 2 [18]. They are very important to the analysis of arbitrary one-face maps, as they describe their basic structure in the following sense: any one-face map can be obtained from a unique shape by subdividing its edges and attaching trees to it [18].
Depending on the notion of isomorphism used, two diagrams are said to be isomorphic if one could be obtained from the other either by a rotation or by a combination of rotations and reflections of the circle. Isomorphism classes of labelled chord diagrams are said to be unlabelled ones. Such diagrams find wide application in generating knots and links on surfaces [12] and for calculating knot invariants [13].
Labelled loopless chord diagrams were enumerated in [16] using a combinatorial approach. There exist formulas for the numbers of unlabelled chord diagrams without restrictions [14], [15]. Unlabelled loopless chord diagrams were implicitly counted up to a small number of chords with the help of a computer in [17] as Hamiltonian paths in an n-dimensional octahedron.
In this paper we focus on enumerating loopless and simple chord diagrams. For both classes of labelled diagrams we obtain explicit generating functions. We also derive a multivariate generating function that classifies chord diagrams according to the numbers of loops and pairs of parallel chords. As an intermediate result, we provide generating functions for the corresponding classes of linear diagrams, which are not circles but segments with points identified pairwise.
For unlabelled objects we derive systems of recurrences that can be used to efficiently compute the numbers of loopless and simple chord diagrams. In both cases we give the answers for two kinds of symmetries: only rotations as well as rotations and reflections. Finally, we provide tables listing the numbers obtained from those generating functions and recurrences for chord diagrams with up to 20 chords.

Labelled loopless chord diagrams
The number of all chord diagrams having n chords is easy to calculate. Indeed, to obtain a chord diagram we could connect the point 1 to any of 2n − 1 other points, the next free point with 2n − 3 remaining ones and so on. Thus the number of chord diagrams is equal to (2n−1)!!. The exponential generating function b(t) for these numbers has the following form: For loopless and simple diagrams it would be convenient to study so-called linear diagrams together with chord ones. Imagine we cut the circle of some chord diagram between points 1 and 2n. As a result we obtain a linear diagram, which is different from the original chord diagram in that points 1 and 2n are no longer considered to be neighboring (see figure 2). For loopless diagrams we have a simple connection between the numbers of linear (a n ) and chord (b n ) diagrams: b n = a n − a n−1 , Indeed, if we glue a loopless linear diagram with n 2 chords into a chord diagram, that is, start thinking of points 1 and 2n as of neighbors, we get a diagram with a loop if and only if these points were initially connected with a chord. The number of linear diagrams with this chord is obviously equal to the number a n−1 of linear loopless diagrams with n − 1 chords, as the operation of removing the chord (1, 2n) together with its endpoints establishes a bijection between the corresponding sets.  So we reduced the problem of enumerating loopless chord diagrams to the enumeration of loopless linear ones. Instead of enumerating them directly, it would be convenient for us to derive a recurrence for the numbers a n,k of linear diagrams with n chords, k of which are loops. Let us show that a n+1,k = a n,k−1 + (2n − k)a n,k + (k + 1)a n,k+1 , a n,k = 0 if k > n or k < 0, a 0,0 = 1. (2) Consider a chord (i, 2n+2) in a diagram with n+1 chords and k loops. There could be three different cases. If i = 2n + 1 removing this chord yields a linear diagram with k − 1 loops ( figure 3(a)). This gives us the summand a n,k−1 . Diagrams corresponding to the summand (k + 1)a n,k−1 are built from diagrams with k + 1 loops by inserting a point in the middle of one of these loops and connecting it with another new point added to the right of the rightmost point of the initial diagram (figure 3(b)). The multiplier (k + 1) is explained by the fact that the loop could be chosen in k + 1 ways. It remains to explain the summand (2n − k)a n,k in (2). The corresponding diagrams are built in such a way: take the diagram with k loops and n chords and add a new point so that it does not break any loops (figure 3(c)). Then connect it with another new point added to the right of the diagram. The multiplier 2n − k comes from the fact that the initial diagram had 2n − 1 intervals between consecutive points and one more position to the left of it. However, k of these positions are forbidden for the first new point, because they correspond to loops.
Taking into account the boundary conditions a n,k = 0 if k > n or k < 0, we get the following equation for the function P n (z): The initial condition a 0,0 = 1 in terms of P n (z) could be rewritten as P 0 (z) = 1. To solve the infinite system of equations (3) it is convenient to define the following two-variable generating function Multiplying (3) by t n /n! and summing over n from 0 to +∞, we get which could be rewritten in terms of w(z, t) as The condition P 0 (z) = 1 takes the form w(z, 0) = 1. The solution for this Cauchy problem is Now the generating function ϕ(t) for loopless linear diagrams is easily obtained by setting z = 0 in w(z, t): This function allows us to derive some useful recurrences for the numbers a n . As an example, we express the derivative This yields the following recurrence: Using the second derivative we could get from the equation the following second-order recurrence: a n+2 = (2n + 3)a n+1 + a n ⇐⇒ a n+1 = (2n + 1)a n + a n−1 ; a 0 = 1, a 1 = 0. (5) According to [16], it was first guessed by Jean Betramas of LABRI, Bordeaux, from the numerical computations and then combinatorially proved by Michiel Hazewinkel and V. V. Kalashnikov [16].
Now we turn back to the equality (1) which connects the numbers b n and a n . Let ψ(t) = +∞ n=1 b n t n /n! be the exponential generating function for the numbers b n . Multiplying (1) by t n /n! and summing the result over n, we get where χ(t) is the generation function for the numbers a n−1 . This function could be expressed through the integral of ϕ(t): It follows that the generation function for labelled loopless chord diagrams is equal to (sequence A003436 in oeis.org).

Unlabelled loopless chord diagrams
To count the numbers b n of unlabelled loopless chord diagrams with n chords we will use the Burnside Here | Fix(g)| is the number of labelled diagrams fixed by the action of the element g of some group G that defines the isomorphism relation between diagrams. In our case G will be either the cyclic group C 2n of diagram's rotations or the dihedral group D 2n of rotations and reflections.
We start with the simpler case of the cyclic group C 2n . Consider the action of the group C 2n on the set of loopless chord diagrams with 2n points and n chords. Let d be a divisor of 2n, ϕ(d) be the Euler function of it. There are ϕ(d) elements of order d in C 2n . Any such element fixes the same number f (2n, d) of diagrams. These diagrams we will call d-symmetric. So, (7) could be rewritten   Hereafter, the red chord is the one that we remove first, and the green ones are those that we are obliged to remove subsequently to preserve some diagram's property like symmetry or looplessness.
In a more complex case we get d loops in the resulting diagram ( figure 5(b)). If that happens, we remove these loops too. However we could get d new loops again (figure 5(c)) and so on. As a result we obtain the following recurrence for the numbers a (d) m : The multiplier d(m−1)−1 in (9)  Rewriting the equality (9) for a (d) m−2 and subtracting it from (9) we obtain Observe that by setting d = 1 we prove (5) combinatorially in slightly different terms.
Note that in the case of odd d we always delete a multiplier of d chords at a time. In the case of even d it could happen that we should delete only d/2 chords. This corresponds to the case of a chord (1, n + 1) connecting the opposite points of a diagram (figure 5(d)). As a consequence one more summand a (d) m−1 is added to the recurrence relation: Rewriting (11) for a (d) m−2 and subtracting from (11) as before, we get The initial conditions for (10) and (12) are the following:   Table 1).
We now proceed with enumerating non-isomorphic chord diagrams under the action of the dihedral group D 2n . The Burnside lemma could be rewritten for this case as We claim that the numbers K(n) are equal to a n−1 . Indeed, any diagram of the corresponding kind could be obtained by taking a 2-symmetric loopless linear diagram, flipping its right half, and adding one more chord lying of the axis of symmetry (figure 7(a) can be obtained from figure 7(c) in such a way). We also claim that n−2 , n 2; H(2) = 0.
To prove this equality let us take any 2-symmetric loopless linear diagram with n chords and flip its right half as before. Gluing it into a chord diagram results in not more than 2 loops. The number of loopless diagrams can be obtained with the help of inclusion-exclusion principle: take the number a n of all diagrams, subtract twice the number a n−1 of diagrams with at least 1 loop (figure 7(d) and (e)) and add the number a (2) n−2 of diagrams with exactly 2 loops (figure 7(f)). Finally we get the following formula for the numbers of loopless chord diagrams: n−1 + a (2) n−2 4 , n 2; c 1 = 0, c 2 = 1.
The first terms of the corresponding sequence 0, 1, 2, 7, 29, 1788, . . . (see Table 1) were first obtained by D. Singmaster in [17] as a result of numerical computation of non-isomorphic Hamiltonian paths in an n-dimensional octahedron (the sequence A003437 in oeis.org). Let us show that there indeed exists a bijection between Hamiltonian paths in octahedrons and loopless chord diagrams.
An n-dimensional octahedron is a graph having n pairs of vertices; every vertex is connected to all the rest except for the one from its pair. Take an n-dimensional octahedron with a distinguished Hamiltonian path ( figure 8(a)) and draw it in such a way that this path forms a circle in a plane ( figure 8(b)). Now remove all of its edges not belonging to the Hamiltonian path and add chords between those vertices that were not connected by an edge (figure 8(c)). The resulting object is a chord diagram which is necessary loopless: loops would correspond to parallel edges in an octahedron. Clearly, this transformation is invertible.
Labels on figure 8 are added just to visualize the correspondence between vertices. Any unlabelled octahedron with a distinguished unlabelled and undirected Hamiltonian path corresponds to an unlabelled loopless chord diagram considered with respect to both rotational and reflectional symmetries in exactly the same way. Let a n,k,l be the number of linear diagrams with n + 1 chords in total, k loops, and l pairs of parallel chords. We now show that these numbers satisfy the following recurrence relation: a n+1,k,l = a n,k−1,l + (2n + 1 − k − 2l)a n,k,l + (k + 1)a n,k+1,l + 2(l + 1)a n,k,l+1 + a n,k,l−1 .
Take some simple linear diagram with n + 2 chords and remove a chord ending in the point 2n + 4. Five cases could be possible. The first summand corresponds to the case of removing a single loop (2n + 3, 2n + 4) ( figure 9(a)). In the second case the numbers of loops and parallel chords don't change ( figure 9(b), summand (2n + 1 − k − 2l)a n,k,l ). The third and the fourth cases stand for two situations when a new loop (figure 9(c)) or a new pair of parallel chords (figure 9(d)), correspondingly, are introduced. Finally, in the fifth case the chord being removed was parallel to some other chord (figure 9(e)).
The recurrence (14) has to be solved with the boundary conditions a n,k,l = 0 when l > n, k > n + 1, k < 0, or l < 0, and with the initial conditions a 0,k,l = 0 for all k and l, except for a 0,1,0 = 1, that corresponds to a diagram with a single chord that is a loop.
The recurrence (14) could be rewritten as Q n+1,k (x) = Q n,k−1 (x) + (2n + 1 − k)Q n,k (x) − 2x dQ n,k (x) dx + (k + 1)Q n,k+1 (x) + xQ n,k (x) + 2 dQ n,k (x) dx for the polynomials Q n,k (x) = a n,k,0 + a n,k,1 x + a n,k,2 x 2 + . . . + a n,k,n x n . Introducing the polynomials P n (z, x) = n k=0 Q n,k (x)z k we get the following equality: Finally, multiplying this equalitiy by t n /n! and summing over n from 0 to +∞ yields the following partial differential equation for the generating function w(t, z, x) = +∞ n=0 P n (z, x) t n n! : It could be shown that it has the following analytic solution: This function classifies linear diagrams by the number of chords, loops and parallel chords. In particular, setting z = 1 results in the generating function w(t, x) = w(t, 1, x) = 1 (1 − 2t) 3/2 exp (t(x − 1)) = +∞ n=0 t n n! n l=0 a n,l x l , that classifies linear diagrams by the numbers of chords and pairs of parallel chords only. Its coefficients a n,l satisfy the following recurrence relation: a n+1,l = a n,l−1 + (2n + 1 − 2l) a n,l + 2(l + 1) a n,l+1 .
Moreover, substituting z = x = 0 into w(t, z, x), we obtain the generating function W (t) for the numbers a n,0,0 ≡ā n enumerating simple linear diagrams with n + 1 chords: From this generating function one could get the following recurrence for the numbersā n : a n = (2n − 1) ·ā n−1 + (4n − 3) ·ā n−2 + (2n − 4) ·ā n−3 , n 2;ā n = 0 for n 0;ā 1 = 1. It terms of exponential generating functions W (t), V (t), and U(t) for the numbersā n ,q n andb n we get the system Solving this system yields the following exponential generating function U(t) for labelled simple chord diagrams: Let us turn to unlabelled simple diagrams. The technique of enumerating them doesn't differ much from the one in the previous section. However, for these diagrams one has to consider more different cases to obtain the recurrence relations. In order not to overload the article, we will still describe all of them, but maybe omit some details about proving the exact forms for the coefficients and for the initial conditions. It should be straightforward to check them.
m be the numbers of d-symmetric linear simple diagrams with m · d points. In the case of odd d these numbers satisfy the following recurrence: To prove this formula we consider four cases that could be possible for a chord {1, i}: • After removing this chord the diagram is still simple ( figure 10(a)).
• Removing this chord creates a loop, but after removing this loop the diagram becomes simple ( figure 10(b)).
• Removing a chord {1, i} creates a pair of parallel chords. If that happens, we remove one (arbitrary) chord from this pair too ( figure 10(c)).
• We remove an chord {1, i}, a loop appears, but removing this loop results in a pair of parallel chords ( figure 10(d)). In this case we remove one chord from that pair too.
for other values of m, k. Here δ m,2 is the Kronecker delta that equals 1 if m = 2 and 0 otherwise. Three types of diagrams that are new here compared to the odd case are shown on figure 11. The summandā (d) m−1,k−1 enumerates diagrams with a chord {1, i} that is a diameter ( figure 11(a)). The summand (k + 1) · d ·ā (d) m−3,k+1 corresponds to the case when removing a chord {1, i} creates d/2 pairs of parallel chords, and we remove one chord from each pair, so that the other one becomes a diameter ( figure 11(b)). The summand (k + 1) · d ·ā    In the second case ( figure 13(b)) by removing the chord {1, i} together with the one symmetric to it we get a linear diagram that is ready to be glued into a simple chord diagram, and the corresponding summand isf (2m − 4, 2).  Table 2).
Finally, we will enumerate unlabelled simple chord diagrams for the case when our notion of isomorphism includes reflection symmetries as well. As before, we begin with enumerating some objects analogous to linear diagrams, as it is more convenient to establish a recurrence for them. (c) 14 1 (d) Figure 15: Simple linear diagrams with reflectional symmetry Letr n,k be the number of simple diagrams with the following properties: they have 2n points, points 1 and 2n as well as n and n + 1 are not thought to be neighboring, reflection across the line passing through the center of a diagram and the center of the segment connecting points 1 and 2n transforms a diagram into itself, and the number of chords that are transformed into itself under such a reflection is equal to k. For example the diagram on figure 15(a) is the one counted byr 7,3 . For the number of such diagrams with an additional property that they have a chord {1, 2n} we introduce a separate sequences n,k . We claim that s n,k =r n−1,k−1 −s n−1,k−1 for n > 0;s 0,k = 0.
Indeed, any corresponding diagram consists of a chord {1, 2n} and the remaining part which is a diagram with 2n − 2 points that does not have the same type of chord, thus counted byr n−1,k−1 − −s n−1,k−1 . The recurrence forr n,k is much more complicated: r n,k = 0 if n < 0 or k < 0 or k > n.r 0,0 =r 2,0 = 1.
To prove it we again classify all the corresponding diagrams according to the properties of a chord {1, i}. 7 possible cases are: • i = 2n. This case is counted bys n,k . In all the cases below it is assumed that i = 2n. (c) 16 1 (d) Figure 16: Counting simple diagrams with reflectional symmetry • Removing a chord {1, i} together with the one symmetric to it yields a simple diagram ( figure  15(b)). This case is enumerated by 2(n − 2)r n−2,k +s n−2,k , because to reconstruct an initial diagram one could take a diagram with 2n − 4 points and find a place for the new chord. 2n − 4 options are always available, and one more option becomes available if the chord {1, 2n − 4} is present, because it cannot be parallel to the newly added chord (result is shown on figure  15(c)).
• Removing a chord {1, i} together with the one symmetric to it yields a diagram with a pair of loops; removing these loops yields a simple diagram. (figure 15(d), summand 2(n − 3)r n−4,k ).
• Removing a chord {1, i} together with the one symmetric to it yields a diagram with two pairs of parallel chords; removing one chord from each pair yields a simple diagram (figure 16(a), summand 2(n − k − 4)r n−4,k ).
• Removing a chord {1, i} together with the one symmetric to it yields a diagram with one pair of parallel chords; removing one chord from it yields a simple diagram. ( figure 16(b), summand 2(k − 1)r n−3,k−1 ).
• Removing a chord {1, i} together with the one symmetric to it yields a diagram with two pairs of loops; removing them creates one pair of parallel chords; removing a chord from this pair yields a simple diagram. (figure 16(c), summand 2(k − 1)r n−5,k−1 ).
• Removing a chord {1, i} together with the one symmetric to it yields a diagram with two pairs of loops; removing them creates two pairs of parallel chords; removing a chord from each pair yields a simple diagram. (figure 16(c), summand 2(n − k − 6)r n−6,k ).
Denoting byr n the sum ofr n,k over k and bys n the corresponding sum ofs n,k , we are ready to enumerate chord diagrams that are transformed into themselves by reflections. Those can be of two types. The axis of symmetry can either pass through two opposite points, or through the center of the segment that connects two neighboring points, like in linear diagrams we studied above. Let the number of diagrams of the first type with n chords beK (n), and of the second typeH(n). We claim thatK (0) =K(1) = 0;K(n) =r n−1 −K(n − 2) for n > 1.
Indeed, any diagram enumerated by K n has a chord on its axis of symmetry. Removing this chord yields a diagram that can be almost arbitrary, except that it can't have chords {1, n−1} and {n, 2n− − 2} like the one on figure 17 (a). But this forbidden type of diagrams is enumerated byK(n − 2), as these two chords can be viewed as a single chord that lies on the axis of symmetry. ForH(n) the formula isH (0) = 0;H(n) =L(n) −K(n − 1) for n > 0, wherē L(0) =L(1) = 0;L(n) =r n − 2s n +L(n − 2) for n > 1.
14 1 (a) 14 1 (b) Figure 17: Counting chord diagrams with reflectional symmetry HereK(n − 1) is the number of chord diagrams that would have parallel chords after gluing ( figure  17(a)). It is subtracted fromL(n), which is the number of diagrams that would not have any loops. The given recurrence forL(n) is easily proved: take allr n diagrams, subtract those with a chord {1, 2n}, then those with a chord {n, n + 1}, and finally add the number of diagrams that have both of them. The last number isL(n − 2), as deleting these chords ( figure 17(b)) yields a diagram that doesn't have this type of chords anymore.
The following formula enumerates non-isomorphic simple diagrams under the action of a dihedral group. It is just the Burnside lemma rewritten in terms of the sequences that we derived above: ϕ(d)f (2n, d) + n ·K(n) + n ·H(n)   .

Conclusion
In the first part of this paper labelled and unlabelled loopless chord diagrams were enumerated. Consequently, we obtained the expressions for the numbers of non-isomorphic hamiltonian cycles in an unlabelled n-dimensional octahedron. In the second part we solved a more technically complex problem of enumerating simple diagrams. We obtained a generating function for labelled diagrams classified by the numbers of loops and parallel chords. As a special case, we got a generating function for simple chord diagrams. For unlabelled simple chord diagrams we gave a solution in a form of several recurrence relations. The following tables list the numbers of different kinds of diagrams described above.