1 Introduction

In a paper on the asymptotics of random tournaments, Pontus Andersson [1, p. 252] introduced the concept of an even graph in the following fashion: Given a graph X, assign an arbitrary orientation to its edges. Then, an automorphism \(g \in \mathrm {Aut}(X)\) reverses the sense of an edge \(e = \{u,v\}\) if e is oriented from u to v, but \(e^g\) is oriented from \(v^g\) to \(u^g\). Changing the orientation of the graph might alter the number of edges whose sense is reversed by g, but Andersson showed that it does not alter the parity of this number. He defined a graph to be odd if it has an automorphism reversing the sense of an odd number of edges and even otherwise. (This is somewhat overloading the adjectives “even” and “odd”, which are already used for several different concepts relating to both permutations and graphs but, to avoid confusion, we shall be explicit when using any of these other meanings.)

Figure 1 shows the pairwise non-isomorphic graphs on four vertices, along with an odd automorphism, i.e. an automorphism reversing the sense of an odd number of edges, if one exists. The four graphs with no odd automorphism listed are the four even graphs on four vertices.

A tournament is a directed graph D with arc set A(D) such that for any distinct vertices \(\{v,w\}\), either \((v,w) \in A(D)\) or \((w,v) \in A(D)\), but not both. Equivalently, a tournament is an oriented complete graph. Figure 2 illustrates the four pairwise non-isomorphic tournaments on four vertices.

When counting graphs (or tournaments, even graphs, etc.) on n vertices, we normally fix a vertex set of size n, and distinguish between counting pairwise distinct graphs and counting pairwise non-isomorphic graphs as above. For brevity the former is normally referred to as counting labelled graphs, and the latter as counting unlabelled graphs. As we shall see, it is no coincidence that the numbers of unlabelled even graphs and tournaments on four vertices are the same. Pontus von Brömssen computed the number of unlabelled even graphs on up to 10 vertices to enter the sequence into the On-Line Encyclopedia of Integer Sequences [4]. He was surprised to see that his numbers coincided perfectly with the leading entries of the sequence A000568 of [4], which counts the number of unlabelled tournaments. In a comment on the sequence, he asked whether the numbers of such even graphs and tournaments actually coincide for all n. In this note, we answer this question positively.

Fig. 1
figure 1

4-vertex graphs with an odd automorphism if one exists

Fig. 2
figure 2

Tournaments on four vertices

The most obvious and satisfying way to prove that two sequences counting combinatorial structures are the same is to find a reasonably natural bijection between the sets enumerated by the two sequences. This not only proves that the sequences are equal, but also gives a convincing explanation for why they are the same. The second-best option is to find a counting argument showing that the two sequences are given by the same formula or expression (or satisfy the same recurrence, etc.). By using the Cauchy–Frobenius theorem and double counting, we find expressions for the numbers of unlabelled graphs, tournaments and odd graphs, showing that for any fixed number of vertices,

$$\begin{aligned} \text {Number}\, \text {of }\, \text {graphs} = \text {Number}\, \text {of }\, \text {tournaments}\, + \text {Number}\, \text {of }\, \text {odd}\, \text {graphs}. \end{aligned}$$

As a graph is either even or odd, this immediately implies our main result:

Theorem 1.1

For all \(n \geqslant 2\), the number of pairwise non-isomorphic even graphs on n vertices is equal to the number of pairwise non-isomorphic tournaments on n vertices.

It is an open problem to find a natural bijection between the sets of unlabelled even graphs and tournaments on n vertices.

2 Counting graphs

In general, counting a family of labelled (i.e. pairwise distinct) graphs on n vertices is easier than counting unlabelled (i.e. pairwise non-isomorphic) graphs. The Cauchy–Frobenius theorem is a fundamental tool that can be used to express the number of unlabelled graphs as a sum, each of whose terms is the size of a specific set of labelled graphs.

Before applying this theorem, however, we need to establish some notation. Let \([n] = \{1,2,\ldots ,n\}\) denote the vertex set of all of our graphs and tournaments on n vertices. Then, define

$$\begin{aligned} E_n = \{ \{u,v\} : u, v \in [n], u \ne v \}, \end{aligned}$$

so that \(E_n\) is the set of unordered pairs of distinct vertices. We think of \(E_n\) as being the set of all possible edges in a graph with vertex set [n].

