  The Wiener index is maximized over the set of trees with the given vertex
weight and degree sequences. This model covers the traditional "unweighed"
Wiener index, the terminal Wiener index, and the vertex distance index. It is
shown that there exists an optimal caterpillar. If weights of internal vertices
increase in their degrees, then an optimal caterpillar exists with weights of
internal vertices on its backbone monotonously increasing from some central
point to the ends of the backbone, and the same is true for pendent vertices. A
tight upper bound of the Wiener index value is proposed and an efficient greedy
heuristics is developed that approximates well the optimal index value.
Finally, a branch and bound algorithm is built and tested for the exact
solution of this NP-complete problem.
