P158: Enumeration of all $c$-tree with at most $v$ vertices and diameter $d$

P158: Enumeration of all $c$-tree with at most $v$ vertices and diameter $d$
Input:
Integers $n$ and $d$
Output:
All $c$-tree with at most $v$ vertices and diameter $d$.
Complexity:
$O(1)$ time per tree.
Comment:
A tree is a $c$-tree if each vertex has a color $c \in \{c_1, \dots, c_m\}$.
Reference:
[Nakano2005a] (Bibtex)