Suppose that X and Y are graphs with vertex set [n] and edge-sets E(X) and E(Y), respectively. Then X and Y are isomorphic if and only if there is some permutation \(g \in \mathrm {Sym}(n)\) such that \(E(Y) = E(X)^g\), where

$$\begin{aligned} E(X)^g = \{ \{u^g,v^g\} \mid \{u,v\} \in E(X)\}. \end{aligned}$$

So the number of unlabelled graphs is the number of orbits of the symmetric group \(\mathrm {Sym}(n)\) acting on \(\Omega = {\mathcal {P}}(E_n)\) (the powerset of \(E_n\)).

In order to count orbits, we turn to the following well-known theorem (see Neumann [3] for the fascinating history of this result).

Theorem 2.1

(Cauchy–Frobenius theorem) Let G be a permutation group acting on a set \(\Omega \). The number of orbits of G on \(\Omega \) is given by the expression

$$\begin{aligned} \frac{1}{|G|} \sum _{g \in G} |\mathrm {fix}(g)|, \end{aligned}$$

where \(\mathrm {fix}(g)\) is the set of elements of \(\Omega \) fixed by g.

In other words, the number of orbits of G on \(\Omega \) is equal to the average number of fixed points of the elements of G.

In order to apply this theorem, we need to know how many subsets of \(E_n\) are fixed by a permutation \(g \in \mathrm {Sym}(n)\) in its induced action on \(E_n\). Equivalently, we need to know how many labelled graphs are fixed by g.

So for \(g \in \mathrm {Sym}(n)\), let \(g_E\) denote the permutation induced by g on \(E_n\). For example, if \(n = 4\) and \(g = (1,2,3,4)\), then

$$\begin{aligned} g_E = \left( \{1,2\}, \{2,3\}, \{3,4\}, \{1,4\} \right) \ \left( \{1,3\}, \{2,4\} \right) . \end{aligned}$$

Now any subset of \(E_4\) that is fixed by \(g_E\) must either contain all of the pairs \(\{ \{1,2\}, \{2,3\}, \{3,4\}, \{1,4\}\}\) or none of them, and similarly for \(\{\{1,3\}, \{2,4\}\}\). So there are \(2^2 = 4\) subsets of \(E_n\) (or labelled graphs) fixed by \(g_E\).

In general, a subset of \(E_n\) is fixed by \(g_E\) if and only if it is the union of the cycles of \(g_E\) (here, and later, we identify a cycle of \(g_E\) with its support, i.e. the set of edges that it moves). So letting \(c(g_E)\) denote the number of cycles of \(g_E\), there are exactly \(2^{c(g_E)}\) labelled graphs fixed by \(g_E\). By the Cauchy–Frobenius theorem, we conclude that the number of isomorphism classes of graphs on n vertices is given by the expression

$$\begin{aligned} \frac{1}{n!} \sum _{g \in \mathrm {Sym}(n)} 2^{c(g_E)}. \end{aligned}$$
(1)

3 Counting tournaments

In this section, we will derive an analogous expression for the number of unlabelled tournaments on n vertices, essentially by considering arcs rather than edges. We start by defining

$$\begin{aligned} A_n = \{ (u,v) : u, v \in [n], u \ne v\}, \end{aligned}$$

so that where \(E_n\) was the set of all possible edges, \(A_n\) is the set of all possible arcs.

So, for \(g \in \mathrm {Sym}(n)\), let \(g_A\) denote the permutation induced by g on \(A_n\). For example, if \(n = 4\) and \(g=(1,2,3,4)\), then

$$\begin{aligned} g_A = \left( (1,2),(2,3),(3,4),(4,1)\right) \left( (2,1),(3,2),(4,3),(1,4)\right) \left( (1,3),(2,4),(3,1),(4,2)\right) . \end{aligned}$$

In this case, \(g_A\) has three cycles, say \(C_1\), \(C_2\) and \(C_3\). The first two cycles \(C_1\) and \(C_2\) are closely related, in the sense that \(C_2\) can be obtained from \(C_1\) by reversing every arc, and vice versa. In contrast, reversing every arc in \(C_3\) simply yields \(C_3\) again. We use \(c(g_A)\) to denote the number of cycles of \(g_A\).

