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.Keywords: Wiener index for graph with weighted vertices, upper-bound estimate, greedy algorithm, optimal caterpillar 2010 MSC: 05C05, 05C12, 05C22, 05C35, 90C09, 90C35, 90C57
NomenclatureThis section introduces the basic graph-theoretic notation. The vertex set and the edge set of a simple connected undirected graph G are denoted with V (G) and E(G) respectively, and the degree (i.e., the number of incident edges) of vertex v ∈ V (G) in graph G is denoted with d G (v). Let W (G) be the set of pendent vertices (those having degree one) of graph G, and let $