Terminal Wiener index

Motivated by some recent research on the terminal (reduced) distance matrix, we consider the terminal Wiener index (TW) of trees, equal to the sum of distances between all pairs of pendent vertices. A simple formula for computing TW is obtained and the trees with minimum and maximum TW are characterized.