We need a little bit more notation and terminology to discuss the general case. If a refers to an ordered pair, say (uv), then \({\overline{a}}\) refers to its reverse (vu) and e(a) refers to the unordered pair \(\{u,v\}\).

Suppose that \(C = (a_1, a_2, \ldots , a_k)\) is a cycle of \(g_A\) and let \( {\overline{C}} = (\overline{a_1}, \overline{a_2}, \ldots , \overline{a_k}) \) be the cycle obtained from C by reversing each arc. If \(C = {\overline{C}}\), then we say that C is self-paired, otherwise non-self-paired. So in general, \(g_A\) has some number (maybe zero) of self-paired cycles, the remaining non-self-paired cycles occur in pairs of the form \(\{C, {\overline{C}}\}\).

In order to use the Cauchy–Frobenius theorem, we need to understand the relationship between the cycle structures of g, \(g_A\) and \(g_E\).

If C is a non-self-paired cycle \((a_1, a_2, \ldots , a_k)\) of \(g_A\), then its undirected image

$$\begin{aligned} \left( e(a_1), e(a_2), \ldots , e(a_k) \right) \end{aligned}$$

is a cycle of \(g_E\), and clearly \({\overline{C}}\) has the same undirected image.

If instead C is a self-paired cycle of \(g_A\), then

$$\begin{aligned} C = \left( a_1, a_2, \ldots , a_k, \overline{a_1}, \overline{a_2}, \ldots , \overline{a_k} \right) , \end{aligned}$$

for some \(a_1,\ldots ,a_k \in A_n\). As \(e(a) = e({\overline{a}})\), if each arc a is replaced by e(a) we obtain the cycle

$$\begin{aligned} \left( e(a_1), e(a_2), \ldots , e(a_k), e(a_1), e(a_2), \ldots , e(a_k) \right) , \end{aligned}$$

which is a cycle of \(g_E\) “wrapped around twice”. In this case, we define the undirected image of C to be the cycle \(\left( e(a_1), e(a_2), \ldots , e(a_k)\right) \).

As we shall shortly see, it is the presence or absence of self-paired cycles that is crucial when counting both tournaments and odd graphs. This, in turn, depends on the order |g| of g.

Lemma 3.1

The permutation \(g_A\) has a self-paired cycle if and only if |g| is even.

Proof

If g has even order, then it has a cycle of even length, say \((1,2, \ldots , 2k)\). Then the cycle

$$\begin{aligned} \left( (1,k+1), (2,k+2), \ldots , (k,2k), (k+1,1), \ldots , (2k,k) \right) \end{aligned}$$

is a self-paired cycle of \(g_A\).

Conversely, if \(g_A\) has a self-paired cycle, then this cycle has even length, and so \(|g_A|\) is even, implying that |g| is even. \(\square \)

Corollary 3.2

The automorphism group of a tournament has odd order.

Proof

Let T be a tournament, and suppose that \(g \in \mathrm {Aut}(T)\). If g has even order, then by Lemma 3.1, \(g_A\) has a self-paired cycle C, which contains at least one pair of arcs of the form \(\{a,{\overline{a}}\}\). The tournament is fixed by g if and only if its arc set is a union of cycles of \(g_A\), and so C must either be a subset of A(T) or disjoint from A(T). However, neither is possible because exactly one of a, \({\overline{a}}\) is an arc of T. \(\square \)

Theorem 3.3

The number of isomorphism classes of tournaments on n vertices is given by the expression

$$\begin{aligned} \frac{1}{n!} \sum _{\begin{array}{c} g \in \mathrm {Sym}(n)\\ |g|\ \mathrm {odd} \end{array}} 2^{c(g_E)}. \end{aligned}$$
(2)

Proof

We apply the Cauchy–Frobenius theorem with \(G=\mathrm {Sym}(n)\) and \(\Omega \) the set of (labelled) tournaments. By Corollary 3.2, permutations of even order do not contribute to the sum. If g has odd order, then \(g_A\) has no self-paired cycles, and a tournament is fixed by g if and only if its arc set is a union of cycles of \(g_A\) containing exactly one cycle from each pair \(\{C, {\overline{C}}\}\). Therefore g fixes exactly \(2^{c(g_A)/2}\) tournaments. As \(g_A\) has no self-paired cycles, \(c(g_A)/2 = c(g_E)\) and so the number of isomorphism classes of tournaments on n vertices is given by (2). \(\square \)

