Formulas for the Wiener number and the Hosoya-Wiener polynomial of edge and vertex
weighted graphs are given in terms of edge and path contributions. For a rooted tree, the Hosoya-
Wiener polynomial is expressed as a sum of vertex contributions. Finally, a recursive formula
for computing the Hosoya-Wiener polynomial of a weighted tree is given