A graph $G$ is said to be a tree if it is a connected (i.e. every two distinct vertices of $G$ can be connected by a path of vertices of $G$), acyclic (i.e., $G$ has no cycles) and simple (i.e., $G$ has no loops). A rooted tree is a directed tree with a fixed vertex, called the root, which is directed implicitly away from the root.
Question. Is there any existing code or known package that generates all rooted trees with a given number of vertices (up to isomorphism)?
I have searched a bit, but could not find any ready-to-use implementation in software like Macaulay2, SageMath, or similar systems.
gentreegfrom thenautysoftware package will generate unrooted trees, which is a starting point for Sam's proposal. If you want to roll your own which just creates rooted trees directly, it's doable in Python in about 50 to 100 lines of code (I don't have it to hand, but I've done it before) using a generator of integer partitions and theitertoolspackage forcombinations_with_replacement. $\endgroup$