An explicit expression for the number of isomorphism classes of tournaments was first given by Davis [2], although expressed as a sum over conjugacy classes of permutations rather than a sum over individual permutations.

4 Counting odd graphs

We now derive a similar expression for counting pairwise non-isomorphic odd graphs on n vertices. Let X be a graph on the vertex set [n]. Whether or not an automorphism \(g \in \mathrm {Aut}(X)\) is an odd automorphism for X is independent of the orientation of X, and it is convenient henceforth to assume \(V(X) = [n]\) and each edge is oriented from the lower- to the higher-numbered vertex.

An inversion of a permutation \(h \in \mathrm {Sym}(n)\) is a pair \(\{u,v\}\) of distinct elements of [n] such that \(u<v\) and \(u^h > v^h\). An edge of X has its sense reversed by a permutation \(g \in \mathrm {Aut}(X)\) if and only if it is an inversion of g. So the set of edges of a graph X whose sense is reversed by a permutation \(g \in \mathrm {Aut}(X)\) is the set of inversions of g that are also edges of X.

Now, given \(g \in \mathrm {Aut}(X)\), the sign \(\mathrm {sgn}_X(g)\) of g with respect to X is the value

$$\begin{aligned} \mathrm {sgn}_X(g) = \prod _{\{u,v\} \in E(X)} \frac{u^g - v^g}{u - v}. \end{aligned}$$

Each term in the product is well defined because \(\frac{u^g - v^g}{u - v} = \frac{v^g - u^g}{v - u}\). Because \(g \in \mathrm {Aut}(X)\), the numerator and denominator of this expression are each a product of the same multiset of values, but permuted, and possibly with changes of sign. It follows therefore that \(\mathrm {sgn}_X(g) \in \{-1,1\}\).

An edge \(\{u,v\}\) contributes \(\pm 1\) to the product, with the contribution being \(-1\) if and only if its sense is reversed by g. Therefore g is an odd automorphism for X if and only if \(\mathrm {sgn}_X(g) = -1\).

Lemma 4.1

The function \(\mathrm {sgn}_X\) is a group homomorphism from \(\mathrm {Aut}(X)\) to the multiplicative group \((\{-1,1\}, \times )\).

Proof

Suppose that g, \(h \in \mathrm {Aut}(X)\). Then,

$$\begin{aligned} \mathrm {sgn}_X(gh)&= \prod _{\{u,v\} \in E(X)} \frac{u^{gh}-v^{gh}}{u - v} = \prod _{\{u,v\} \in E(X)} \frac{u^g-v^g}{u - v} \cdot \frac{(u^g)^h - (v^g)^h}{u^g-v^g}\\&= \prod _{\{u,v\} \in E(X)} \frac{u^g-v^g}{u - v} \cdot \prod _{\{u,v\} \in E(X)}\frac{(u^g)^h - (v^g)^h}{u^g-v^g} = \mathrm {sgn}_X(g) \ \mathrm {sgn}_X(h), \end{aligned}$$

where the second product in the last line is equal to \(\mathrm {sgn}_X(h)\) because \(g \in \mathrm {Aut}(X)\). \(\square \)

Corollary 4.2

Exactly half of the permutations in \(\mathrm {Aut}(X)\) are odd automorphisms for X if and only if X is an odd graph.

Proof

The following are equivalent: (a) exactly half of the permutations in \(\mathrm {Aut}(X)\) are odd automorphisms for X, (b) \(\mathrm {sgn}_X\) maps onto \(\{-1,1\}\), (c) there exists \(g\in \mathrm {Aut}(X)\) with \(\mathrm {sgn}_X(g)=-1\), and (d) X is an odd graph. \(\square \)

Lemma 4.3

Suppose that \(g \in \mathrm {Sym}(n)\). Then, a cycle of \(g_E\) contains an odd number of inversions of g if and only if it is the undirected image of a self-paired cycle of \(g_A\).

Proof

