Database of Halin graphs

Halin graphs are planar graphs constructed by taking a tree on four or more vertices where every non-leaf has at least three neighbours, embedding it in the plane, and adding edges to form a cycle from the leaves. (For more see Wikipedia, graphclasses.org, MathWorld). Until recently the OEIS sequence for the number of Halin graphs on n vertices, A346779, only went up to n=14. I extended it to n=24 constructively, and here make available lists of the Halin graphs on 4 to 24 vertices in graph6 format. The larger files are compressed with gzip.

4 vertices (1 graph)
5 vertices (1 graph)
6 vertices (2 graphs)
7 vertices (2 graphs)
8 vertices (4 graphs)
9 vertices (6 graphs)
10 vertices (13 graphs)
11 vertices (22 graphs)
12 vertices (50 graphs)
13 vertices (106 graphs)
14 vertices (252 graphs)
15 vertices (589 graphs)
16 vertices (1475 graphs)
17 vertices (3669 graphs)
18 vertices (9435 graphs)
19 vertices (24345 graphs)
20 vertices (63837 graphs, gzipped)
21 vertices (168234 graphs, gzipped)
22 vertices (447562 graphs, gzipped)
23 vertices (1196390 graphs, gzipped)
24 vertices (3218221 graphs, gzipped)

Construction algorithm

The key theorem is due to Jordan: a finite tree has a centre or a bicentre. This was applied to the enumeration of certain classes of trees by Cayley at least as early as 1875. Here it is straightforward to apply it to the generation of suitable trees: if the tree has a centre then it must have at least three neighbours, each of which is the root of a rooted tree with no vertex of degree 3. Similarly if it has a bicentre then the two vertices making up the bicentre are each the root of a rooted tree with no vertex of degree 3. In each case the root has an "external" edge, either to the centre or to its partner in the bicentre, so we can construct suitable rooted trees by simple recursive construction of directed trees where no vertex has out-degree 1. There is a slight subtlety in that the heights of the rooted trees must be matched so that the centre/bicentre really is such; in preparing this page I've been reminded that Cayley found it easier to use the notion, also due to Jordan, of centroids and bicentroids. Perhaps this would be simpler here too.

Then it merely remains to embed the tree in the plane and form the cycle: but this is merely a matter of permuting the out-edges of each vertex independently. As a practical matter this should be done modulo symmetries: e.g. if a vertex has k leaves as neighbours then the k! permutations thereof all produce isomorphic embeddings, and there is no advantage in enumerating them all. However, careful elimination of all symmetries is fiddly, and I play it safe by keeping it simple and then filtering with Nauty's graph hashing.

References:
A. Cayley (1875) On the analytic forms called trees, with applications to the theory of chemical combinations, Rep. Br. Assoc. Adv. Sci. 45, pp257-305.
C. Jordan (1869) Sur les assemblages de lignes, J. für die reine und angewandte Mathematik 70 (2) pp185-190.
B.D. McKay and A. Piperno (2014) Practical Graph Isomorphism, II, J. Symb. Comp., 60, pp94-112