Number of undirected trees with unlabled vertices and labeled edges

cayley-graphscombinatoricstrees

I would appreciate some help coming up with an expression for the number of spanning trees of an undirected graph with m labeled edges but m+1 unlabled vertices.
The answer is supposed to be ${m+1}^{m-2}$, but the best I came up with is ${m+1}^{m-1}$, with help from this discussion.
What I did was using the Cayley forumula for undirected labeled trees with m+1 vertices, choosing the m+1 as my root and from there I "moved" the number on each vetex onto the edge before it.
In this way I managed to have a tree with m labeled edges, as I looked for, but from the given answer I guess I missed some double counting which I'm not able to detect.

Best Answer

Let $T$ be a tree with $m$ edges labelled $1$ through $m$ and $m+1$ vertices. Pick any vertex, and label it $0$. Root $T$ at $0$. Label each vertex of height $1$ with the label of the edge joining it to $0$. Label each vertex of height $2$ with the label of the unique edge joining it to a vertex of height $1$. Continue in this fashion until every vertex has been given the label of the edge joining it to its parent in the rooted tree.

Each pair $\langle T,v\rangle$ of an edge-labelled tree with $m$ edges labelled $1$ through $m$ and a vertex $v$ of $T$ gives rise in this way to a distinct vertex-labelled tree on $m+1$ vertices labelled $0$ through $m$. If we start with such a vertex-labelled tree and take the vertex $v$ with label $0$ as the root, we can transfer the label on each of the $m$ remaining vertices to the edge joining it to its parent to reverse the process to recover $\langle T,v\rangle$. This shows that if there are $t_m$ edge-labelled trees with $m$ edges labelled $1$ through $m$, then $t_m(m+1)=(m+1)^{m-1}$, and hence $t_m=(m+1)^{m-2}$.