Let C be a cycle of \(g_A\) that is not self-paired, and let \(C'\) be its undirected image. Label each arc (uv) of C with 0 if \(u < v\) or 1 otherwise, and count the number of times the label changes (from 0 to 1 or vice-versa) as C is traversed exactly once in cyclic order starting and ending at the same arc. This number is precisely the number of inversions of g that lie in \(C'\). As the label at the starting and ending point of this traversal is the same, the number of changes is even. Therefore \(C'\) contains an even number of inversions of g.

Now suppose that \(C'\) is the undirected image of a self-paired cycle

$$\begin{aligned} C = (a_1, a_2, \ldots , a_k, \overline{a_1},\overline{a_2},\ldots ,\overline{a_k}) \end{aligned}$$

of \(g_A\). As previously, label each arc (uv) in C with 0 if \(u<v\) and 1 if \(v < u\), and again count the total number of label changes as the cycle C is traversed from \(a_1\) to \(\overline{a_1}\). (This corresponds to traversing \(C'\) exactly once in cyclic order, but takes into account the fact that \(g^k\) reverses the sense of \(a_1\).) As the start and end of this traversal have different labels, there are an odd number of label changes. Therefore the undirected image of any self-paired cycle of \(g_A\) contains an odd number of inversions of g. \(\square \)

Returning to the example of \(g=(1,2,3,4)\) from Sect. 2, we see that the first cycle of \(g_E\) contains two inversions of g, namely \(\{3,4\}\) and \(\{1,4\}\), while the second cycle of \(g_E\) contains just one.

Finally, we have enough to count odd graphs.

Theorem 4.4

The number of isomorphism classes of odd graphs on n vertices is given by the expression

$$\begin{aligned} \frac{1}{n!} \sum _{\begin{array}{c} g \in \mathrm {Sym}(n)\\ |g|\ \mathrm {even} \end{array}} 2^{c(g_E)}. \end{aligned}$$
(3)

Proof

We will double-count the elements of the following set

$$\begin{aligned} S = \{(X, g) : g \text { is an odd automorphism for the }n\text {-vertex odd graph } X\}. \end{aligned}$$

If X is an odd graph, then there are \(n!/|\mathrm {Aut}(X)|\) labelled graphs isomorphic to X, and by Corollary 4.2, each of these has \(|\mathrm {Aut}(X)|/2\) odd automorphisms, meaning that each isomorphism class of odd graphs contributes n!/2 pairs to S. So if there are K pairwise non-isomorphic odd graphs, then \(|S| = K n!/2\).

Now, a permutation \(g \in \mathrm {Sym}(n)\) is an odd automorphism for a graph X if and only if E(X) is a union of cycles of \(g_E\) that (collectively) contain an odd number of inversions of g.

If g has odd order, then by Lemma 3.1 every cycle of \(g_A\) is non-self-paired, and hence by Lemma 4.3, every cycle of \(g_E\) contains an even number of inversions of g. Therefore, S contains no pairs (Xg) for which g has odd order.

If g has even order, then \(g_E\) has at least one cycle, say C, that is the undirected image of a self-paired cycle and therefore contains an odd number of inversions of g (again using Lemmas 3.1 and 4.3).

There are \(2^{c(g_E)-1}\) subsets of \(E_n\) obtained by taking the union of a subset of the cycles of \(g_E\) other than C. If \({\widehat{E}}\) is one of these subsets, then exactly one of \({\widehat{E}}\) and \({\widehat{E}} \cup C\) contains an odd number of inversions of g. (If \({\widehat{E}}\) contains an even number of inversions of g, then \({\widehat{E}} \cup C\) contains an odd number of inversions of g.)

Therefore, when g has even order, it contributes \(2^{c(g_E)-1}\) pairs (Xg) to S.

It follows that

$$\begin{aligned} |S| = K \frac{n!}{2} = \sum _{\begin{array}{c} g \in \mathrm {Sym}(n)\\ |g|\ \mathrm {even} \end{array}} 2^{c(g_E)-1} \end{aligned}$$

and so K is given by the expression (3). \(\square \)

Every permutation of \(\mathrm {Sym}(n)\) has even order or odd order, and so we obtain, from Theorems 3.3 and 4.4 , the final expression

figure a

Therefore, the number of isomorphism classes of n-vertex tournaments is equal to the number of isomorphism classes of n-vertex even graphs, and we have proved Theorem 1.1.