is an *internal node* of $T$.

A tree $T$ may have a distinguished vertex $r$ called the *root*; in this case $T$ is called a *rooted tree* and we write $T=T(r)$.

Let $T = T(r)$ be a rooted tree and let $v$ be a vertex of $T$. Denote by $\delta^+(v)$ the *out-degree* of $v$, $$\delta^+(v) = \begin{cases}
\delta(v) & \text{if } v = r,\\
\delta(v)-1 & \text{if } v \neq r.
\end{cases}$$ The root $r$ is a leaf of $T$ if and only if $\delta^+(r) \leqslant 1$. Moreover, for a vertex $v$ different from the root $r$, the equality $\delta^+(v) = 0$ holds if and only if $v$ is leaf of $T$.

\[d2.2\] A *labeled tree* $T=T(l)$ is a tree $T$ with a *labeling* $l\colon V(T)\to \mathbb{R}^{+}$. A *weighted tree* $T = T(w)$ is a nonempty tree $T$ with a *weight* $w \colon E(T) \to \mathbb{R}^{+}$.

Thus, in what follows, we assume that the labels on the tree vertices are some nonnegative numbers.

We also use the notion of complete multipartite graph.

\[def3.1\] A nonempty graph $G$ is called *complete $k$-partite* if its vertices can be divided into disjoint nonempty sets $X_1$, $\ldots$, $X_k$ so that $k \geqslant 2$ and 